From fe73d7bec9d6bbfc9082e54c15aa348f750277e3 Mon Sep 17 00:00:00 2001 From: Artem Budarin Date: Wed, 1 Aug 2018 13:31:24 +0500 Subject: [PATCH] prepare android project build --- .DS_Store | Bin 0 -> 6148 bytes jni/android_api.cpp | 144 +-------- jni/android_api.h | 18 +- .../.idea/caches/build_file_checksums.ser | Bin 804 -> 784 bytes .../.idea/codeStyles/Project.xml | 56 ++-- proj.android-studio/.idea/gradle.xml | 0 proj.android-studio/.idea/misc.xml | 2 +- .../.idea/runConfigurations.xml | 0 proj.android-studio/app/CMakeLists.txt | 90 +++++- proj.android-studio/app/build.gradle | 7 +- .../app/src/main/AndroidManifest.xml | 18 +- .../fishrungames/crystalofrhylil/GLView.java | 142 +++++++++ .../crystalofrhylil/JniWrapper.java | 38 +++ .../crystalofrhylil/MainActivity.java | 288 ++++++++++++++++-- .../res/drawable-hdpi/ic_menu_template.png | Bin 0 -> 3527 bytes .../res/drawable-ldpi/ic_menu_template.png | Bin 0 -> 1460 bytes .../res/drawable-mdpi/ic_menu_template.png | Bin 0 -> 2111 bytes proj.android-studio/build.gradle | 2 +- 18 files changed, 580 insertions(+), 225 deletions(-) create mode 100644 .DS_Store mode change 100755 => 100644 proj.android-studio/.idea/caches/build_file_checksums.ser mode change 100755 => 100644 proj.android-studio/.idea/codeStyles/Project.xml mode change 100755 => 100644 proj.android-studio/.idea/gradle.xml mode change 100755 => 100644 proj.android-studio/.idea/misc.xml mode change 100755 => 100644 proj.android-studio/.idea/runConfigurations.xml create mode 100755 proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/GLView.java create mode 100755 proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/JniWrapper.java create mode 100755 proj.android-studio/app/src/main/res/drawable-hdpi/ic_menu_template.png create mode 100755 proj.android-studio/app/src/main/res/drawable-ldpi/ic_menu_template.png create mode 100755 proj.android-studio/app/src/main/res/drawable-mdpi/ic_menu_template.png diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..83be0992c0c79cb8990416e8731487fee43b3708 GIT binary patch literal 6148 zcmeHK&2AGh5FRI?-4r1riqszWg49E(5)#n^LRvyO^nip&1qVRwZg-(uZPwB5h7>|j zF1!Qq20RKUjywnt0N>aKk_||R147`5>~Cz(jN{LLYa$Z8QP?JG5Rrq#SX)E(1L1Z~ zOHwg4XMsY+kQ7r$x5=k;$=X&}1}p=A8w0#|*XaiKYe*T*@86gnQ$#rxv`wcppkyzR zM?oS3c<^y?4QcDM5@wAZT zXU``urZ3-Ms1ShzT*-NZU*Rp3UnKEqKT8vtK7j{ETcf*}Mjr$ZfZLeXQz{mTuK2K< zUqn?*|I*Y~J}g<~usd3er55DtxdpjOV@xeixrA0)PQ*)c-WtXKP0W-#d{<`QRckdIo12)zN`WJpq6Inited) - { - App->OuterDeinit(); //Clean up what is left at previous launch (if applicable) - } - - App->OuterInit(width, height, CONST_MAXRIX_WIDTH, CONST_MAXRIX_HEIGHT); - - App->Inited = true; - - } - catch (ErrorCommon e) - { - throw; - } -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj) -{ - + JniInitApp(width, height, width, height); } -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt) -{ - RenderMutex.lock(); - try - { - if (App->Inited) - { - App->OuterDraw(); - App->OuterUpdate(dt); - } - - } - catch (...) - { - throw; - } - - RenderMutex.unlock(); -} - -JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj) -{ - - if (App->Inited) - { - return 1; - } - else - { - return 0; - } - -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj) -{ - RenderMutex.lock(); - try - { - if (App->Inited) - { - App->Inited = false; - App->OuterDeinit(); - } - } - catch (ErrorCommon e) - { - throw; - } - RenderMutex.unlock(); -} - - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, float x, float y, long time) -{ - - try - { - App->OuterOnTapDown(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight())); - } - catch (ErrorCommon e) - { - throw; - } -} - - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, float x, float y, long time) -{ - try - { - App->OuterOnTapUp(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight())); - } - catch (ErrorCommon e) - { - throw; - } -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, float x, float y, long time) -{ -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time) -{ -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time) -{ - try - { - App->OuterOnMove(vec2(distanceX*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), distanceY*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight())); - } - catch (ErrorCommon e) - { - throw; - } -} - -JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode) -{ - - try - { - App->OnKeyPress(keyCode); - } - catch (ErrorCommon e) - { - throw; - } -} - diff --git a/jni/android_api.h b/jni/android_api.h index 216c086..12c9e09 100644 --- a/jni/android_api.h +++ b/jni/android_api.h @@ -12,19 +12,13 @@ #include "main_code.h" +#include "include/Engine.h" -extern "C" { - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj); - JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time); - JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode); +using namespace SE; + +extern "C" +{ +JNIEXPORT void JNICALL Java_com_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height); }; diff --git a/proj.android-studio/.idea/caches/build_file_checksums.ser b/proj.android-studio/.idea/caches/build_file_checksums.ser old mode 100755 new mode 100644 index 1eb6eff8d4c13a922e6f65e678446c945be40d55..edbf434dc584a4c01e8e88d1c70d9acc785e8fda GIT binary patch delta 432 zcmZ3&Hi2!z43>|aSM(;%@vrAEPAw_P%u6rUOD{@H$w@6OVql7PTJu@_2OCGo111KB ziUI}(1_7A~0aO3$p3Rc!S!nx0!EkK}gS&n~QGQlxa!Ij%VqQv7erAe(dSY&Bv3^Nv zv2JQ!dS+g#esE$=ZhoFCnBxdllvq%ppH!NelLEGI@+u}CVIj6#bzDb0WzsE+!d#fz zn@SjXCNE$TlgMi3KefZLCjV?$cHS|+_8lb*0y+7~i8+(cGl|xhpHKW@DRFJ)TkExM z@yC+ClrRW^jCS@-%ue;mEG{Y5E2$_cEo7);U;}wT;zQS}^Jk8GuACMA#p1?O{t^aH z3OwNKYlq#M6yNExCpn61J|~wyXq`CGwS+-UKeRZts94{zs3bL49~#Q~lMR@383lo) j^yDW@LaYKHr-S?~Xe_a-%;Ly`9ln#=UU|y9%&hy=cLl!8qI*}T1e>;KP_s}{<>@VA)|*WFjbz%x04QB0tqd{J?<#gtbCUlV1T zLPJd_uV<9i`@*uxPk+bkMTP~o+^M3{0VNDNK(~Yzrxq2*xTKb)=HwTo7R5ka95cC- zNmtvCG{>@n9Sd@SaQ(Z0xWG(Zk=c{qce2J!KT^UV2sBZ8@+BrAJt2HvI{a?y - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/proj.android-studio/.idea/gradle.xml b/proj.android-studio/.idea/gradle.xml old mode 100755 new mode 100644 diff --git a/proj.android-studio/.idea/misc.xml b/proj.android-studio/.idea/misc.xml old mode 100755 new mode 100644 index 99202cc..c0f68ed --- a/proj.android-studio/.idea/misc.xml +++ b/proj.android-studio/.idea/misc.xml @@ -25,7 +25,7 @@ - + diff --git a/proj.android-studio/.idea/runConfigurations.xml b/proj.android-studio/.idea/runConfigurations.xml old mode 100755 new mode 100644 diff --git a/proj.android-studio/app/CMakeLists.txt b/proj.android-studio/app/CMakeLists.txt index fbdd729..8f7df09 100755 --- a/proj.android-studio/app/CMakeLists.txt +++ b/proj.android-studio/app/CMakeLists.txt @@ -1,26 +1,84 @@ -# For more information about using CMake with Android Studio, read the -# documentation: https://d.android.com/studio/projects/add-native-code.html - -# Sets the minimum version of CMake required to build the native library. +# Sets the minimum version of CMake required to build the native +# library. You should either keep the default value or only pass a +# value of 3.4.0 or lower. cmake_minimum_required(VERSION 3.4.1) # Creates and names a library, sets it as either STATIC # or SHARED, and provides the relative paths to its source code. -# You can define multiple libraries, and CMake builds them for you. +# You can define multiple libraries, and CMake builds it for you. # Gradle automatically packages shared libraries with your APK. + +add_definitions(-DTARGET_ANDROID) + +set(JNI_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../jni) + +set(BOOST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../boost_1_67_0) + +set(BOOST_GIL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/boost-gil-extension) + +set(ZIP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/julienr-libzip-android/jni) + +set(LIBPNG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/libpng_1.4.1_android) + +set(LIBJPEG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/jpeg-9") + + +set(EIGEN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../eigen) + +set(SOL2_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../sol2) + +set(LUA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/lua-5.3.4/src) + + + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../tes-engine) + +include_directories(${JNI_PATH}) +include_directories(${JNI_PATH}/match3) + +include_directories(${BOOST_PATH}) +include_directories(${EIGEN_PATH}) +include_directories(${SOL2_PATH}) +include_directories(${LUA_PATH}) +include_directories(${LIBPNG_PATH}) +include_directories(${LIBJPEG_PATH}) +include_directories(${ZIP_PATH}) + +include_directories(${BOOST_GIL_PATH}) + add_library( # Sets the name of the library. - native-lib + CrystalOfRhylil # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). - src/main/cpp/native-lib.cpp ) + # Associated headers in the same location as their source + # file are automatically included. + ${JNI_PATH}/main_code.cpp + ${JNI_PATH}/match3/match3field.cpp + ${JNI_PATH}/android_api.cpp + ) + +add_library( engine + SHARED + IMPORTED ) + +set_target_properties( # Specifies the target library. + engine + + # Specifies the parameter you want to define. + PROPERTIES IMPORTED_LOCATION + + # Provides the path to the library you want to import. + ${CMAKE_CURRENT_SOURCE_DIR}/../../../tes-engine/SalmonEngineAndroid/app/build/intermediates/cmake/debug/obj/${ANDROID_ABI}/libengine.so + ) + # Searches for a specified prebuilt library and stores the path as a -# variable. Because CMake includes system libraries in the search path by +# variable. Because system libraries are included in the search path by # default, you only need to specify the name of the public NDK library # you want to add. CMake verifies that the library exists before # completing its build. @@ -32,13 +90,21 @@ find_library( # Sets the name of the path variable. # you want CMake to locate. log ) +find_library( # Sets the name of the path variable. + GLESv2-lib + + # Specifies the name of the NDK library that + # you want CMake to locate. + GLESv2 ) + + # Specifies libraries CMake should link to your target library. You -# can link multiple libraries, such as libraries you define in this +# can link multiple libraries, such as libraries you define in the # build script, prebuilt third-party libraries, or system libraries. target_link_libraries( # Specifies the target library. - native-lib - + CrystalOfRhylil + engine # Links the target library to the log library # included in the NDK. - ${log-lib} ) \ No newline at end of file + ${log-lib} ${GLESv2-lib} ) diff --git a/proj.android-studio/app/build.gradle b/proj.android-studio/app/build.gradle index 0be307d..d8ae552 100755 --- a/proj.android-studio/app/build.gradle +++ b/proj.android-studio/app/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "28.0.0" defaultConfig { applicationId "com.fishrungames.crystalofrhylil" - minSdkVersion 15 + minSdkVersion 24 targetSdkVersion 28 versionCode 1 versionName "1.0" @@ -13,11 +13,14 @@ android { externalNativeBuild { cmake { - abiFilters "armeabi-v7a", "x86" + abiFilters "armeabi-v7a" arguments "-DANDROID_STL=c++_shared" cppFlags "-std=c++17 -frtti -fexceptions -fsigned-char -Wno-c++11-narrowing" + + cFlags "-DTARGET_ANDROID", + "-DTARGET_HALIBUT" } } } diff --git a/proj.android-studio/app/src/main/AndroidManifest.xml b/proj.android-studio/app/src/main/AndroidManifest.xml index b835e36..81e6c85 100755 --- a/proj.android-studio/app/src/main/AndroidManifest.xml +++ b/proj.android-studio/app/src/main/AndroidManifest.xml @@ -1,21 +1,19 @@ - - + android:icon="@drawable/ic_menu_template" android:label="Crystal of Rhylil"> + - - + \ No newline at end of file diff --git a/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/GLView.java b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/GLView.java new file mode 100755 index 0000000..fcc8b00 --- /dev/null +++ b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/GLView.java @@ -0,0 +1,142 @@ +package com.fishrungames.crystalofrhylil; + +import java.util.Calendar; + +import android.content.Context; +import android.opengl.GLSurfaceView; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import fishrungames.salmonengineandroid.GLViewAncestor; +import fishrungames.salmonengineandroid.EngineWrapper; + +class GLView extends GLViewAncestor +{ + static long lastTimeStamp; + static boolean gameIsInited = false; + + public GLView(Context context) + { + //Change this method? Don't forget to change method below! + super(context); + init(false, 0, 0); + } + + public GLView(Context context, boolean translucent, int depth, int stencil) + { + //Change this method? Don't forget to change method above! + super(context); + init(translucent, depth, stencil); + } + + public void init(boolean translucent, int depth, int stencil) + { + super.init(translucent, depth, stencil); + setRenderer(new Renderer()); + Calendar c = Calendar.getInstance(); + lastTimeStamp = c.getTimeInMillis(); + gameIsInited = true; + } + + private static class Renderer implements GLSurfaceView.Renderer + { + public void onDrawFrame(GL10 gl) + { + if (gameIsInited) + { + Calendar c = Calendar.getInstance(); + + long currentTimeStamp = c.getTimeInMillis(); + + EngineWrapper.Update(currentTimeStamp - lastTimeStamp); + + lastTimeStamp = currentTimeStamp; + } + } + + public void onSurfaceChanged(GL10 gl, int width, int height) + { + JniWrapper.Init(width,height); + } + + public void onSurfaceCreated(GL10 gl, EGLConfig config) + { + //Do nothing. + } + } +} + +//package com.fishrungames.crystalofrhylil; +// +// +//import java.util.Calendar; +// +//import android.content.Context; +//import android.opengl.GLSurfaceView; +// +//import javax.microedition.khronos.egl.EGLConfig; +//import javax.microedition.khronos.opengles.GL10; +// +//import fishrungames.salmonengineandroid.GLViewAncestor; +// +// +//class GLView extends GLViewAncestor +//{ +// static long lastTimeStamp; +// static boolean gameIsInited = false; +// +// public GLView(Context context) +// { +// //Change this method? Don't forget to change method below! +// super(context); +// init(false, 0, 0); +// } +// +// public GLView(Context context, boolean translucent, int depth, int stencil) +// { +// //Change this method? Don't forget to change method above! +// super(context); +// init(translucent, depth, stencil); +// } +// +// public void init(boolean translucent, int depth, int stencil) +// { +// super.init(translucent, depth, stencil); +// setRenderer(new Renderer()); +// Calendar c = Calendar.getInstance(); +// lastTimeStamp = c.getTimeInMillis(); +// gameIsInited = true; +// } +// +// private static class Renderer implements GLSurfaceView.Renderer +// { +// public void onDrawFrame(GL10 gl) +// { +// if (gameIsInited) +// { +// Calendar c = Calendar.getInstance(); +// +// long currentTimeStamp = c.getTimeInMillis(); +// +// JniWrapper.Update(currentTimeStamp - lastTimeStamp); +// +// lastTimeStamp = currentTimeStamp; +// } +// } +// +// public void onSurfaceChanged(GL10 gl, int width, int height) +// { +// +// +// //JniWrapper.Destroy(); +// +// JniWrapper.Init(width,height); +// } +// +// public void onSurfaceCreated(GL10 gl, EGLConfig config) +// { +// //Do nothing. +// } +// } +//} \ No newline at end of file diff --git a/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/JniWrapper.java b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/JniWrapper.java new file mode 100755 index 0000000..49e9479 --- /dev/null +++ b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/JniWrapper.java @@ -0,0 +1,38 @@ +package com.fishrungames.crystalofrhylil; + +public class JniWrapper +{ + static { + System.loadLibrary("CrystalOfRhylil"); + } + + public static native void Init(int width, int height); + +} + +//package com.fishrungames.crystalofrhylil; +// +//public class JniWrapper +//{ +// static { +// //System.loadLibrary("gnustl_shared"); +// //System.loadLibrary("HalibutEngine"); +// System.loadLibrary("CrystalOfRhylilLib"); +// } +// +// +// public static native void Init(int width, int height); +// public static native void Update(long dt); +// public static native void StopSounds(); +// public static native void Destroy(); +// public static native int IsInited(); +// public static native void OnTapDown(float x, float y, long time); +// public static native void OnTapUp(float x, float y, long time); +// public static native void OnTapMove(float x, float y, long time); +// +// public static native void OnFling(float velocityX, float velocityY, long time); +// public static native void OnScroll(float distanceX, float distanceY, long time); +// +// public static native void OnKeyPress(int keyCode); +//} + diff --git a/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/MainActivity.java b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/MainActivity.java index c3ccdae..c186e5b 100755 --- a/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/MainActivity.java +++ b/proj.android-studio/app/src/main/java/com/fishrungames/crystalofrhylil/MainActivity.java @@ -1,26 +1,280 @@ package com.fishrungames.crystalofrhylil; +import fishrungames.salmonengineandroid.EngineWrapper; +//Deprecated +//import fishrungames.doublehitballs.R; + import android.app.Activity; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; -import android.widget.TextView; +import android.view.GestureDetector; +import android.view.KeyEvent; +import android.view.GestureDetector.SimpleOnGestureListener; +import android.view.MotionEvent; -public class MainActivity extends Activity { - - // Used to load the 'native-lib' library on application startup. - static { - System.loadLibrary("native-lib"); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); +//Deprecated +//import java.lang.reflect.Field; - } +public class MainActivity extends Activity +{ - /** - * A native method that is implemented by the 'native-lib' native library, - * which is packaged with this application. - */ - public native String stringFromJNI(); + GLView mView; + + @Override + protected void onCreate(Bundle icicle) + { + + super.onCreate(icicle); + + EngineWrapper.LoadSalmonEngineLibrary(); + EngineWrapper.SetActivityInstance(this); + EngineWrapper.SetupEnviroment(); + + String apkFilePath = null; + ApplicationInfo appInfo = null; + PackageManager packMgmr = this.getPackageManager(); + try { + appInfo = packMgmr.getApplicationInfo("com.fishrungames.crystalofrhylil", 0); + } catch (NameNotFoundException e) { + + e.printStackTrace(); + + throw new RuntimeException("Unable to locate assets, aborting..."); + } + apkFilePath = appInfo.sourceDir; + + EngineWrapper.SetupApkFilePath(apkFilePath); + + mView = new GLView(getApplication()); + + setContentView(mView); + + EngineWrapper.SetView(mView); + + } + + @Override + protected void onPause() + { + EngineWrapper.CallDestroy(); + super.onPause(); + mView.onPause(); + } + + @Override + protected void onResume() + { + super.onResume(); + mView.onResume(); + } + + @Override + protected void onStop() + { + super.onStop(); + } + + public boolean onTouchEvent (MotionEvent event) + { + EngineWrapper.ProcessTouchEvent(event); + return true; + } + + public boolean onKeyDown(int keyCode, KeyEvent event) + { + EngineWrapper.ProcessKeyDown(keyCode, event); + return super.onKeyDown(keyCode, event); + } } + +//package com.fishrungames.crystalofrhylil; +// +// +// +////Deprecated +////import fishrungames.crystalofrhylil.R; +// +//import android.app.Activity; +//import android.content.pm.ApplicationInfo; +//import android.content.pm.PackageManager; +//import android.content.pm.PackageManager.NameNotFoundException; +//import android.os.Bundle; +// +//import android.view.GestureDetector; +//import android.view.GestureDetector.SimpleOnGestureListener; +//import android.view.KeyEvent; +//import android.view.MotionEvent; +// +//import fishrungames.salmonengineandroid.EngineWrapper; +// +// +////Deprecated +////import java.lang.reflect.Field; +// +// +//public class MainActivity extends Activity +//{ +// +// GLView mView; +// +// boolean IsScrolling = false; +// +// private GestureDetector gestureDetector; +// +// @Override +// protected void onCreate(Bundle icicle) +// { +// super.onCreate(icicle); +// +// gestureDetector = new GestureDetector(new MyGestureListener()); +// +// EngineWrapper.LoadSalmonEngineLibrary(); +// EngineWrapper.SetActivityInstance(this); +// EngineWrapper.SetupEnviroment(); +///* +// * Deprecated +// * +// try +// { +// for (Field f : R.raw.class.getFields()) +// { +// FileWrapper.AddToFileMap(f.getName(), f.getInt(null)); +// } +// +// +// } catch (IllegalArgumentException e) +// { +// FileWrapper.ConsoleOut("IllegalArgumentException\n"); +// onStop(); +// } catch (IllegalAccessException e) +// { +// FileWrapper.ConsoleOut("IllegalAccessException\n"); +// onStop(); +// } +//*/ +// mView = new GLView(getApplication()); +// +// setContentView(mView); +// +// String apkFilePath = null; +// ApplicationInfo appInfo = null; +// PackageManager packMgmr = this.getPackageManager(); +// try { +// appInfo = packMgmr.getApplicationInfo("com.fishrungames.crystalofrhylil", 0); +// } catch (NameNotFoundException e) { +// +// e.printStackTrace(); +// throw new RuntimeException("Unable to locate assets, aborting..."); +// } +// apkFilePath = appInfo.sourceDir; +// +// EngineWrapper.SetupApkFilePath(apkFilePath); +// //FileWrapper.ConsoleOut("Out of java\n"); +// +// } +// +// @Override +// protected void onPause() +// { +// JniWrapper.Destroy(); +// super.onPause(); +// mView.onPause(); +// } +// +// @Override +// protected void onResume() +// { +// //Don't write anything here! +// super.onResume(); +// mView.onResume(); +// } +// +// @Override +// protected void onStop() +// { +// //Don't write anything here! +// super.onStop(); +// } +// +// +// public boolean onKeyDown(int keyCode, KeyEvent event) +// { +// int ascii_keycode = keyCode; +// +// if (keyCode == KeyEvent.KEYCODE_DEL) +// { +// ascii_keycode = 8; //Hack - getUnicodeChar does not recognize backspace +// } +// else +// { +// ascii_keycode = event.getUnicodeChar(); +// } +// +// JniWrapper.OnKeyPress(ascii_keycode); +// return super.onKeyDown(keyCode, event); +// } +// +// public boolean onKeyUp(int keyCode, KeyEvent event) +// { +// return true; +// } +// +// public boolean onTouchEvent(MotionEvent event) +// { +// if (gestureDetector.onTouchEvent(event)) +// { +// return true; +// } +// +// if (event.getAction() == MotionEvent.ACTION_UP) +// { +// float x = event.getX(); +// float y = (float) mView.getHeight() - event.getY(); +// +// if (IsScrolling) +// { +// IsScrolling = false; +// } +// +// JniWrapper.OnTapUp(x, y, event.getEventTime()); +// +// } +// return true; +// } +// +// class MyGestureListener extends SimpleOnGestureListener +// { +// +// @Override +// public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, +// float velocityY) +// { +// JniWrapper.OnFling(velocityX, velocityY, e2.getEventTime()); +// return true; +// } +// +// public boolean onScroll(MotionEvent e1, MotionEvent e2, +// float distanceX, float distanceY) +// { +// JniWrapper.OnScroll(distanceX, distanceY, e2.getEventTime()); +// IsScrolling = true; +// return true; +// } +// +// public boolean onDown(MotionEvent event) +// { +// +// float x = event.getX(); +// float y = (float) mView.getHeight() - event.getY(); +// +// JniWrapper.OnTapDown(x, y, event.getEventTime()); +// +// return true; +// } +// +// } +// +//} \ No newline at end of file diff --git a/proj.android-studio/app/src/main/res/drawable-hdpi/ic_menu_template.png b/proj.android-studio/app/src/main/res/drawable-hdpi/ic_menu_template.png new file mode 100755 index 0000000000000000000000000000000000000000..1e28f93d8bf36cfbf1dff6efe4b4e1d0983dd616 GIT binary patch literal 3527 zcmV;&4LI_NP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv000d(NklieUA6VXP(jj(-Y7W&=b%T&=b%T z&=b%T&=b%T&=b%T&=dF;0*8AKKOfi{_!plBpQ!zf`>*;o`8MFS!n?uyjOSfX2ah`* zKmA_9i;>5y2q?WWx)Zv}s#0r)LtNoh&=5VdWt=`Suwa)d$?+qxx zSPd}da7wR#t3O3{MbhcP)097vPuHfdQH834N+wI_{OEa#=!_shnsLA7o^E^1_D$=n z)&@EaDs?1v<-z8I=2-MtP+Jhi_Qq27cs5n3s;F+dZjoxIYpHm$n2z=xCBU3?y6Kc^ zbIs;8v&&|>38_F?U=ZCM{U`5x-h(0SA(S9bpq%j>;hJ()Ih9X6CX8KIU8l>+%M>S% zBhNdYgZ35neilU*FX*I;&W)aX5peQ+8+|G9ej-U{q*SY_C4i&C$-+e{nk*ug7*`h3 z#j%SN)*hzbTeJ6uWr^iSIteJIC+3f?^{x~CE&g<7;0(#8WmG;{P8s7FlsTTcNLdfE zh@~0N7|Wo<{zUS+>!q+Qx819gf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*;o1}rU$rXV#!QH|GGj7SqPtOQ`4``0myNH2m@G0%>QKT)(fuz z^lE7NyJjg+fMdXrjE%qKkozG3{Rn_w1)$deXd~eKgatqw0qAuA;xKvzfYxLFS^!!J zILq_T%sOXx{etua^aS(-^aS(-^aS(-^aP$t;QxTmKE9O#>rDUv002ovPDHLkV1hz% BkiY-{ literal 0 HcmV?d00001 diff --git a/proj.android-studio/app/src/main/res/drawable-ldpi/ic_menu_template.png b/proj.android-studio/app/src/main/res/drawable-ldpi/ic_menu_template.png new file mode 100755 index 0000000000000000000000000000000000000000..6a93cf262ac93c29c5e5e9a6351cb91254a24143 GIT binary patch literal 1460 zcmV;l1xxygP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv000FeNkl#9E$f(gS{x;_%S=j#(jm9YwVBq;;Kbp?_x<`R#jau+3OXs7mfS6Im29@IwL-VI z8}#dX-woG|)%5Z7yhu~z2YwTULJp%l)paX%TL!NI44Ve%+Uz1}f8Gx2d9^pDKZeIP zu;28HD8abkwAdzI?C^Aec1;Vlo?56~tA)C?I&xmIQUPg}G+lIG^t*l$lrWU=y>wdY zy}5D|id;pYS<>uMvRDFYry7J-p^-nt_fOg42IJ0RPTV<;98k@xpwL+eg)Rg~)q)DL z?b(n#n%u)13#cZKhd zGDStiKaO9u19{!vZN0qfpG!q*B|#%*@H7SFc*W5(>w^$;cQ#gY%OD!Dvuw>d4!P ziI2%QKVN^I7SbFN#LzQ-VBTW})7$9Z;q!--2q89+NNj<~$0E^WFj6KKTg@`rv@<7X z#)YE=*R<*B7JhQ_(3kP?{Rb&K_@6e)&Ylj;%$)cf-B4s@StoOIXT22_Pq!NyR((31 z2b!AP+xYxap_o|`2*zp?68gW5it0Y_T11tWKBY+{Q=bWi6ThG<9<_SjheE(;+<<|B z7ce;Zf*ehz4XCeQ1*Ouyk&-f`<#LUunM@t^!Br^i@1Z+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Tskf z`}}YDxqW-JkDp)7CV&4g{)LEq0U-{g)e=&}jntwQfHc8zH=?zOs9E8-=A)15e~-26 zv6kPX^p}PB`c?^ieRUf_=7WHMxw&zJ2?CyqViXy$X@~i>i@(9Zri5+>9%dUjS&6+ p{VDl%1bOFp9q>Bfb>NvD_&0Z)CI#|c81Mi9002ovPDHLkV1j%I4U+%> literal 0 HcmV?d00001 diff --git a/proj.android-studio/build.gradle b/proj.android-studio/build.gradle index 7eb4161..11da6b0 100755 --- a/proj.android-studio/build.gradle +++ b/proj.android-studio/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong