move helper init before native library init

This commit is contained in:
qimiko committed 2023-06-02 19:41:31 -07:00
1 parent 8142ba3876
commit 5237817b39
2 files changed
+3 -4

No files matched your search

@@ -72,6 +72,8 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
e.printStackTrace() e.printStackTrace()
} }
Cocos2dxHelper.init(this, this)
System.load("$gdNativeLibraryPath/lib${Constants.FMOD_LIB_NAME}.so") System.load("$gdNativeLibraryPath/lib${Constants.FMOD_LIB_NAME}.so")
System.load("$gdNativeLibraryPath/lib${Constants.COCOS_LIB_NAME}.so") System.load("$gdNativeLibraryPath/lib${Constants.COCOS_LIB_NAME}.so")
@@ -85,8 +87,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
setContentView(createView()) setContentView(createView())
Cocos2dxHelper.init(this, this) // call native functions after native libraries init
JniToCpp.setupHSSAssets( JniToCpp.setupHSSAssets(
gdPackageInfo.applicationInfo.sourceDir, gdPackageInfo.applicationInfo.sourceDir,
Environment.getExternalStorageDirectory().absolutePath Environment.getExternalStorageDirectory().absolutePath
@@ -46,8 +46,6 @@ object Cocos2dxHelper {
this.cocos2dxHelperListener = cocos2dxHelperListener this.cocos2dxHelperListener = cocos2dxHelperListener
packageName = applicationInfo.packageName packageName = applicationInfo.packageName
fileDirectory = context.filesDir.absolutePath fileDirectory = context.filesDir.absolutePath
nativeSetApkPath(applicationInfo.sourceDir)
// Cocos2dxHelper.sCocos2dxAccelerometer = Cocos2dxAccelerometer(pContext) // Cocos2dxHelper.sCocos2dxAccelerometer = Cocos2dxAccelerometer(pContext)
// Cocos2dxHelper.sCocos2dMusic = Cocos2dxMusic(pContext) // Cocos2dxHelper.sCocos2dMusic = Cocos2dxMusic(pContext)
// var simultaneousStreams: Int = Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_DEFAULT // var simultaneousStreams: Int = Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_DEFAULT