Fixed GFX transparency in TeeWorlds

This commit is contained in:
pelya
2010-09-06 18:13:57 +03:00
parent 768f48b345
commit b5577c1dd3
5 changed files with 26 additions and 9 deletions

View File

@@ -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 :=

View File

@@ -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"

View File

@@ -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 ] );
}
}
}

View File

@@ -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()