Skip to content
Browse files

Merge pull request #3 from peschwa/android-fixes

Android fixes
  • Loading branch information...
2 parents 29f79da + 07c6aa6 commit 2a3a4a490bb6d7e66c67bc5cd0b6951c0444f1cc @lynxlynxlynx lynxlynxlynx committed
Showing with 15 additions and 18 deletions.
  1. +2 −0 android/GEMRB_Android.mk
  2. +2 −16 android/GemRB.java
  3. +7 −2 android/TODO
  4. +4 −0 gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp
View
2 android/GEMRB_Android.mk
@@ -48,6 +48,7 @@ LOCAL_SRC_FILES := main/gemrb/plugins/SAVImporter/SAVImporter.cpp \
main/gemrb/plugins/BAMImporter/BAMFontManager.cpp \
main/gemrb/plugins/BAMImporter/BAMFont.cpp \
main/gemrb/plugins/BAMImporter/BAMImporter.cpp \
+ main/gemrb/plugins/BAMImporter/BAMSprite2D.cpp \
main/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp \
main/gemrb/plugins/ITMImporter/ITMImporter.cpp \
main/gemrb/plugins/BMPImporter/BMPImporter.cpp \
@@ -89,6 +90,7 @@ LOCAL_SRC_FILES := main/gemrb/plugins/SAVImporter/SAVImporter.cpp \
main/gemrb/plugins/GAMImporter/GAMImporter.cpp \
main/gemrb/plugins/SDLVideo/SDL20Video.cpp \
main/gemrb/plugins/SDLVideo/SDLVideo.cpp \
+ main/gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp \
main/gemrb/plugins/BIFImporter/BIFImporter.cpp \
main/gemrb/plugins/KEYImporter/KEYImporter.cpp \
main/gemrb/plugins/AREImporter/AREImporter.cpp \
View
18 android/GemRB.java
@@ -49,9 +49,9 @@ protected void onCreate(Bundle savedInstanceState) {
Log.d("GemRB Activity", "Checking GemRB.cfg content.");
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.");
// String[] keysToChange = { "GUIScriptsPath", "GemRBOverridePath", "GemRBUnhardcodedPath" };
@@ -76,20 +76,6 @@ protected void onCreate(Bundle savedInstanceState) {
} catch (IOException 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);
View
9 android/TODO
@@ -1,6 +1,11 @@
2013-03-10
- 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
+- 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 (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
- 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
View
4 gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp
@@ -23,7 +23,11 @@
#include "System/Logging.h"
+#ifdef ANDROID
+#include <SDL.h>
+#else
#include <SDL/SDL.h>
+#endif
namespace GemRB {

0 comments on commit 2a3a4a4

Please sign in to comment.
Something went wrong with that request. Please try again.