diff --git a/project/jni/Android.mk b/project/jni/Android.mk index 9cfb50c99..8df9cb632 100644 --- a/project/jni/Android.mk +++ b/project/jni/Android.mk @@ -29,7 +29,7 @@ APPLICATION_ADDITIONAL_CFLAGS := -O2 APPLICATION_ADDITIONAL_LDFLAGS := -Lbin/ndk/local/armeabi -lfreetype -SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=RETURN -DSDL_ANDROID_KEYCODE_1=RSHIFT -DSDL_ANDROID_KEYCODE_2=KP_PLUS -DSDL_ANDROID_KEYCODE_3=KP_MINUS -DSDL_ANDROID_KEYCODE_4=ESCAPE -DSDL_ANDROID_KEYCODE_5=F10 +SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=SPACE -DSDL_ANDROID_KEYCODE_1=RETURN -DSDL_ANDROID_KEYCODE_2=LEFT -DSDL_ANDROID_KEYCODE_3=RIGHT -DSDL_ANDROID_KEYCODE_4=SPACE -DSDL_ANDROID_KEYCODE_5=ESCAPE # If SDL_Mixer should link to libMAD SDL_MIXER_USE_LIBMAD := diff --git a/project/jni/application/teeworlds/AppSettings.cfg b/project/jni/application/teeworlds/AppSettings.cfg index 7c80f0e34..5ddd1d4b5 100644 --- a/project/jni/application/teeworlds/AppSettings.cfg +++ b/project/jni/application/teeworlds/AppSettings.cfg @@ -10,9 +10,9 @@ AppUsesMouse=y AppNeedsArrowKeys=y AppUsesJoystick=n AppUsesMultitouch=n -RedefinedKeys="RETURN RSHIFT KP_PLUS KP_MINUS ESCAPE F10" -AppTouchscreenKeyboardKeysAmount=2 -AppTouchscreenKeyboardKeysAmountAutoFire=1 +RedefinedKeys="SPACE RETURN LEFT RIGHT SPACE ESCAPE" +AppTouchscreenKeyboardKeysAmount=4 +AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n AppVersionCode=5201 AppVersionName="0.5.2.01" diff --git a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp index 5ae16888a..8b023d6ac 100644 --- a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp +++ b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp @@ -605,12 +605,20 @@ int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_f glBindTexture(GL_TEXTURE_2D, textures[tex].tex); #ifdef ANDROID - +/* #define CONVERT_RGBA8888_RGBA4444( pixel ) \ ( ( pixel >> 4 ) & 0xF ) | \ ( ( pixel >> 8 ) & 0xF0 ) | \ ( ( pixel >> 12 ) & 0xF00 ) | \ ( ( pixel >> 16 ) & 0xF000 ) +*/ + +#define CONVERT_ARGB8888_RGBA4444( pixel ) \ + ( ( pixel >> 28 ) & 0xF ) | \ + ( ( pixel ) & 0xF0 ) | \ + ( ( pixel >> 4 ) & 0xF00 ) | \ + ( ( pixel >> 8 ) & 0xF000 ) + #define CONVERT_RGB888_RGB565( pixel ) \ ( ( pixel >> 3 ) & 0x1F ) | \ @@ -633,7 +641,7 @@ int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_f for(y = 0; y < h; y++) for(x = 0; x < w; x++) { - ((Uint16 *)tmpdata)[ y*(Uint32)w+x ] = CONVERT_RGBA8888_RGBA4444( ((Uint32 *)texdata)[ y*w+x ] ); + ((Uint16 *)tmpdata)[ y*(Uint32)w+x ] = CONVERT_ARGB8888_RGBA4444( ((Uint32 *)texdata)[ y*w+x ] ); } } } diff --git a/project/jni/application/teeworlds/src/game/client/components/binds.cpp b/project/jni/application/teeworlds/src/game/client/components/binds.cpp index e42526565..bab3e17d0 100644 --- a/project/jni/application/teeworlds/src/game/client/components/binds.cpp +++ b/project/jni/application/teeworlds/src/game/client/components/binds.cpp @@ -109,6 +109,15 @@ void BINDS::set_defaults() bind(KEY_F3, "vote yes"); bind(KEY_F4, "vote no"); + +#ifdef ANDROID + bind(KEY_LEFT, "+left"); + bind(KEY_RIGHT, "+right"); + bind(KEY_UP, "+jump"); + bind(KEY_DOWN, "+hook"); + bind('q', "+nextweapon"); +#endif + } void BINDS::on_console_init() diff --git a/project/src/Globals.java b/project/src/Globals.java index 8e3dced8a..e38cab72f 100644 --- a/project/src/Globals.java +++ b/project/src/Globals.java @@ -8,7 +8,7 @@ class Globals { public static String ApplicationName = "TeeWorlds"; // Should be zip file - public static String DataDownloadUrl = "Game data is 5 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download"; + public static String DataDownloadUrl = "Game data is 8 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download"; // Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D public static boolean NeedDepthBuffer = false; @@ -27,9 +27,9 @@ class Globals { public static boolean AppUsesMultitouch = false; - public static int AppTouchscreenKeyboardKeysAmount = 2; + public static int AppTouchscreenKeyboardKeysAmount = 4; - public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1; + public static int AppTouchscreenKeyboardKeysAmountAutoFire = 0; // Phone-specific config // It will download app data to /sdcard/alienblaster if set to true,