X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=vid_sdl.c;h=bad183525e54b2491d2839e115512c58b45c35ee;hb=023c4cb84d787baea342f95b951ca3366f337df4;hp=9fbe57c655f1feed7985d276087eaa9634041323;hpb=cf8dfc912d76d0a26c5d80202fb0b8089df0901f;p=xonotic%2Fdarkplaces.git diff --git a/vid_sdl.c b/vid_sdl.c index 9fbe57c6..bad18352 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1218,12 +1218,14 @@ void Sys_SendKeyEvents( void ) static qboolean sound_active = true; int keycode; int i; + qboolean isdown; Uchar unicode; SDL_Event event; VID_EnableJoystick(true); while( SDL_PollEvent( &event ) ) + loop_start: switch( event.type ) { case SDL_QUIT: #ifdef DEBUGSDLEVENTS @@ -1240,8 +1242,31 @@ void Sys_SendKeyEvents( void ) Con_DPrintf("SDL_Event: SDL_KEYUP %i\n", event.key.keysym.sym); #endif keycode = MapKey(event.key.keysym.sym); + isdown = (event.key.state == SDL_PRESSED); + unicode = 0; + if(isdown) + { + if(SDL_PollEvent(&event)) + { + if(event.type == SDL_TEXTINPUT) + { + // combine key code from SDL_KEYDOWN event and character + // from SDL_TEXTINPUT event in a single Key_Event call +#ifdef DEBUGSDLEVENTS + Con_DPrintf("SDL_Event: SDL_TEXTINPUT - text: %s\n", event.text.text); +#endif + unicode = u8_getchar_utf8_enabled(event.text.text + (int)u8_bytelen(event.text.text, 0), NULL); + } + else + { + if (!VID_JoyBlockEmulatedKeys(keycode)) + Key_Event(keycode, 0, isdown); + goto loop_start; + } + } + } if (!VID_JoyBlockEmulatedKeys(keycode)) - Key_Event(keycode, 0, (event.key.state == SDL_PRESSED)); + Key_Event(keycode, unicode, isdown); break; case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: @@ -1952,7 +1977,8 @@ void GLES_Init(void) Calling them just threw an exception. Android developer relations confirmed that they forgot to implement these. (yeah...) It's apparently been fixed in 2.2, though I haven't tested." */ - vid.support.ext_framebuffer_object = false;//true; + // LadyHavoc: Android 2.1 is way old now, enabling this again, it's going to be required soon. + vid.support.ext_framebuffer_object = true; vid.support.ext_packed_depth_stencil = false; vid.support.ext_stencil_two_side = false; @@ -2823,7 +2849,6 @@ void VID_Shutdown (void) { VID_EnableJoystick(false); VID_SetMouse(false, false, false); - VID_RestoreSystemGamma(); #if SDL_MAJOR_VERSION == 1 #ifndef WIN32 @@ -2856,24 +2881,6 @@ void VID_Shutdown (void) gl_platformextensions = ""; } -int VID_SetGamma (unsigned short *ramps, int rampsize) -{ -#if SDL_MAJOR_VERSION == 1 - return !SDL_SetGammaRamp (ramps, ramps + rampsize, ramps + rampsize*2); -#else - return !SDL_SetWindowGammaRamp (window, ramps, ramps + rampsize, ramps + rampsize*2); -#endif -} - -int VID_GetGamma (unsigned short *ramps, int rampsize) -{ -#if SDL_MAJOR_VERSION == 1 - return !SDL_GetGammaRamp (ramps, ramps + rampsize, ramps + rampsize*2); -#else - return !SDL_GetWindowGammaRamp (window, ramps, ramps + rampsize, ramps + rampsize*2); -#endif -} - void VID_Finish (void) { #if SDL_MAJOR_VERSION == 1 @@ -2887,7 +2894,7 @@ void VID_Finish (void) #endif vid_activewindow = !vid_hidden && vid_hasfocus; - VID_UpdateGamma(false, 256); + VID_UpdateGamma(); if (!vid_hidden) {