From: Jaka K. <lyn...@us...> - 2013-03-31 14:39:42
|
gemrb: Infinity Engine emulator The branch master has been updated via ef96df164b568cf82511d1cdeb3d85223d62f748 (commit) via 25a7700a1c80b9018b19dd70ed5259a0078ba783 (commit) via f67699e16b0d2b628c9b690846f93927fbf7a196 (commit) via 04ef4ac251523038d2b45b69e4c4c0fe1220f8ce (commit) via c7cb86a23d5a37efe0244057b835768868f1c270 (commit) via 77e1a3dcd2e0a5eb9e81b69cd310067bc93355a5 (commit) via 1b1c8e47c8352054d2f5cdbf38689669b39973b8 (commit) via 8cf6e570e12deb8be03a041e3f9220b6066689de (commit) via 6cda6b993c3280c5595f0794d1ba69113426aab2 (commit) via 6c7bf6c28b0c96bcfde70709535dd75bddf5c170 (commit) via 5e8a709c842dfef253cd5feaf7e3f9d16d34e194 (commit) Summary of changes: android/FREETYPEBUILD_Android.mk | 40 ++++ android/GEMRB_Android.mk | 252 +++++++++++++++++++++++++ android/GEMRB_Application.mk | 5 + android/GemRB.java | 132 +++++++++++++ android/OGG_Android.mk | 11 + android/OPENAL_Android.mk | 9 + android/PNG_Android.mk | 9 + android/README | 101 ++++++++++ android/RECURSE_Android.mk | 1 + android/TODO | 6 + android/VORBIS_Android.mk | 9 + android/packaged.GemRB.cfg | 324 +++++++++++++++++++++++++++++++++ android/prep_env.sh | 196 ++++++++++++++++++++ artwork/gemrb-logo-36px.png | Bin 0 -> 1043 bytes artwork/gemrb-logo-48px.png | Bin 0 -> 1325 bytes artwork/gemrb-logo-72px.png | Bin 0 -> 2110 bytes gemrb/GemRB.cpp | 5 +- gemrb/plugins/SDLVideo/SDL20Video.cpp | 2 - 18 files changed, 1099 insertions(+), 3 deletions(-) create mode 100644 android/FREETYPEBUILD_Android.mk create mode 100644 android/GEMRB_Android.mk create mode 100644 android/GEMRB_Application.mk create mode 100644 android/GemRB.java create mode 100644 android/OGG_Android.mk create mode 100644 android/OPENAL_Android.mk create mode 100644 android/PNG_Android.mk create mode 100644 android/README create mode 100644 android/RECURSE_Android.mk create mode 100644 android/TODO create mode 100644 android/VORBIS_Android.mk create mode 100644 android/packaged.GemRB.cfg create mode 100644 android/prep_env.sh create mode 100644 artwork/gemrb-logo-36px.png create mode 100644 artwork/gemrb-logo-48px.png create mode 100644 artwork/gemrb-logo-72px.png from 668eb1ec8710c708d25cef3364f5f85e90197f9d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=ef96df164b568cf82511d1cdeb3d85223d62f748 commit ef96df164b568cf82511d1cdeb3d85223d62f748 Author: Pepe Schwarz <pe...@gm...> Date: Sat Mar 30 22:34:14 2013 +0100 removed extraneous space at the end of a line in multiple files diff --git a/android/GEMRB_Application.mk b/android/GEMRB_Application.mk index d6674e8..6110cb2 100644 --- a/android/GEMRB_Application.mk +++ b/android/GEMRB_Application.mk @@ -2,4 +2,4 @@ # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information # APP_PROJECT_PATH := $(call my-dir)/.. APP_STL := gnustl_static -APP_MODULES := SDL2 ogg vorbis openal python freetype2-static png main +APP_MODULES := SDL2 ogg vorbis openal python freetype2-static png main diff --git a/android/GemRB.java b/android/GemRB.java index 8025e22..212e947 100644 --- a/android/GemRB.java +++ b/android/GemRB.java @@ -73,7 +73,7 @@ public class GemRB extends SDLActivity { } catch (IOException e) { throw new RuntimeException(e); } - } + } super.onCreate(savedInstanceState); } diff --git a/android/README b/android/README index 5c13c93..275a309 100644 --- a/android/README +++ b/android/README @@ -1,4 +1,4 @@ -BUILDING GEMRB FOR ANDROID +BUILDING GEMRB FOR ANDROID -------------------------- Tools you will need to build GemRB for Android: @@ -6,12 +6,12 @@ Tools you will need to build GemRB for Android: - android-sdk API-level 10 or greater - android-ndk (newer is generally better, tested against r8d) - ant -- java +- java - mercurial for building SDL2 - git for building various other dependencies -------------------------------------- -Building the apk on a Unix-like System +Building the apk on a Unix-like System -------------------------------------- Running the following commands from the directory this README resides in will @@ -32,11 +32,11 @@ with: and subsequently compile the remaining libraries and GemRB itsself with: - ndk-build + ndk-build -for a stripped build or +for a stripped build or - ndk-build NDK_DEBUG=1 + ndk-build NDK_DEBUG=1 if you want a debuggable build. @@ -56,7 +56,7 @@ If everything ran without any errors you should find a file named "SDLActivity-debug.apk" in build/gemrb/bin below the folder this README resides in. If you ran ant with the "install" argument, you can directly run GemRB from your devices' main menu. If you didn't, you can copy the apk file to your device -with +with adb push bin/SDLActivity-debug.apk /sdcard/ diff --git a/android/TODO b/android/TODO index abe5ded..3424918 100644 --- a/android/TODO +++ b/android/TODO @@ -1,7 +1,6 @@ 2013-03-10 -- prep_env.sh should have more error checks -- should probably add a dialog on first run to prompt for GamePath (although there might be a "proper" pre-game config screen a la scummvm?) +- prep_env.sh should have more error checks +- add a dialog on first run to prompt for GamePath - version checks for override, unhardcoded and GUIScripts - mouse cursor seems to get positioned at the corners of the screen touches for some reason, most likely not directly related to the android build though - touches have to be rather quick to register as click events, might be related to SDL20Driver::ProcessFirstTouch() -- add GemRB icon diff --git a/android/VORBIS_Android.mk b/android/VORBIS_Android.mk index 7983098..34674b7 100644 --- a/android/VORBIS_Android.mk +++ b/android/VORBIS_Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := vorbis +LOCAL_MODULE := vorbis LOCAL_SRC_FILES := libvorbis.so LOCAL_C_EXPORT_INCLOUDES := include/ diff --git a/android/packaged.GemRB.cfg b/android/packaged.GemRB.cfg index 7593e70..b339cec 100644 --- a/android/packaged.GemRB.cfg +++ b/android/packaged.GemRB.cfg @@ -236,7 +236,7 @@ CachePath=/sdcard/gemrb/bg1/cache #PluginsPath=@PLUGIN_DIR@ ##################################################### -# Custom Font Path [String] # +# Custom Font Path [String] # # # # This is the path where GemRB looks for non-BAM # # fonts (ex TTF) # @@ -290,14 +290,14 @@ UseSoftKeyboard=1 TouchScrollAreas=0 ##################################################### -# MouseFeedback # +# MouseFeedback # # Bitfield with reserved bits for disabling # # the mouse. Those bits cannot be set via config # # # -# Show mouse+tooltips = 0 # -# Hide mouse = 1 # -# Hide tooltips = 2 # -# Hide mouse+tooltips = 3 # +# Show mouse+tooltips = 0 # +# Hide mouse = 1 # +# Hide tooltips = 2 # +# Hide mouse+tooltips = 3 # ##################################################### # For a strictly touchscreen device we recommend @@ -308,7 +308,7 @@ MouseFeedback=0 ##################################################### # Touch Gesture Input Parameters # -# Requires SDL 1.3 or later # +# Requires SDL 1.3 or later # # All "NumFing" settings must be > 1 and < 5 # # NumFingScroll and NumFingKboard cannot be equal # ##################################################### diff --git a/android/prep_env.sh b/android/prep_env.sh index c7baa9c..ce1d86b 100644 --- a/android/prep_env.sh +++ b/android/prep_env.sh @@ -71,10 +71,10 @@ function move_libraries { echo -en "Creating directories and copying Makefiles for prebuilt libraries...\n" # freetype2 is special, it's not supposed to be precompiled according to upstream, - # additionally, upstream makefile is actually broken and we need makefiles in every - # directory up to where the current one is stored, because ndk-build doesn't see + # additionally, upstream makefile is actually broken and we need makefiles in every + # directory up to where the current one is stored, because ndk-build doesn't see # the right one otherwise - # the alternative would probably be to store the makefile at the root of the + # the alternative would probably be to store the makefile at the root of the # freetype directory, but im not sure in how far that messes with library placement cp -r $ENVROOT/freetype2-android $ENVROOT/build/gemrb/jni/ cp $ENVROOT/FREETYPEBUILD_Android.mk $ENVROOT/build/gemrb/jni/freetype2-android/Android/jni/Android.mk http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=25a7700a1c80b9018b19dd70ed5259a0078ba783 commit 25a7700a1c80b9018b19dd70ed5259a0078ba783 Author: Pepe Schwarz <pe...@gm...> Date: Sat Mar 30 22:17:24 2013 +0100 removed references to palette->unused, which doesn't exist anymore diff --git a/gemrb/plugins/SDLVideo/SDL20Video.cpp b/gemrb/plugins/SDLVideo/SDL20Video.cpp index 149cd85..75985f5 100644 --- a/gemrb/plugins/SDLVideo/SDL20Video.cpp +++ b/gemrb/plugins/SDLVideo/SDL20Video.cpp @@ -184,7 +184,6 @@ void SDL20VideoDriver::showFrame(unsigned char* buf, unsigned int bufw, color.r = ((*src & 0x7C00) >> 7) | ((*src & 0x7C00) >> 12); color.g = ((*src & 0x03E0) >> 2) | ((*src & 0x03E0) >> 8); color.b = ((*src & 0x001F) << 3) | ((*src & 0x001F) >> 2); - color.unused = 0; // video player texture is of ARGB format. buf is RGB555 *dst++ = (0xFF000000|(color.r << 16)|(color.g << 8)|(color.b)); src++; @@ -198,7 +197,6 @@ void SDL20VideoDriver::showFrame(unsigned char* buf, unsigned int bufw, palette->colors[i].r = ( *pal++ ) << 2; palette->colors[i].g = ( *pal++ ) << 2; palette->colors[i].b = ( *pal++ ) << 2; - palette->colors[i].unused = 0; } for (row = 0; row < bufh; ++row) { dst = (Uint32*)((Uint8*)pixels + row * pitch); http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=f67699e16b0d2b628c9b690846f93927fbf7a196 commit f67699e16b0d2b628c9b690846f93927fbf7a196 Author: Pepe Schwarz <pe...@gm...> Date: Sat Mar 30 22:12:57 2013 +0100 added copying the config template and the icon in three resolutions diff --git a/android/prep_env.sh b/android/prep_env.sh index d76ca57..c7baa9c 100644 --- a/android/prep_env.sh +++ b/android/prep_env.sh @@ -123,6 +123,14 @@ function move_and_edit_projectfiles { # copy the gemrb activity cp $ENVROOT/GemRB.java $ENVROOT/build/gemrb/src/net/sourceforge/gemrb/ + # copy the packaged config file + cp $ENVROOT/packaged.GemRB.cfg $ENVROOT/build/gemrb/assets + + # copy the icons + cp $GEMRB_GIT_PATH/artwork/gemrb-logo-36px.png $ENVROOT/build/gemrb/res/drawable-ldpi/icon.png + cp $GEMRB_GIT_PATH/artwork/gemrb-logo-48px.png $ENVROOT/build/gemrb/res/drawable-mdpi/icon.png + cp $GEMRB_GIT_PATH/artwork/gemrb-logo-72px.png $ENVROOT/build/gemrb/res/drawable-hdpi/icon.png + # copy the makefile cp $ENVROOT/GEMRB_Android.mk $ENVROOT/build/gemrb/jni/src/Android.mk @@ -132,7 +140,7 @@ function move_and_edit_projectfiles { # add the neccessary libraries to the base activity echo -en "Performing neccessary edits...\n" - sed -i -e '59 a\ + sed -i -e '/System.loadLibrary("SDL2")/ a\ System.loadLibrary("ogg"); \ System.loadLibrary("vorbis"); \ System.loadLibrary("openal"); \ @@ -184,5 +192,5 @@ setup_dir_struct move_and_edit_projectfiles build_deps move_libraries -android update project -t android-10 -p $ENVROOT/build/gemrb +android update project -t android-17 -p $ENVROOT/build/gemrb finished http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=04ef4ac251523038d2b45b69e4c4c0fe1220f8ce commit 04ef4ac251523038d2b45b69e4c4c0fe1220f8ce Author: Pepe Schwarz <pe...@gm...> Date: Sat Mar 30 22:12:20 2013 +0100 fixed some misconfigurations in the android config template diff --git a/android/packaged.GemRB.cfg b/android/packaged.GemRB.cfg index eaa5bdb..7593e70 100644 --- a/android/packaged.GemRB.cfg +++ b/android/packaged.GemRB.cfg @@ -38,7 +38,7 @@ # # ##################################################### -GameType=bg1 +GameType=bg2 ##################################################### # Game Name [String] Title for GemRB window, use # @@ -208,7 +208,7 @@ CachePath=/sdcard/gemrb/bg1/cache # enter the full path to the GemRB executable # ##################################################### -# GemRBPath=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files +# GemRBPath= ##################################################### # GemRB GUI Scripts Path [String] # @@ -219,7 +219,7 @@ CachePath=/sdcard/gemrb/bg1/cache # the 'GUIScript' subdirectory. # ##################################################### -GUIScriptsPath=<EXTPATH_PLACEHOLDER> +#GUIScriptsPath= ##################################################### # GemRB Plugins Path [String] # @@ -254,7 +254,7 @@ GUIScriptsPath=<EXTPATH_PLACEHOLDER> # You probably do NOT want to specify this! # ##################################################### -#GameDataPath=data +#GameDataPath= ##################################################### # Game Data Override Path [String] # @@ -265,7 +265,7 @@ GUIScriptsPath=<EXTPATH_PLACEHOLDER> # You probably do NOT want to specify this! # ##################################################### -#GameOverridePath=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files/bg2/dat +#GameOverridePath= ##################################################### # GemRB Data Override Path [String] # @@ -276,8 +276,8 @@ GUIScriptsPath=<EXTPATH_PLACEHOLDER> # You probably do NOT want to specify this! # ##################################################### -GemRBOverridePath=<EXTPATH_PLACEHOLDER> -GemRBUnhardcodedPath=<EXTPATH_PLACEHOLDER> +#GemRBOverridePath= +#GemRBUnhardcodedPath= ##################################################### # Input Parameters # http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=c7cb86a23d5a37efe0244057b835768868f1c270 commit c7cb86a23d5a37efe0244057b835768868f1c270 Author: Pepe Schwarz <pe...@gm...> Date: Sat Mar 30 22:11:22 2013 +0100 added the icon in three resolutions for the android launcher diff --git a/artwork/gemrb-logo-36px.png b/artwork/gemrb-logo-36px.png new file mode 100644 index 0000000..6891b53 Binary files /dev/null and b/artwork/gemrb-logo-36px.png differ diff --git a/artwork/gemrb-logo-48px.png b/artwork/gemrb-logo-48px.png new file mode 100644 index 0000000..7ef7a0b Binary files /dev/null and b/artwork/gemrb-logo-48px.png differ diff --git a/artwork/gemrb-logo-72px.png b/artwork/gemrb-logo-72px.png new file mode 100644 index 0000000..2d35db7 Binary files /dev/null and b/artwork/gemrb-logo-72px.png differ http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=77e1a3dcd2e0a5eb9e81b69cd310067bc93355a5 commit 77e1a3dcd2e0a5eb9e81b69cd310067bc93355a5 Author: Pepe Schwarz <pe...@gm...> Date: Fri Mar 22 08:54:26 2013 +0100 download pelya from sourceforge instead of commiting it to the repo diff --git a/android/prep_env.sh b/android/prep_env.sh index 3531f52..d76ca57 100644 --- a/android/prep_env.sh +++ b/android/prep_env.sh @@ -80,7 +80,7 @@ function move_libraries { cp $ENVROOT/FREETYPEBUILD_Android.mk $ENVROOT/build/gemrb/jni/freetype2-android/Android/jni/Android.mk cp $ENVROOT/RECURSE_Android.mk $ENVROOT/build/gemrb/jni/freetype2-android/Android/Android.mk cp $ENVROOT/RECURSE_Android.mk $ENVROOT/build/gemrb/jni/freetype2-android/Android.mk - # im not happy with that, but it's ok for now i guess + # im not happy with this, but it's ok for now i guess mkdir build/gemrb/jni/{libogg,libvorbis,libpng,openal} cp $ENVROOT/OGG_Android.mk $ENVROOT/build/gemrb/jni/libogg/Android.mk @@ -110,6 +110,7 @@ function move_libraries { ln -s $ENVROOT/openal/include $ENVROOT/build/gemrb/jni/openal/include # python + wget http://sourceforge.net/projects/gemrb/files/Other%20Binaries/android/libpython-2.6.2-pelya.tar.bz2 -O $ENVROOT/libpython.tar tar -xf $ENVROOT/libpython.tar -C $ENVROOT/build/gemrb/jni/ echo -en "Done.\n" http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=1b1c8e47c8352054d2f5cdbf38689669b39973b8 commit 1b1c8e47c8352054d2f5cdbf38689669b39973b8 Author: Pepe Schwarz <pe...@gm...> Date: Wed Mar 13 18:58:31 2013 +0100 remove unneccessary edits of the packaged config file diff --git a/android/GemRB.java b/android/GemRB.java index e2bf6b7..8025e22 100644 --- a/android/GemRB.java +++ b/android/GemRB.java @@ -27,14 +27,13 @@ public class GemRB extends SDLActivity { public String newPath; protected void onCreate(Bundle savedInstanceState) { - File homePath = getApplicationContext().getExternalFilesDir(null); // null for general purpose files - File gemrbHomeFolder = new File(homePath.getAbsolutePath(), ".GemRB"); + File gemrbHomeFolder = getApplicationContext().getExternalFilesDir(null); // null for general purpose files String[] foldersToExtract = { "GUIScripts", "override", "unhardcoded" }; // first clear the directories and their contents Log.d("GemRB Activity", "Cleaning up..."); for(String folder : foldersToExtract) { - deleteRecursive(new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat(folder))); + deleteRecursive(new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat(folder))); } Log.d("GemRB Activity", "Extracting new files..."); @@ -47,25 +46,21 @@ public class GemRB extends SDLActivity { Log.d("GemRB Activity", "Checking GemRB.cfg content."); - File finalConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("GemRB.cfg")); + File finalConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("GemRB.cfg")); if(!finalConfFile.exists()) { Log.d("GemRB Activity", "GemRB.cfg doesn't exist in the expected location, creating it from the packaged template."); // String[] keysToChange = { "GUIScriptsPath", "GemRBOverridePath", "GemRBUnhardcodedPath" }; try { - File inConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("packaged.GemRB.cfg")); + File inConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("packaged.GemRB.cfg")); BufferedReader inConf = new BufferedReader(new FileReader(inConfFile)); - File outConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("new.GemRB.cfg")); + File outConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("new.GemRB.cfg")); BufferedWriter outConf = new BufferedWriter(new FileWriter(outConfFile)); String line; while((line = inConf.readLine()) != null) { - if(line.contains("<EXTPATH_PLACEHOLDER>")) { - line = line.replace("<EXTPATH_PLACEHOLDER>", gemrbHomeFolder.toString()); - Log.d("GemRB Activity", "Line after replace: " + line); - } outConf.write(line.concat("\n")); outConf.flush(); } @@ -78,24 +73,7 @@ public class GemRB extends SDLActivity { } catch (IOException e) { throw new RuntimeException(e); } - } else if(finalConfFile.exists()) { - try { - BufferedReader existingConfFile = new BufferedReader(new FileReader(finalConfFile)); - - String line; - while((line = existingConfFile.readLine()) != null) { - if(line.contains("GUIScriptsPath") || line.contains("GemRBOverridePath") || line.contains("GemRBUnhardcodedPath")) { - Log.d("GemRB Activity", "At least one of GUIScriptsPath, GemRBOverridePath or GemRBUnhardcodedPath is wrongly configured in your GemRB.cfg"); - } - } - - } catch(IOException e) { - throw new RuntimeException(e); - } - - } else { - Log.d("GemRB Activity", "GemRB.cfg already exists, assuming correct configuration."); - } + } super.onCreate(savedInstanceState); } http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=8cf6e570e12deb8be03a041e3f9220b6066689de commit 8cf6e570e12deb8be03a041e3f9220b6066689de Author: Pepe Schwarz <pe...@gm...> Date: Mon Mar 11 01:23:37 2013 +0100 added config file template diff --git a/android/packaged.GemRB.cfg b/android/packaged.GemRB.cfg new file mode 100644 index 0000000..eaa5bdb --- /dev/null +++ b/android/packaged.GemRB.cfg @@ -0,0 +1,324 @@ +##################################################### +# # +# This is the GemRB Configuration file. # +# Here are defined some default parameters for # +# basic configuration and paths definition. # +# # +# Parameters are defined as a Name=Value pair # +# The Value can be of three types: # +# - String # +# - Integer # +# - Boolean # +# # +# The String value is represented as follows # +# i.e. H:\GemRB\plugins # +# Integers are defined as follows # +# i.e. 12723 # +# Booleans are represented as 1 or 0 in this file # +# # +# Lines starting with # are ignored # +# # +##################################################### + +##################################################### +# # +# Game Type [String] Use one of the following # +# values: # +# # +# auto Attempt to autodetect game type # +# # +# bg1 Baldur's Gate # +# bg2 Baldur's Gate 2 : SoA or ToB # +# tob Baldur's Gate 2 : ToB (obsolete) # +# iwd IceWind Dale (no How or ToTL installed)# +# how IceWind Dale : HoW or ToTL # +# iwd2 IceWind Dale 2 # +# pst Planescape Torment # +# (More will come) # +# # +##################################################### + +GameType=bg1 + +##################################################### +# Game Name [String] Title for GemRB window, use # +# anything you wish, e.g. Baldur's Gate 3: RotFL # +##################################################### + +GameName=Baldur's Gate 2 + +##################################################### +# Encoding [default|polish|czech] Language used by # +# game data. Except of polish BG1, leave disabled. # +##################################################### + +# Encoding=default + +##################################################### +# Video Parameters # +##################################################### +#NOTE: SCREEN width and height can NOT be ARBITRARY without installing the +# widescreen mod: http://www.gibberlings3.net/widescreen/ +#Resolutions supported by the original games (gemrb) are: +# * 640x480 (except in iwd2) +# * 800x600 (bg2, iwd:how, iwd2) +# * 1024x768 (bg2, iwd:how, iwd2) +# * 1280x1024 (bg2, iwd:how, iwd2) + +#Screen width +Width=640 + +#Screen height +Height=480 + +#Bits per pixel [Integer:16,32] +Bpp=16 + +#Fullscreen [Boolean] +Fullscreen=0 + +# Delay before tooltips appear [milliseconds] +TooltipDelay=500 + +##################################################### +# Audio Parameters # +##################################################### +# # +# All volume options are in percents, with 100 # +# being the normal and default volume # +# # +##################################################### + +# Choices: openal (default), sdlaudio (faster, but limited featureset), none +AudioDriver = openal + +# Volume of ambient sounds +#VolumeAmbients = 100 + +# Volume during movie playback +#VolumeMovie = 100 + +# Volume of background music +#VolumeMusic = 100 + +# Volume of sound effects +#VolumeSFX = 100 + +# Volume of PC or NPC voices +#VolumeVoices = 100 + +##################################################### +# Case Sensitive Filesystem [Boolean] # +# # +# If your installed game files are residing on a # +# case sensitive filesystem (ext2 on Linux) then # +# you need to set this value to 1, it has no # +# effect on Windows # +##################################################### + +#CaseSensitive=1 + +##################################################### +# GUI Parameters # +##################################################### +# # +# GemRB may enhance the GUI of the Infinity Engine # +# games (so far only in bg2) creating functionally # +# new buttons or scrollbars where they weren't # +# present in original games. It may improve its # +# usability, but is not quite compatible with # +# mods changing graphics and alignment in the *.chu # +# files (e.g. the buttons will appear in old # +# coordinates and may stop being clickable). # +##################################################### + +# Enable all gui enhancements ? [Integer] +GUIEnhancements = 15 + + +##################################################### +# Debug # +##################################################### + +# Do not play intro videos [Boolean], useful for development +#SkipIntroVideos=1 + +# Draw Frames per Second info [Boolean] +# DrawFPS=0 + +# Hide unexplored parts of a map +#FogOfWar=1 + +# Enable debug and cheat keystrokes, see docs/en/CheatKeys.txt +# full listing +#EnableCheatKeys=1 + +##################################################### +# Paths # +##################################################### + +##################################################### +# Game Paths [String] # +# # +# These are the paths where the Game you want to # +# play is installed. # +# Enter the full path to the directory. # +##################################################### + +#GamePath=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files/bg2/ +#CD1=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files/bg2/data +GamePath=/sdcard/gemrb/bg1 +CD1=/sdcard/gemrb/bg1/data +# CD2=<CD2_PLACEHOLDER> +# CD3=<CD3_PLACEHOLDER> +# CD4=<CD4_PLACEHOLDER> +# CD5=<CD5_PLACEHOLDER> + +##################################################### +# GemRB Cache Path [String] # +# # +# This is the path where GemRB will store the # +# cached files, enter the full path to the GemRB # +# Cache directory. # +##################################################### + +CachePath=/sdcard/gemrb/bg1/cache + +##################################################### +# GemRB Save Path [String] # +# # +# This is the path where GemRB looks for saved # +# games. # +# Enter the full path to the directory containing # +# e.g. the 'save' subdirectory. # +# # +# You do not have to specify this if you use save # +# subdir in the GamePath directory. # +##################################################### + +# SavePath=/sdcard/gemrb/bg2/ + +###### HERE BE DRAGONS ############################# +# You shouldn't need to change any paths below this point. + +##################################################### +# GemRB Path [String] # +# # +# This is the path where GemRB is stored, just # +# enter the full path to the GemRB executable # +##################################################### + +# GemRBPath=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files + +##################################################### +# GemRB GUI Scripts Path [String] # +# # +# This is the path where GemRB GUI scripts are # +# stored, usually these are in the GemRB directory # +# Enter the full path to the directory containing # +# the 'GUIScript' subdirectory. # +##################################################### + +GUIScriptsPath=<EXTPATH_PLACEHOLDER> + +##################################################### +# GemRB Plugins Path [String] # +# # +# This is the path containing GemRB plugins # +# - shared libraries (.so) on Unixes, or # +# DLLs (.dll) on windows. # +# Enter the full path to the directory. # +# # +# You may need to specify this path if running # +# GemRB from source directory on Linux. # +##################################################### + +#PluginsPath=@PLUGIN_DIR@ + +##################################################### +# Custom Font Path [String] # +# # +# This is the path where GemRB looks for non-BAM # +# fonts (ex TTF) # +# # +##################################################### + +#CustomFontPath= + +##################################################### +# Game Data Path [String] # +# # +# This is the subdirectory under GamePath where # +# game data files are stored. # +# # +# You probably do NOT want to specify this! # +##################################################### + +#GameDataPath=data + +##################################################### +# Game Data Override Path [String] # +# # +# This is the subdirectory under GamePath where # +# game data override files are stored. # +# # +# You probably do NOT want to specify this! # +##################################################### + +#GameOverridePath=/storage/emulated/0/Android/data/net.sourceforge.gemrb/files/bg2/dat + +##################################################### +# GemRB Data Override Path [String] # +# # +# This is the path where GemRB looks for the GemRB # +# data override directory. # +# # +# You probably do NOT want to specify this! # +##################################################### + +GemRBOverridePath=<EXTPATH_PLACEHOLDER> +GemRBUnhardcodedPath=<EXTPATH_PLACEHOLDER> + +##################################################### +# Input Parameters # +##################################################### + +#whether or not to use software keyboard on devices that support one +UseSoftKeyboard=1 + +#Adds a gutter around the screen for scrolling +TouchScrollAreas=0 + +##################################################### +# MouseFeedback # +# Bitfield with reserved bits for disabling # +# the mouse. Those bits cannot be set via config # +# # +# Show mouse+tooltips = 0 # +# Hide mouse = 1 # +# Hide tooltips = 2 # +# Hide mouse+tooltips = 3 # +##################################################### + +# For a strictly touchscreen device we recommend +# Changing this to 3. + +# default is 0 +MouseFeedback=0 + +##################################################### +# Touch Gesture Input Parameters # +# Requires SDL 1.3 or later # +# All "NumFing" settings must be > 1 and < 5 # +# NumFingScroll and NumFingKboard cannot be equal # +##################################################### + +#NumFingScroll=2 + +#NumFingKboard=3 + +#NumFingInfo=2 + +##################################################### +# END # +##################################################### http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=6cda6b993c3280c5595f0794d1ba69113426aab2 commit 6cda6b993c3280c5595f0794d1ba69113426aab2 Author: Pepe Schwarz <pe...@gm...> Date: Mon Mar 11 01:10:57 2013 +0100 added android build files diff --git a/android/FREETYPEBUILD_Android.mk b/android/FREETYPEBUILD_Android.mk new file mode 100644 index 0000000..f67b596 --- /dev/null +++ b/android/FREETYPEBUILD_Android.mk @@ -0,0 +1,40 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := freetype2-static + +LOCAL_CFLAGS := -DANDROID_NDK \ + -DFT2_BUILD_LIBRARY=1 + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include_all \ + $(LOCAL_PATH)/../../include/ \ + $(LOCAL_PATH)/../../src/ + +LOCAL_SRC_FILES := \ + ../../src/autofit/autofit.c \ + ../../src/base/basepic.c \ + ../../src/base/ftapi.c \ + ../../src/base/ftbase.c \ + ../../src/base/ftbbox.c \ + ../../src/base/ftbitmap.c \ + ../../src/base/ftdbgmem.c \ + ../../src/base/ftdebug.c \ + ../../src/base/ftglyph.c \ + ../../src/base/ftinit.c \ + ../../src/base/ftpic.c \ + ../../src/base/ftstroke.c \ + ../../src/base/ftsynth.c \ + ../../src/base/ftsystem.c \ + ../../src/cff/cff.c \ + ../../src/pshinter/pshinter.c \ + ../../src/psnames/psnames.c \ + ../../src/raster/raster.c \ + ../../src/sfnt/sfnt.c \ + ../../src/smooth/smooth.c \ + ../../src/truetype/truetype.c + +LOCAL_LDLIBS := -ldl -llog + +include $(BUILD_STATIC_LIBRARY) + diff --git a/android/GEMRB_Android.mk b/android/GEMRB_Android.mk new file mode 100644 index 0000000..63548c6 --- /dev/null +++ b/android/GEMRB_Android.mk @@ -0,0 +1,252 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := main + +SDL_PATH := ../SDL + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/main/gemrb/includes/ \ + $(LOCAL_PATH)/main/gemrb/plugins/SAVImporter/ $(LOCAL_PATH)/main/gemrb/plugins/BMPWriter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/TISImporter/ $(LOCAL_PATH)/main/gemrb/plugins/CHUImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/2DAImporter/ $(LOCAL_PATH)/main/gemrb/plugins/BAMImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/ITMImporter/ $(LOCAL_PATH)/main/gemrb/plugins/BMPImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/WEDImporter/ $(LOCAL_PATH)/main/gemrb/plugins/IDSImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/ZLibManager/ $(LOCAL_PATH)/main/gemrb/plugins/DLGImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/GUIScript/ $(LOCAL_PATH)/main/gemrb/plugins/WAVReader/ \ + $(LOCAL_PATH)/main/gemrb/plugins/STOImporter/ $(LOCAL_PATH)/main/gemrb/plugins/TTFImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/WMPImporter/ $(LOCAL_PATH)/main/gemrb/plugins/INIImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/MOSImporter/ $(LOCAL_PATH)/main/gemrb/plugins/TLKImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/BIKPlayer/ $(LOCAL_PATH)/main/gemrb/plugins/SPLImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/NullSound/ $(LOCAL_PATH)/main/gemrb/plugins/EFFImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/SDLAudio/ $(LOCAL_PATH)/main/gemrb/plugins/CREImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/OpenALAudio/ $(LOCAL_PATH)/main/gemrb/plugins/PROImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/ACMReader/ $(LOCAL_PATH)/main/gemrb/plugins/GAMImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/SDLVideo/ $(LOCAL_PATH)/main/gemrb/plugins/BIFImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/KEYImporter/ $(LOCAL_PATH)/main/gemrb/plugins/AREImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/DirectoryImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/OGGReader/ $(LOCAL_PATH)/main/gemrb/plugins/MVEPlayer/ \ + $(LOCAL_PATH)/main/gemrb/plugins/NullSource/ $(LOCAL_PATH)/main/gemrb/plugins/PLTImporter/ \ + $(LOCAL_PATH)/main/gemrb/plugins/PNGImporter/ $(LOCAL_PATH)/main/gemrb/plugins/MUSImporter/ \ + $(LOCAL_PATH)/main/gemrb/core/Scriptable/ $(LOCAL_PATH)/main/gemrb/core/System/Logger/ \ + $(LOCAL_PATH)/main/gemrb/core/System/ $(LOCAL_PATH)/main/gemrb/core/ \ + $(LOCAL_PATH)/../freetype2-android/include \ + $(LOCAL_PATH)/../SDL_mixer-1.2.12/ \ + $(LOCAL_PATH)/../openal/include/ \ + $(LOCAL_PATH)/../SDL/src/core/android/ \ + $(LOCAL_PATH)/../libogg/include/ \ + $(LOCAL_PATH)/../libvorbis/include/ \ + $(LOCAL_PATH)/../libpython/include/ \ + $(LOCAL_PATH)/../libpng/include/ \ + +# Add your application source files here... +LOCAL_SRC_FILES := main/gemrb/plugins/SAVImporter/SAVImporter.cpp \ + main/gemrb/plugins/BMPWriter/BMPWriter.cpp \ + main/gemrb/plugins/TISImporter/TISImporter.cpp \ + main/gemrb/plugins/CHUImporter/CHUImporter.cpp \ + main/gemrb/plugins/2DAImporter/2DAImporter.cpp \ + main/gemrb/plugins/BAMImporter/BAMFontManager.cpp \ + main/gemrb/plugins/BAMImporter/BAMFont.cpp \ + main/gemrb/plugins/BAMImporter/BAMImporter.cpp \ + main/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp \ + main/gemrb/plugins/ITMImporter/ITMImporter.cpp \ + main/gemrb/plugins/BMPImporter/BMPImporter.cpp \ + main/gemrb/plugins/WEDImporter/WEDImporter.cpp \ + main/gemrb/plugins/IDSImporter/IDSImporter.cpp \ + main/gemrb/plugins/ZLibManager/ZLibManager.cpp \ + main/gemrb/plugins/DLGImporter/DLGImporter.cpp \ + main/gemrb/plugins/GUIScript/PythonHelpers.cpp \ + main/gemrb/plugins/GUIScript/GUIScript.cpp \ + main/gemrb/plugins/WAVReader/WAVReader.cpp \ + main/gemrb/plugins/STOImporter/STOImporter.cpp \ + main/gemrb/plugins/TTFImporter/TTFFontManager.cpp \ + main/gemrb/plugins/TTFImporter/Freetype.cpp \ + main/gemrb/plugins/TTFImporter/TTFFont.cpp \ + main/gemrb/plugins/WMPImporter/WMPImporter.cpp \ + main/gemrb/plugins/INIImporter/INIImporter.cpp \ + main/gemrb/plugins/MOSImporter/MOSImporter.cpp \ + main/gemrb/plugins/TLKImporter/TLKImporter.cpp \ + main/gemrb/plugins/TLKImporter/TlkOverride.cpp \ + main/gemrb/plugins/BIKPlayer/dct.cpp \ + main/gemrb/plugins/BIKPlayer/BIKPlayer.cpp \ + main/gemrb/plugins/BIKPlayer/rational.cpp \ + main/gemrb/plugins/BIKPlayer/mem.cpp \ + main/gemrb/plugins/BIKPlayer/GetBitContext.cpp \ + main/gemrb/plugins/BIKPlayer/fft.cpp \ + main/gemrb/plugins/BIKPlayer/rdft.cpp \ + main/gemrb/plugins/SPLImporter/SPLImporter.cpp \ + main/gemrb/plugins/NullSound/NullSound.cpp \ + main/gemrb/plugins/EFFImporter/EFFImporter.cpp \ + main/gemrb/plugins/FXOpcodes/FXOpcodes.cpp \ + main/gemrb/plugins/CREImporter/CREImporter.cpp \ + main/gemrb/plugins/OpenALAudio/OpenALAudio.cpp \ + main/gemrb/plugins/OpenALAudio/StackLock.cpp \ + main/gemrb/plugins/OpenALAudio/AmbientMgrAL.cpp \ + main/gemrb/plugins/PROImporter/PROImporter.cpp \ + main/gemrb/plugins/ACMReader/decoder.cpp \ + main/gemrb/plugins/ACMReader/ACMReader.cpp \ + main/gemrb/plugins/ACMReader/unpacker.cpp \ + main/gemrb/plugins/GAMImporter/GAMImporter.cpp \ + main/gemrb/plugins/SDLVideo/SDL20Video.cpp \ + main/gemrb/plugins/SDLVideo/SDLVideo.cpp \ + main/gemrb/plugins/BIFImporter/BIFImporter.cpp \ + main/gemrb/plugins/KEYImporter/KEYImporter.cpp \ + main/gemrb/plugins/AREImporter/AREImporter.cpp \ + main/gemrb/plugins/DirectoryImporter/DirectoryImporter.cpp \ + main/gemrb/plugins/IWDOpcodes/IWDOpcodes.cpp \ + main/gemrb/plugins/OGGReader/OGGReader.cpp \ + main/gemrb/plugins/MVEPlayer/mveaudiodec.cpp \ + main/gemrb/plugins/MVEPlayer/mvevideodec8.cpp \ + main/gemrb/plugins/MVEPlayer/MVEPlayer.cpp \ + main/gemrb/plugins/MVEPlayer/mve_player.cpp \ + main/gemrb/plugins/MVEPlayer/mvevideodec16.cpp \ + main/gemrb/plugins/NullSource/NullSource.cpp \ + main/gemrb/plugins/PLTImporter/PLTImporter.cpp \ + main/gemrb/plugins/PNGImporter/PNGImporter.cpp \ + main/gemrb/plugins/MUSImporter/MUSImporter.cpp \ + main/gemrb/core/Projectile.cpp \ + main/gemrb/core/AnimationMgr.cpp \ + main/gemrb/core/Store.cpp \ + main/gemrb/core/Ambient.cpp \ + main/gemrb/core/TableMgr.cpp \ + main/gemrb/core/ScriptEngine.cpp \ + main/gemrb/core/WindowMgr.cpp \ + main/gemrb/core/Tile.cpp \ + main/gemrb/core/DisplayMessage.cpp \ + main/gemrb/core/Scriptable/InfoPoint.cpp \ + main/gemrb/core/Scriptable/CombatInfo.cpp \ + main/gemrb/core/Scriptable/Container.cpp \ + main/gemrb/core/Scriptable/PCStatStruct.cpp \ + main/gemrb/core/Scriptable/Door.cpp \ + main/gemrb/core/Scriptable/Scriptable.cpp \ + main/gemrb/core/Scriptable/Actor.cpp \ + main/gemrb/core/IniSpawn.cpp \ + main/gemrb/core/CharAnimations.cpp \ + main/gemrb/core/Plugin.cpp \ + main/gemrb/core/GameData.cpp \ + main/gemrb/core/MusicMgr.cpp \ + main/gemrb/core/PluginLoader.cpp \ + main/gemrb/core/WorldMap.cpp \ + main/gemrb/core/ItemMgr.cpp \ + main/gemrb/core/SoundMgr.cpp \ + main/gemrb/core/TileMap.cpp \ + main/gemrb/core/AmbientMgr.cpp \ + main/gemrb/core/Inventory.cpp \ + main/gemrb/core/ScriptedAnimation.cpp \ + main/gemrb/core/WorldMapMgr.cpp \ + main/gemrb/core/Spellbook.cpp \ + main/gemrb/core/Factory.cpp \ + main/gemrb/core/TileSetMgr.cpp \ + main/gemrb/core/SymbolMgr.cpp \ + main/gemrb/core/DialogMgr.cpp \ + main/gemrb/core/ImageMgr.cpp \ + main/gemrb/core/LRUCache.cpp \ + main/gemrb/core/Sprite2D.cpp \ + main/gemrb/core/Dialog.cpp \ + main/gemrb/core/Calendar.cpp \ + main/gemrb/core/DialogHandler.cpp \ + main/gemrb/core/System/Logger.cpp \ + main/gemrb/core/System/Logger/MessageWindowLogger.cpp \ + main/gemrb/core/System/Logger/File.cpp \ + main/gemrb/core/System/Logger/Stdio.cpp \ + main/gemrb/core/System/Logger/Android.cpp \ + main/gemrb/core/System/StringBuffer.cpp \ + main/gemrb/core/System/VFS.cpp \ + main/gemrb/core/System/String.cpp \ + main/gemrb/core/System/Logging.cpp \ + main/gemrb/core/System/FileStream.cpp \ + main/gemrb/core/System/MemoryStream.cpp \ + main/gemrb/core/System/DataStream.cpp \ + main/gemrb/core/System/SlicedStream.cpp \ + main/gemrb/core/ResourceDesc.cpp \ + main/gemrb/core/Item.cpp \ + main/gemrb/core/SaveGameIterator.cpp \ + main/gemrb/core/Callback.cpp \ + main/gemrb/core/ArchiveImporter.cpp \ + main/gemrb/core/StringMgr.cpp \ + main/gemrb/core/ControlAnimation.cpp \ + main/gemrb/core/Region.cpp \ + main/gemrb/core/ProjectileMgr.cpp \ + main/gemrb/core/ActorMgr.cpp \ + main/gemrb/core/Resource.cpp \ + main/gemrb/core/StoreMgr.cpp \ + main/gemrb/core/Animation.cpp \ + main/gemrb/core/ResourceSource.cpp \ + main/gemrb/core/Map.cpp \ + main/gemrb/core/Variables.cpp \ + main/gemrb/core/FactoryObject.cpp \ + main/gemrb/core/DataFileMgr.cpp \ + main/gemrb/core/ResourceManager.cpp \ + main/gemrb/core/Video.cpp \ + main/gemrb/core/SpriteCover.cpp \ + main/gemrb/core/EffectQueue.cpp \ + main/gemrb/core/TileOverlay.cpp \ + main/gemrb/core/KeyMap.cpp \ + main/gemrb/core/Audio.cpp \ + main/gemrb/core/AnimationFactory.cpp \ + main/gemrb/core/SaveGameMgr.cpp \ + main/gemrb/core/ImageFactory.cpp \ + main/gemrb/core/Bitmap.cpp \ + main/gemrb/core/TileMapMgr.cpp \ + main/gemrb/core/GlobalTimer.cpp \ + main/gemrb/core/GameScript/GameScript.cpp \ + main/gemrb/core/GameScript/Triggers.cpp \ + main/gemrb/core/GameScript/GSUtils.cpp \ + main/gemrb/core/GameScript/Matching.cpp \ + main/gemrb/core/GameScript/Actions.cpp \ + main/gemrb/core/GameScript/Objects.cpp \ + main/gemrb/core/Polygon.cpp \ + main/gemrb/core/GUI/MapControl.cpp \ + main/gemrb/core/GUI/Label.cpp \ + main/gemrb/core/GUI/ScrollBar.cpp \ + main/gemrb/core/GUI/Control.cpp \ + main/gemrb/core/GUI/WorldMapControl.cpp \ + main/gemrb/core/GUI/TextEdit.cpp \ + main/gemrb/core/GUI/Window.cpp \ + main/gemrb/core/GUI/Button.cpp \ + main/gemrb/core/GUI/GameControl.cpp \ + main/gemrb/core/GUI/TextArea.cpp \ + main/gemrb/core/GUI/EventMgr.cpp \ + main/gemrb/core/GUI/Progressbar.cpp \ + main/gemrb/core/GUI/Console.cpp \ + main/gemrb/core/GUI/Slider.cpp \ + main/gemrb/core/FontManager.cpp \ + main/gemrb/core/MoviePlayer.cpp \ + main/gemrb/core/Font.cpp \ + main/gemrb/core/MapMgr.cpp \ + main/gemrb/core/Compressor.cpp \ + main/gemrb/core/PalettedImageMgr.cpp \ + main/gemrb/core/PluginMgr.cpp \ + main/gemrb/core/IndexedArchive.cpp \ + main/gemrb/core/Spell.cpp \ + main/gemrb/core/Core.cpp \ + main/gemrb/core/Image.cpp \ + main/gemrb/core/SpellMgr.cpp \ + main/gemrb/core/Particles.cpp \ + main/gemrb/core/ProjectileServer.cpp \ + main/gemrb/core/EffectMgr.cpp \ + main/gemrb/core/Game.cpp \ + main/gemrb/core/ImageWriter.cpp \ + main/gemrb/core/Interface.cpp \ + main/gemrb/core/Cache.cpp \ + main/gemrb/core/FileCache.cpp \ + main/gemrb/core/Palette.cpp \ + main/gemrb/core/System/swab.c \ + main/gemrb/GemRB.cpp \ + ../SDL/src/main/android/SDL_android_main.cpp \ + # main/gemrb/plugins/SDLAudio/SDLAudio.cpp \ + +LOCAL_SHARED_LIBRARIES := SDL2 openal ogg vorbis python +LOCAL_STATIC_LIBRARIES := freetype2-static png gnustl_static + +LOCAL_CPPFLAGS += -fexceptions -finline-functions -O0 -DSTATIC_LINK=Yes -DHAVE_SNPRINTF + +LOCAL_LDLIBS := -lGLESv1_CM -llog -lz -ldl +# LOCAL_LDLIBS += -L$(LOCAL_PATH)/../../../gemrb/obj/local/armeabi/ -logg -lvorbis -lSDL_mixer -lpython2.7 -l freetype2-static -lpng -lgnustl_static + +LOCAL_C_INCLUDES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/include +LOCAL_LDLIBS += -L$(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI) -lstdc++ + +include $(BUILD_SHARED_LIBRARY) + +include $(call all-subdir-makefiles) diff --git a/android/GEMRB_Application.mk b/android/GEMRB_Application.mk new file mode 100644 index 0000000..d6674e8 --- /dev/null +++ b/android/GEMRB_Application.mk @@ -0,0 +1,5 @@ +# Uncomment this if you're using STL in your project +# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information +# APP_PROJECT_PATH := $(call my-dir)/.. +APP_STL := gnustl_static +APP_MODULES := SDL2 ogg vorbis openal python freetype2-static png main diff --git a/android/GemRB.java b/android/GemRB.java new file mode 100644 index 0000000..e2bf6b7 --- /dev/null +++ b/android/GemRB.java @@ -0,0 +1,154 @@ +package net.sourceforge.gemrb; + +import org.libsdl.app.SDLActivity; +import android.os.Bundle; +import android.util.Log; +import java.io.IOException; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.BufferedOutputStream; +import java.io.BufferedInputStream; +import java.io.InputStream; +import android.content.res.AssetManager; +import java.util.Enumeration; +import java.util.zip.*; +import java.util.Properties; +import android.app.AlertDialog; +import android.widget.EditText; +import android.content.DialogInterface; + +public class GemRB extends SDLActivity { + + public String newPath; + + protected void onCreate(Bundle savedInstanceState) { + File homePath = getApplicationContext().getExternalFilesDir(null); // null for general purpose files + File gemrbHomeFolder = new File(homePath.getAbsolutePath(), ".GemRB"); + String[] foldersToExtract = { "GUIScripts", "override", "unhardcoded" }; + + // first clear the directories and their contents + Log.d("GemRB Activity", "Cleaning up..."); + for(String folder : foldersToExtract) { + deleteRecursive(new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat(folder))); + } + + Log.d("GemRB Activity", "Extracting new files..."); + try { + extractFolder(this.getApplication().getPackageCodePath(), gemrbHomeFolder.getAbsolutePath()); + } catch (Exception e) { + throw new RuntimeException(e); + } + Log.d("GemRB Activity", "Done."); + + Log.d("GemRB Activity", "Checking GemRB.cfg content."); + + File finalConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("GemRB.cfg")); + + if(!finalConfFile.exists()) { + Log.d("GemRB Activity", "GemRB.cfg doesn't exist in the expected location, creating it from the packaged template."); + + // String[] keysToChange = { "GUIScriptsPath", "GemRBOverridePath", "GemRBUnhardcodedPath" }; + try { + File inConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("packaged.GemRB.cfg")); + BufferedReader inConf = new BufferedReader(new FileReader(inConfFile)); + File outConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(homePath.separator).concat("new.GemRB.cfg")); + BufferedWriter outConf = new BufferedWriter(new FileWriter(outConfFile)); + + String line; + + while((line = inConf.readLine()) != null) { + if(line.contains("<EXTPATH_PLACEHOLDER>")) { + line = line.replace("<EXTPATH_PLACEHOLDER>", gemrbHomeFolder.toString()); + Log.d("GemRB Activity", "Line after replace: " + line); + } + outConf.write(line.concat("\n")); + outConf.flush(); + } + inConf.close(); + outConf.flush(); + outConf.close(); + + inConfFile.delete(); + outConfFile.renameTo(finalConfFile); + } catch (IOException e) { + throw new RuntimeException(e); + } + } else if(finalConfFile.exists()) { + try { + BufferedReader existingConfFile = new BufferedReader(new FileReader(finalConfFile)); + + String line; + while((line = existingConfFile.readLine()) != null) { + if(line.contains("GUIScriptsPath") || line.contains("GemRBOverridePath") || line.contains("GemRBUnhardcodedPath")) { + Log.d("GemRB Activity", "At least one of GUIScriptsPath, GemRBOverridePath or GemRBUnhardcodedPath is wrongly configured in your GemRB.cfg"); + } + } + + } catch(IOException e) { + throw new RuntimeException(e); + } + + } else { + Log.d("GemRB Activity", "GemRB.cfg already exists, assuming correct configuration."); + } + + super.onCreate(savedInstanceState); + } + + private static void deleteRecursive(File fileOrDirectory) { + if (fileOrDirectory.isDirectory()) + for (File child : fileOrDirectory.listFiles()) + deleteRecursive(child); + + fileOrDirectory.delete(); + } + + private static void extractFolder(String zipFile, String newPath) throws ZipException, IOException { + int BUFFER = 1024 * 1024; + File file = new File(zipFile); + + ZipFile zip = new ZipFile(file); + + new File(newPath).mkdir(); + Enumeration zipFileEntries = zip.entries(); + + // establish buffer for writing file + byte data[] = new byte[BUFFER]; + // Process each entry + while (zipFileEntries.hasMoreElements()) { + // grab a zip file entry + ZipEntry entry = (ZipEntry) zipFileEntries.nextElement(); + String currentEntry = entry.getName(); + if(!currentEntry.contains("asset")) { + continue; + } + File destFile = new File(newPath, currentEntry.substring(7)); // 6th index should be "/" of "assets/" + //destFile = new File(newPath, destFile.getName()); + File destinationParent = destFile.getParentFile(); + + // create the parent directory structure if needed + destinationParent.mkdirs(); + + if (!entry.isDirectory()) { + InputStream is = zip.getInputStream(entry); + int currentByte; + + // write the current file to disk + FileOutputStream dest = new FileOutputStream(destFile); + + // read and write until last byte is encountered + while ((currentByte = is.read(data, 0, BUFFER)) != -1) { + dest.write(data, 0, currentByte); + } + dest.flush(); + dest.close(); + is.close(); + } + } + } +} diff --git a/android/OGG_Android.mk b/android/OGG_Android.mk new file mode 100644 index 0000000..8f3eb45 --- /dev/null +++ b/android/OGG_Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +# ogg +include $(CLEAR_VARS) + +LOCAL_MODULE := ogg +LOCAL_SRC_FILES := libogg.so +LOCAL_C_EXPORT_INCLUDES := include + +include $(PREBUILT_SHARED_LIBRARY) + diff --git a/android/OPENAL_Android.mk b/android/OPENAL_Android.mk new file mode 100644 index 0000000..a27b6f1 --- /dev/null +++ b/android/OPENAL_Android.mk @@ -0,0 +1,9 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := openal +LOCAL_SRC_FILES := libopenal.so +LOCAL_EXPORT_C_INCLUDES := include/ + +include $(PREBUILT_SHARED_LIBRARY) diff --git a/android/PNG_Android.mk b/android/PNG_Android.mk new file mode 100644 index 0000000..0a8d7fd --- /dev/null +++ b/android/PNG_Android.mk @@ -0,0 +1,9 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := png +LOCAL_SRC_FILES := libpng.a +LOCAL_EXPORT_C_INCLUDES := include/ + +include $(PREBUILT_STATIC_LIBRARY) diff --git a/android/README b/android/README new file mode 100644 index 0000000..5c13c93 --- /dev/null +++ b/android/README @@ -0,0 +1,101 @@ +BUILDING GEMRB FOR ANDROID +-------------------------- + +Tools you will need to build GemRB for Android: + +- android-sdk API-level 10 or greater +- android-ndk (newer is generally better, tested against r8d) +- ant +- java +- mercurial for building SDL2 +- git for building various other dependencies + +-------------------------------------- +Building the apk on a Unix-like System +-------------------------------------- + +Running the following commands from the directory this README resides in will +build an Android 2.2 and later compatible .apk. + +First, use the provided script to prepare the build environment: + + bash prep_env.sh $GEMRB_GIT_PATH + +where $GEMRB_GIT_PATH is the full path to the directory above the one this +README resides in. This script will create neccessary folders, check out and +build a few of the neccessary libraries and copy and modify a few project files. + +After the completion of the script, you can change into the build directory +with: + + cd build/gemrb + +and subsequently compile the remaining libraries and GemRB itsself with: + + ndk-build + +for a stripped build or + + ndk-build NDK_DEBUG=1 + +if you want a debuggable build. + +When the compilation concluded successfully, you can package the apk with: + + ant debug + +You can supply the additional argument "install" to ant to directly install the +resulting apk to a device connected to the computer which builds it, i.e: + + ant debug install + +NOTE: To use this command, you HAVE to have USB-Debugging enabled on your +Android device. + +If everything ran without any errors you should find a file named +"SDLActivity-debug.apk" in build/gemrb/bin below the folder this README resides +in. If you ran ant with the "install" argument, you can directly run GemRB from +your devices' main menu. If you didn't, you can copy the apk file to your device +with + + adb push bin/SDLActivity-debug.apk /sdcard/ + +assuming you are still in build/gemrb. + +--------------------- +Configuring your game +--------------------- + +You will have to install the widescreen mod for your game. +Depending on the version of Android on your device, you have to adjust the +height by 48 pixels, seeing as the home bar takes up space on the screen. + +NOTE: Due to performance issues, it is recommended to chose a resolution that +keeps the aspect ratio of your screen but does not equal your native resolution. + +----------------- +Configuring GemRB +----------------- + +The app will most likely not start your game on the first start. +This is because the supplied config file does not know about the location of +your game data. You will need to run the following command to retrieve the config +file: + + adb pull /sdcard/Android/data/net.sourceforge.gemrb/files/.GemRB/GemRB.cfg + +and edit it with your preferred text editor. Pay attention to the comments in +the file, the entries you need to change are: + + - GamePath + - CD1 to CD5 + - CachePath + +After you adjust these paths, you have to copy the file back to the correct +location on your device: + + adb push GemRB.cfg /sdcard/Android/data/net.sourceforge.gemrb/files/.GemRB/GemRB.cfg + +Assuming you followed all these steps correctly, you should be able to run the +app from your device's main menu and the game should start correctly. + diff --git a/android/RECURSE_Android.mk b/android/RECURSE_Android.mk new file mode 100644 index 0000000..5053e7d --- /dev/null +++ b/android/RECURSE_Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/android/TODO b/android/TODO new file mode 100644 index 0000000..abe5ded --- /dev/null +++ b/android/TODO @@ -0,0 +1,7 @@ +2013-03-10 +- prep_env.sh should have more error checks +- should probably add a dialog on first run to prompt for GamePath (although there might be a "proper" pre-game config screen a la scummvm?) +- version checks for override, unhardcoded and GUIScripts +- mouse cursor seems to get positioned at the corners of the screen touches for some reason, most likely not directly related to the android build though +- touches have to be rather quick to register as click events, might be related to SDL20Driver::ProcessFirstTouch() +- add GemRB icon diff --git a/android/VORBIS_Android.mk b/android/VORBIS_Android.mk new file mode 100644 index 0000000..7983098 --- /dev/null +++ b/android/VORBIS_Android.mk @@ -0,0 +1,9 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := vorbis +LOCAL_SRC_FILES := libvorbis.so +LOCAL_C_EXPORT_INCLOUDES := include... [truncated message content] |