From 8ddaf24a940dac7384c8bb6c912f2ac08370913c Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 30 Sep 2024 18:20:30 +0800 Subject: [PATCH] chore: cleanup --- thermion_dart/native/src/FilamentViewer.cpp | 9 +-------- thermion_dart/native/src/ThermionDartApi.cpp | 1 - thermion_dart/native/src/ThermionDartRenderThreadApi.cpp | 3 --- .../android/src/main/cpp/ThermionFlutterAndroid.cpp | 7 ------- .../kotlin/dev/thermion/android/ThermionFlutterPlugin.kt | 2 -- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/thermion_dart/native/src/FilamentViewer.cpp b/thermion_dart/native/src/FilamentViewer.cpp index b569e885..ed51f0e4 100644 --- a/thermion_dart/native/src/FilamentViewer.cpp +++ b/thermion_dart/native/src/FilamentViewer.cpp @@ -128,14 +128,7 @@ namespace thermion : _resourceLoaderWrapper(resourceLoader) { - _context = (void *)sharedContext; - - if(!_context) { - Log("Creating, no shared context"); - } else { - Log("Creating with shared context"); - } - + _context = (void *)sharedContext; ASSERT_POSTCONDITION(_resourceLoaderWrapper != nullptr, "Resource loader must be non-null"); diff --git a/thermion_dart/native/src/ThermionDartApi.cpp b/thermion_dart/native/src/ThermionDartApi.cpp index 39a5f824..b2518e75 100644 --- a/thermion_dart/native/src/ThermionDartApi.cpp +++ b/thermion_dart/native/src/ThermionDartApi.cpp @@ -46,7 +46,6 @@ extern "C" EMSCRIPTEN_KEEPALIVE TViewer *Viewer_create(const void *context, const void *const loader, void *const platform, const char *uberArchivePath) { - Log("CREATE"); const auto *loaderImpl = new ResourceLoaderWrapperImpl((ResourceLoaderWrapper *)loader); auto viewer = new FilamentViewer(context, loaderImpl, platform, uberArchivePath); return reinterpret_cast(viewer); diff --git a/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp b/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp index 46777dc6..a8839bec 100644 --- a/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp +++ b/thermion_dart/native/src/ThermionDartRenderThreadApi.cpp @@ -160,10 +160,7 @@ public: _viewer = (FilamentViewer *)Viewer_create((void *const)_context, loader, platform, uberArchivePath); MAIN_THREAD_EM_ASM({ moduleArg.dartFilamentResolveCallback($0, $1); }, callback, _viewer); #else - Log("CREATING1"); - auto viewer = (FilamentViewer *)Viewer_create(context, loader, platform, uberArchivePath); - Log("CREATING2"); _viewer = reinterpret_cast(viewer); callback(_viewer); #endif diff --git a/thermion_flutter/thermion_flutter/android/src/main/cpp/ThermionFlutterAndroid.cpp b/thermion_flutter/thermion_flutter/android/src/main/cpp/ThermionFlutterAndroid.cpp index 763859e2..91e84f4d 100644 --- a/thermion_flutter/thermion_flutter/android/src/main/cpp/ThermionFlutterAndroid.cpp +++ b/thermion_flutter/thermion_flutter/android/src/main/cpp/ThermionFlutterAndroid.cpp @@ -15,13 +15,6 @@ extern "C" { return window; } -// int ThermionAndroid_createGLTexture(jobject ) - -// int ASurfaceTexture_attachToGLContext( -// ASurfaceTexture *st, -// uint32_t texName -// ) - ResourceLoaderWrapper* make_resource_loader_wrapper_android(LoadFilamentResourceFromOwner loadFn, FreeFilamentResourceFromOwner freeFn, void* owner) { ResourceLoaderWrapper *rlw = (ResourceLoaderWrapper *)malloc(sizeof(ResourceLoaderWrapper)); rlw->loadToOut = nullptr; diff --git a/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt b/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt index c91e1951..ca0188da 100644 --- a/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt +++ b/thermion_flutter/thermion_flutter/android/src/main/kotlin/dev/thermion/android/ThermionFlutterPlugin.kt @@ -25,7 +25,6 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.view.TextureRegistry.SurfaceTextureEntry import java.io.File import java.util.* -import android.opengl.GLES20; class LoadFilamentResourceFromOwnerImpl(plugin:ThermionFlutterPlugin) : LoadFilamentResourceFromOwner { @@ -206,7 +205,6 @@ class ThermionFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, Lo val textureId = (call.arguments as Int).toLong() val textureEntry = textures[textureId] if (textureEntry != null) { - //textureEntry.surfaceTexture.updateTexImage() result.success(null) } else { result.error("TEXTURE_NOT_FOUND", "Texture with id $textureId not found", null)