diff --git a/build.sh b/build.sh index d3617f9fe..6bfe7624d 100755 --- a/build.sh +++ b/build.sh @@ -15,5 +15,5 @@ if ( grep "package $AppFullName;" project/src/Globals.java > /dev/null && [ "`re touch project/src/Globals.java fi -cd project && env PATH=$NDKBUILDPATH nice -n10 ndk-build -j2 V=1 && ant debug && cd bin && adb install -r DemoActivity-debug.apk +cd project && env PATH=$NDKBUILDPATH nice -n10 ndk-build -j2 V=1 && ant `test -z "-$1" && echo release || echo debug` && cd bin && adb install -r DemoActivity-debug.apk diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index bf7e2a7e5..e5d8b4919 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -21,8 +21,8 @@ RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS DELETE" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=10501 -AppVersionName="1.0.5.01" +AppVersionCode=10502 +AppVersionName="1.0.4.02" CompiledLibraries="jpeg png freetype timidity lzma lzo2" CustomBuildScript=y AppCflags='' diff --git a/project/jni/application/openttd/readme.txt b/project/jni/application/openttd/readme.txt new file mode 100644 index 000000000..376abdbc6 --- /dev/null +++ b/project/jni/application/openttd/readme.txt @@ -0,0 +1,10 @@ +Quick compilation guide: +Download my GIT repo from https://github.com/pelya/commandergenius, +then install Android SDK 2.2, NDK r4b, and "ant" tool, then launch commands + rm project/jni/application/src + ln -s scummvm project/jni/application/src + cd project && android update project -p . +then download OpenTTD 1.0.4 into the dir project/jni/application/openttd/openttd +(or create a symlink to it if you already have downloaded it), then apply patch openttd-trunk-android.patch +and launch build.sh. That should be it. +If you want to build OpenTTD trunk you should add line "--with-lzma=sdl-config" to "configure" parameters. \ No newline at end of file diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c index 121cad11b..e15b49b41 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c @@ -100,7 +100,7 @@ static void ANDROID_UpdateRects(_THIS, int numrects, SDL_Rect *rects); /* Private display data */ -#define SDL_NUMMODES 7 +#define SDL_NUMMODES 9 static SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; //#define SDL_modelist (this->hidden->SDL_modelist) @@ -224,7 +224,7 @@ int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat) SDL_modelist[i]->x = SDL_modelist[i]->y = 0; } /* Modes sorted largest to smallest */ - SDL_modelist[0]->w = SDL_ANDROID_sWindowWidth; + SDL_modelist[0]->w = SDL_ANDROID_sWindowWidth; SDL_modelist[0]->h = SDL_ANDROID_sWindowHeight; SDL_modelist[1]->w = 800; SDL_modelist[1]->h = 600; // Will likely be shrinked SDL_modelist[2]->w = 640; SDL_modelist[2]->h = 480; // Will likely be shrinked @@ -232,7 +232,11 @@ int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat) SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240; // Always available on any screen and any orientation SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200; // Always available on any screen and any orientation SDL_modelist[6]->w = 256; SDL_modelist[6]->h = 224; // Always available on any screen and any orientation - SDL_modelist[7] = NULL; + SDL_modelist[7]->w = SDL_ANDROID_sWindowWidth * 2 / 3; + SDL_modelist[7]->h = SDL_ANDROID_sWindowHeight * 2 / 3; + SDL_modelist[8]->w = SDL_ANDROID_sWindowWidth / 2; + SDL_modelist[8]->h = SDL_ANDROID_sWindowHeight / 2; + SDL_modelist[9] = NULL; SDL_VideoInit_1_3(NULL, 0);