Merge branch 'sdl_android' of github.com:pelya/commandergenius into sdl_android
This commit is contained in:
1320
build/envsetup.sh
Normal file
1320
build/envsetup.sh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2664,7 +2664,7 @@ class Settings
|
||||
nativeSetEnv( "DATADIR", Globals.DataDir );
|
||||
nativeSetEnv( "UNSECURE_STORAGE_DIR", Globals.DataDir );
|
||||
nativeSetEnv( "HOME", Globals.DataDir );
|
||||
nativeSetEnv( "ANDROID_VERSION", android.os.Build.VERSION.SDK_INT );
|
||||
nativeSetEnv( "ANDROID_VERSION", String.valueOf(android.os.Build.VERSION.SDK_INT) );
|
||||
try {
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
p.getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
|
||||
@@ -5,7 +5,7 @@ AppName="Commander Genius"
|
||||
AppFullName=net.sourceforge.clonekeenplus
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
AppDataDownloadUrl="!Keen1|keen1.zip^!Keen4|keen4.zip^!Keen7|keen7.zip^High-quality GFX and music - 50 Mb|http://sourceforge.net/projects/clonekeenplus/files/High%20Quality%20Packs/Version%201.x/hqpv19.zip/download"
|
||||
AppDataDownloadUrl="!Keen1|keen1.zip^!Keen4|keen4.zip^!Keen7|keen7.zip^High-quality GFX and music - 50 Mb|http://sourceforge.net/projects/clonekeenplus/files/High%20Quality%20Packs/Version%202.x/hqpv20.zip/download"
|
||||
VideoDepthBpp=24
|
||||
NeedDepthBuffer=n
|
||||
NeedStencilBuffer=n
|
||||
@@ -31,21 +31,23 @@ AppUsesJoystick=n
|
||||
AppUsesAccelerometer=y
|
||||
AppUsesGyroscope=n
|
||||
AppUsesMultitouch=n
|
||||
AppRecordsAudio=n
|
||||
NonBlockingSwapBuffers=n
|
||||
RedefinedKeys="LCTRL LALT NO_REMAP NO_REMAP RETURN ESCAPE"
|
||||
AppTouchscreenKeyboardKeysAmount=4
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=1
|
||||
RedefinedKeysScreenKb="LCTRL LALT SPACE RETURN"
|
||||
RedefinedKeysScreenKbNames="LCTRL LALT SPACE RETURN"
|
||||
StartupMenuButtonTimeout=3000
|
||||
HiddenMenuOptions=''
|
||||
FirstStartMenuOptions=''
|
||||
MultiABI=n
|
||||
AppMinimumRAM=64
|
||||
AppVersionCode=120000
|
||||
AppVersionName="1.2 Beta"
|
||||
AppVersionCode=140000
|
||||
AppVersionName="1.4 Beta"
|
||||
ResetSdlConfigForThisVersion=n
|
||||
DeleteFilesOnUpgrade="%"
|
||||
CompiledLibraries="tremor ogg"
|
||||
CompiledLibraries="tremor ogg sdl_image"
|
||||
CustomBuildScript=n
|
||||
AppCflags='-frtti -fexceptions -finline-functions -O2 -DTREMOR=1 -DANDROID=1 -DBUILD_TYPE=LINUX -DTARGET_LNX=1 -Werror=strict-aliasing -Werror=cast-align -Werror=pointer-arith -Werror=address -std=c++11'
|
||||
AppLdflags='-ltremor'
|
||||
|
||||
Submodule project/jni/application/commandergenius/commandergenius updated: d1b8a7ae03...108739d284
@@ -37,7 +37,7 @@ RedefinedKeys="SPACE SPACE NO_REMAP NO_REMAP RETURN ESCAPE LCTRL"
|
||||
AppTouchscreenKeyboardKeysAmount=5
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="SLASH BACKSPACE TAB END LCTRL SPACE UNKNOWN UNKNOWN UNKNOWN UNKNOWN"
|
||||
RedefinedKeysScreenKbNames="Change_weapon Sniper_view Show_scores Jump/centerview Fire Jump"
|
||||
RedefinedKeysScreenKbNames="Change_weapon Sniper_view Show_scores Center_view Fire Jump"
|
||||
StartupMenuButtonTimeout=3000
|
||||
HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig'
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
16
readme.txt
16
readme.txt
@@ -30,7 +30,7 @@ How to compile demo application
|
||||
Launch commands
|
||||
rm project/jni/application/src
|
||||
ln -s ballfield project/jni/application/src
|
||||
./ChangeAppSettings.sh -a
|
||||
./changeAppSettings.sh -a
|
||||
android update project -p project -t android-15
|
||||
Then edit file build.sh if needed to add NDK dir to your PATH, then launch it.
|
||||
It will compile a bunch of libs under project/libs/armeabi,
|
||||
@@ -59,6 +59,10 @@ to compile it remove project/jni/application/src symlink and make new one pointi
|
||||
Note that GL ES is NOT pure OpenGL - there are no glBegin() and glEnd() call and other widely used functions,
|
||||
and generally it will take a lot of effort to port OpenGL application to GL ES.
|
||||
|
||||
How to compile a specific SDL based application
|
||||
===============================================
|
||||
. build/envsetup.sh
|
||||
build
|
||||
|
||||
How to compile your own application
|
||||
===================================
|
||||
@@ -235,7 +239,7 @@ and that may be not desired for older phones with very little storage.
|
||||
The script app2sd.sh will re-package your .apk file in such a way that
|
||||
the shared libraries will not be extracted by Android OS but by application itself,
|
||||
and it will remove them from internal storage right after starting up,
|
||||
so you still need that space free, but only temporarily.
|
||||
so you still need that space free, but only temporarily.
|
||||
However your application will start up slower.
|
||||
|
||||
SDL supports AdMob advertisements, you need to set your publisher ID inside AndroidAppSettings.cfg,
|
||||
@@ -261,7 +265,7 @@ Android application sleep/resume support
|
||||
Application may be put to background at any time, for example if user gets phone call onto the device.
|
||||
The application will lose OpenGL context then, and has to re-create it when put to foreground.
|
||||
|
||||
The SDL provides function
|
||||
The SDL provides function
|
||||
SDL_ANDROID_SetApplicationPutToBackgroundCallback( callback_t appPutToBackground, callback_t appRestored );
|
||||
where callback_t is function pointer of type "void (*) void".
|
||||
The default callbacks will call another Android-specific functions:
|
||||
@@ -276,14 +280,14 @@ If you're using pure SDL 1.2 API (with or without HW acceleration) you don't nee
|
||||
the SDL itself will re-create GL textures and fill them with pixel data from existing SDL HW surfaces,
|
||||
so you may leave the callbacks to defaults.
|
||||
|
||||
If you're using SDL 1.3 API and using SDL_Texture, then the textures pixeldata is lost - you will need
|
||||
If you're using SDL 1.3 API and using SDL_Texture, then the textures pixeldata is lost - you will need
|
||||
to call SDL_UpdateTexture() to refill texture pixeldata from appRestored() callback for all your textures.
|
||||
If you're using compatibility API with SDL_Surfaces you don't have to worry about that.
|
||||
|
||||
If you're using SDL with OpenGL with either SDL 1.2 or SDL 1.3, the situation is even more grim -
|
||||
not only all your GL textures are lost, but all GL matrices, blend modes, etc. has to be re-created.
|
||||
|
||||
OS may decide there's too little free RAM left on device, and kill background applications
|
||||
OS may decide there's too little free RAM left on device, and kill background applications
|
||||
without notice, so it vill be good to create temporary savegame etc. from appPutToBackground() callback.
|
||||
|
||||
Also it's a good practice to pause any application audio, especially if the user gets phone call,
|
||||
@@ -390,7 +394,7 @@ If the error string is like this:
|
||||
|
||||
I/dalvikvm(18105): Unable to dlopen(/data/data/net.olofson.kobodl/lib/libapplication.so): Cannot load library: link_image[1995]: failed to link libapplication.so
|
||||
|
||||
that means your application contains undefined symbols, absent in the system libraries,
|
||||
that means your application contains undefined symbols, absent in the system libraries,
|
||||
you may check for all missing symbols by running script checkMissing.sh .
|
||||
That typically happens because of linking to the dynamic libstdc++ which is not included into the .apk file -
|
||||
specify "-lgnustl_static" in the linker flags to fix that.
|
||||
|
||||
Reference in New Issue
Block a user