Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android version improvements #12

Merged
merged 22 commits into from
Jun 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
21b20f5
Removed armeabi from possible ABIs to build.
May 24, 2018
015530b
Removed unused dependencies.
May 24, 2018
334307e
Compile against the newest stable SDK. Gradle, plugins and libraries …
May 24, 2018
d66b315
Removed action bar from the project and cleaned up styles.xml.
May 24, 2018
5d872e5
Converted the try-catch-finally to try-with-resources to reduce the a…
May 24, 2018
4dff841
Pixfight now uses an adaptive launcher icon for Android 8.0+ (or, for…
May 25, 2018
aa4a1a4
Removed background from the new game layout.
May 25, 2018
221211c
Removed overdraw also from other layouts.
May 25, 2018
679f28a
Changed timer to CLOCK_MONOTONIC for Android.
May 25, 2018
86ec36c
Replaced most Activities with Fragments as per current recommendation…
May 29, 2018
065ffb7
Corrected declarations of JNI bindings to fix extra warnings/errors o…
May 29, 2018
f97594b
Enabled Java 8 support and converted anonymous classes to lambdas/met…
May 29, 2018
a803359
Added creating a .nomedia file to the folder with game assets.
May 29, 2018
9084f0a
Compressed losslessly all MP3/PNG assets, gaining a 25% reduction in …
May 29, 2018
81d1cd1
Added ProGuard rules for release builds.
May 29, 2018
8198d2d
Implemented muting/unmuting music on app pausing/resuming.
May 29, 2018
7669063
Fixed OpenGL renderer crashing on exiting the rendering fragment or g…
May 30, 2018
9307290
Main font is now loaded from assets only once and shared later if nee…
May 30, 2018
60caec0
Lint warnings/errors fixes and a small resource cleanup.
Jun 2, 2018
df125a9
Replaced support-v4 with support-fragment.
Jun 2, 2018
45de11e
Fixed switches in the settings layout not being centered.
Jun 2, 2018
ebefd2e
Increased version number to 1.1.
Jun 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CORE/utilities/Timer/AndroidTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void AndroidTimer::update() {

timespec lTimeVal;

#ifdef __EMSCRIPTEN__
#if defined(__EMSCRIPTEN__) || defined (__ANDROID__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not entirely right MONOTONIC will work good on Emulator but not on actual device.

clock_gettime(CLOCK_MONOTONIC, &lTimeVal);
#else
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &lTimeVal);
Expand Down
Binary file removed PLATFORM/Android/FMOD/lib/armeabi/libfmod.so
Binary file not shown.
Binary file removed PLATFORM/Android/FMOD/lib/armeabi/libfmodL.so
Binary file not shown.
35 changes: 19 additions & 16 deletions PLATFORM/Android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
compileSdkVersion 27
defaultConfig {
applicationId "com.noclip.marcinmalysz.pixfight"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
targetSdkVersion 27
versionCode 2
versionName "1.1"
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -frtti -fexceptions -Wno-narrowing"
arguments '-DANDROID_STL=c++_static'
}
}
resConfigs "en"
}
buildTypes {

debug {

ndk {
abiFilters 'x86', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}
}

release {

ndk {
abiFilters 'x86', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}

minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -40,15 +41,17 @@ android {
path "CMakeLists.txt"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile files('../FMOD/lib/fmod.jar')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation files('../FMOD/lib/fmod.jar')
implementation ('com.android.support:appcompat-v7:27.1.1') {
exclude module: 'support-v4'
}
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-fragment:27.1.1'
}
28 changes: 8 additions & 20 deletions PLATFORM/Android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-keep class org.fmod.** { *; }

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** d(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
}
32 changes: 5 additions & 27 deletions PLATFORM/Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.noclip.marcinmalysz.pixfight">

<uses-feature
Expand All @@ -9,45 +10,22 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".PFMainMenuActivity"
android:name=".PFActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PFNewGameActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_pfnew_game"
android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme" />
<activity
android:name=".PFSettingsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_pfsettings"
android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme" />
<activity
android:name=".PFRenderActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_pfrender"
android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme" />
<activity
android:name=".PFLoadGameActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_pfload_game"
android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme" />
</application>

</manifest>
Binary file modified PLATFORM/Android/app/src/main/assets/artilleryturret1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/artilleryturret2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/artilleryturret3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/artilleryturret4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazooka1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazooka2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazooka3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazooka4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazookaatt1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazookaatt2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazookaatt3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/bazookaatt4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/digits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/empty1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/empty2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/explode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantry1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantry2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantry3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantry4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantryatt1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantryatt2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantryatt3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/infantryatt4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PLATFORM/Android/app/src/main/assets/jeep1.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeep2.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeep3.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeep4.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeepturret1.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeepturret2.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeepturret3.png
Binary file modified PLATFORM/Android/app/src/main/assets/jeepturret4.png
Binary file modified PLATFORM/Android/app/src/main/assets/map.mp3
Binary file not shown.
Binary file modified PLATFORM/Android/app/src/main/assets/menu.mp3
Binary file not shown.
Binary file modified PLATFORM/Android/app/src/main/assets/redgreen.png
Binary file modified PLATFORM/Android/app/src/main/assets/tank1.png
Binary file modified PLATFORM/Android/app/src/main/assets/tank2.png
Binary file modified PLATFORM/Android/app/src/main/assets/tank3.png
Binary file modified PLATFORM/Android/app/src/main/assets/tank4.png
Binary file modified PLATFORM/Android/app/src/main/assets/tiles.png
Binary file modified PLATFORM/Android/app/src/main/assets/tracking.png
Binary file modified PLATFORM/Android/app/src/main/assets/trees.png
Binary file modified PLATFORM/Android/app/src/main/assets/turret1.png
Binary file modified PLATFORM/Android/app/src/main/assets/turret2.png
Binary file modified PLATFORM/Android/app/src/main/assets/turret3.png
Binary file modified PLATFORM/Android/app/src/main/assets/turret4.png
42 changes: 21 additions & 21 deletions PLATFORM/Android/app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void callNativeVoidMethod(std::string method) {

attachThread();

jclass cls = env->FindClass("com/noclip/marcinmalysz/pixfight/PFRenderActivity");
jclass cls = env->FindClass("com/noclip/marcinmalysz/pixfight/PFRenderFragment");

if (!cls) {
return;
Expand Down Expand Up @@ -208,7 +208,7 @@ void callNativeVoidMethodParams(std::string method, int param1, int param2) {

attachThread();

jclass cls = env->FindClass("com/noclip/marcinmalysz/pixfight/PFRenderActivity");
jclass cls = env->FindClass("com/noclip/marcinmalysz/pixfight/PFRenderFragment");

if (!cls) {
return;
Expand All @@ -232,7 +232,7 @@ void callNativeVoidMethodParams(std::string method, int param1, int param2) {
env->DeleteGlobalRef(globalClass);
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_initializeOpenGL(JNIEnv* jenv, jobject obj, int width, int height) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_initializeOpenGL(JNIEnv* jenv, jobject obj, jint width, jint height) {

__android_log_print(ANDROID_LOG_DEBUG, "[PIXFIGHT]", "initializeOpenGL %d %d", width, height);

Expand Down Expand Up @@ -291,7 +291,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_renderFra
gameLogic->Render();
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeStartGame(JNIEnv* jenv, jobject obj, jstring map, int playerSelected, int playersPlaying) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeStartGame(JNIEnv* jenv, jobject obj, jstring map, jint playerSelected, jint playersPlaying) {

__android_log_print(ANDROID_LOG_DEBUG, "[PIXFIGHT]", "nativeStartGame");

Expand Down Expand Up @@ -347,7 +347,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeOnS
gameLogic = nullptr;
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_undo(JNIEnv* jenv, jobject obj) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_undo(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return;
Expand All @@ -356,25 +356,25 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_un
gameLogic->undo();
}

JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_canUndo(JNIEnv* jenv, jobject obj) {
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_canUndo(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return false;
return JNI_FALSE;
}

return gameLogic->canUndo() && gameLogic->canEndTurn();
return static_cast<jboolean>(gameLogic->canUndo() && gameLogic->canEndTurn());
}

JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_canEndTurn(JNIEnv* jenv, jobject obj) {
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_canEndTurn(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return false;
return JNI_FALSE;
}

return gameLogic->canEndTurn();
return static_cast<jboolean>(gameLogic->canEndTurn());
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_endTurn(JNIEnv* jenv, jobject obj) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_endTurn(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return;
Expand All @@ -383,7 +383,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_en
gameLogic->endTurn();
}

JNIEXPORT int JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_multiplyTime(JNIEnv* jenv, jobject obj) {
JNIEXPORT jint JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_multiplyTime(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return 1;
Expand All @@ -392,7 +392,7 @@ JNIEXPORT int JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_mul
return (int)gameLogic->multiplyTime();
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_finishBuilding(JNIEnv* jenv, jobject obj, int unitid, int cash) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_finishBuilding(JNIEnv* jenv, jobject obj, jint unitid, jint cash) {

//we are coming from java UI thread!
syncToMainLoop([unitid, cash](void *context, GameLogic *logic){
Expand All @@ -401,7 +401,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_fi
});
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_tapAction(JNIEnv* jenv, jobject obj, float x, float y) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_tapAction(JNIEnv* jenv, jobject obj, jfloat x, jfloat y) {

if (gameLogic == nullptr) {
return;
Expand All @@ -415,7 +415,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_ta
});
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_scaleAction(JNIEnv* jenv, jobject obj, float scale) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_scaleAction(JNIEnv* jenv, jobject obj, jfloat scale) {

if (gameLogic == nullptr) {
return;
Expand All @@ -427,7 +427,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_sc
});
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_panAction(JNIEnv* jenv, jobject obj, float x, float y) {
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_panAction(JNIEnv* jenv, jobject obj, jfloat x, jfloat y) {

if (gameLogic == nullptr) {
return;
Expand All @@ -441,18 +441,18 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_pa
});
}

JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_saveGame(JNIEnv* jenv, jobject obj, jstring savepath) {
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_saveGame(JNIEnv* jenv, jobject obj, jstring savepath) {

if (gameLogic == nullptr) {
return false;
return JNI_FALSE;
}

std::string path = jstringTostring(jenv, savepath);

return gameLogic->saveGame(path);
return static_cast<jboolean>(gameLogic->saveGame(path));
}

JNIEXPORT jstring JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_getMapName(JNIEnv* jenv, jobject obj) {
JNIEXPORT jstring JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_getMapName(JNIEnv* jenv, jobject obj) {

if (gameLogic == nullptr) {
return jenv->NewStringUTF("");
Expand Down
26 changes: 13 additions & 13 deletions PLATFORM/Android/app/src/main/cpp/native-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeOnS
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeOnStop(JNIEnv* jenv, jobject obj);

//LOGIC
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeStartGame(JNIEnv* jenv, jobject obj, jstring map, int playerSelected, int playersPlaying);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeStartGame(JNIEnv* jenv, jobject obj, jstring map, jint playerSelected, jint playersPlaying);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeLoadGame(JNIEnv* jenv, jobject obj, jstring path);

//INTERACTION

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_undo(JNIEnv* jenv, jobject obj);
JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_canUndo(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_initializeOpenGL(JNIEnv* jenv, jobject obj, int width, int height);
JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_canEndTurn(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_endTurn(JNIEnv* jenv, jobject obj);
JNIEXPORT int JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_multiplyTime(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_finishBuilding(JNIEnv* jenv, jobject obj, int unitid, int cash);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_tapAction(JNIEnv* jenv, jobject obj, float x, float y);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_scaleAction(JNIEnv* jenv, jobject obj, float scale);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_panAction(JNIEnv* jenv, jobject obj, float x, float y);
JNIEXPORT bool JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_saveGame(JNIEnv* jenv, jobject obj, jstring savepath);
JNIEXPORT jstring JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderActivity_getMapName(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_undo(JNIEnv* jenv, jobject obj);
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_canUndo(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_initializeOpenGL(JNIEnv* jenv, jobject obj, jint width, jint height);
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_canEndTurn(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_endTurn(JNIEnv* jenv, jobject obj);
JNIEXPORT jint JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_multiplyTime(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_finishBuilding(JNIEnv* jenv, jobject obj, jint unitid, jint cash);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_tapAction(JNIEnv* jenv, jobject obj, jfloat x, jfloat y);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_scaleAction(JNIEnv* jenv, jobject obj, jfloat scale);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_panAction(JNIEnv* jenv, jobject obj, jfloat x, jfloat y);
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_saveGame(JNIEnv* jenv, jobject obj, jstring savepath);
JNIEXPORT jstring JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_getMapName(JNIEnv* jenv, jobject obj);

};

Expand Down
Loading