Skip to content

Commit

Permalink
Merge pull request #3 from peschwa/android-fixes
Browse files Browse the repository at this point in the history
Android fixes
  • Loading branch information
lynxlynxlynx committed Jul 9, 2013
2 parents 29f79da + 07c6aa6 commit 2a3a4a4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
2 changes: 2 additions & 0 deletions android/GEMRB_Android.mk
Expand Up @@ -48,6 +48,7 @@ LOCAL_SRC_FILES := main/gemrb/plugins/SAVImporter/SAVImporter.cpp \
main/gemrb/plugins/BAMImporter/BAMFontManager.cpp \ main/gemrb/plugins/BAMImporter/BAMFontManager.cpp \
main/gemrb/plugins/BAMImporter/BAMFont.cpp \ main/gemrb/plugins/BAMImporter/BAMFont.cpp \
main/gemrb/plugins/BAMImporter/BAMImporter.cpp \ main/gemrb/plugins/BAMImporter/BAMImporter.cpp \
main/gemrb/plugins/BAMImporter/BAMSprite2D.cpp \
main/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp \ main/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp \
main/gemrb/plugins/ITMImporter/ITMImporter.cpp \ main/gemrb/plugins/ITMImporter/ITMImporter.cpp \
main/gemrb/plugins/BMPImporter/BMPImporter.cpp \ main/gemrb/plugins/BMPImporter/BMPImporter.cpp \
Expand Down Expand Up @@ -89,6 +90,7 @@ LOCAL_SRC_FILES := main/gemrb/plugins/SAVImporter/SAVImporter.cpp \
main/gemrb/plugins/GAMImporter/GAMImporter.cpp \ main/gemrb/plugins/GAMImporter/GAMImporter.cpp \
main/gemrb/plugins/SDLVideo/SDL20Video.cpp \ main/gemrb/plugins/SDLVideo/SDL20Video.cpp \
main/gemrb/plugins/SDLVideo/SDLVideo.cpp \ main/gemrb/plugins/SDLVideo/SDLVideo.cpp \
main/gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp \
main/gemrb/plugins/BIFImporter/BIFImporter.cpp \ main/gemrb/plugins/BIFImporter/BIFImporter.cpp \
main/gemrb/plugins/KEYImporter/KEYImporter.cpp \ main/gemrb/plugins/KEYImporter/KEYImporter.cpp \
main/gemrb/plugins/AREImporter/AREImporter.cpp \ main/gemrb/plugins/AREImporter/AREImporter.cpp \
Expand Down
18 changes: 2 additions & 16 deletions android/GemRB.java
Expand Up @@ -49,9 +49,9 @@ protected void onCreate(Bundle savedInstanceState) {
Log.d("GemRB Activity", "Checking GemRB.cfg content."); Log.d("GemRB Activity", "Checking GemRB.cfg content.");


File finalConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("GemRB.cfg")); File finalConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("GemRB.cfg"));
File userSuppliedConfig = new File(Environment.getExternalStoragePath().concat(gemrbHomeFolder.separator).concat("GemRB.cfg")); File userSuppliedConfig = new File(Environment.getExternalStorageDirectory().concat(gemrbHomeFolder.separator).concat("GemRB.cfg"));


if(!finalConfFile.exists() && !userSuppliedConfig.exists()) { if(!finalConfFile.exists()) {
Log.d("GemRB Activity", "GemRB.cfg doesn't exist in the expected location, creating it from the packaged template."); Log.d("GemRB Activity", "GemRB.cfg doesn't exist in the expected location, creating it from the packaged template.");


// String[] keysToChange = { "GUIScriptsPath", "GemRBOverridePath", "GemRBUnhardcodedPath" }; // String[] keysToChange = { "GUIScriptsPath", "GemRBOverridePath", "GemRBUnhardcodedPath" };
Expand All @@ -76,20 +76,6 @@ protected void onCreate(Bundle savedInstanceState) {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} else if (!finalConfFile.exists() && userSuppliedConfig.exists()) {
BufferedReader inConf = new BufferedReader(new FileReader(userSuppliedConfig));
File outConfFile = new File(gemrbHomeFolder.getAbsolutePath().concat(gemrbHomeFolder.separator).concat("GemRB.cfg"));
BufferedWriter outConf = new BufferedWriter(new FileWriter(outConfFile));

String line;

while((line = inConf.readLine()) != null) {
outConf.write(line.concat("\n"));
outConf.flush();
}
inConf.close();
outConf.flush();
outConf.close();
} }


super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Expand Down
9 changes: 7 additions & 2 deletions android/TODO
@@ -1,6 +1,11 @@
2013-03-10 2013-03-10
- prep_env.sh should have more error checks - prep_env.sh should have more error checks
- add a dialog on first run to prompt for GamePath - add a dialog on first run to prompt for GamePath (add.: make this a full-fledged configuration screen please)
- version checks for override, unhardcoded and GUIScripts - version checks for override, unhardcoded and GUIScripts (unneccessary, seeing as the .apk extracts version-appropriate folders)
- 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 - 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() - touches have to be rather quick to register as click events, might be related to SDL20Driver::ProcessFirstTouch()

2013-06-05
- replace the renderer/texture bits with SDL_GetWindowSurface and SDL_UpdateWindowSurface for performance, trading in scalability
* possible as a checkbox?
- configuration screen on first start, config selector on subsequent starts
4 changes: 4 additions & 0 deletions gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp
Expand Up @@ -23,7 +23,11 @@


#include "System/Logging.h" #include "System/Logging.h"


#ifdef ANDROID
#include <SDL.h>
#else
#include <SDL/SDL.h> #include <SDL/SDL.h>
#endif


namespace GemRB { namespace GemRB {


Expand Down

0 comments on commit 2a3a4a4

Please sign in to comment.