From 58cf9f21c50179846e7f397c25ff1eb59f7bace5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 14 Jun 2004 03:54:46 +0000 Subject: [PATCH] HandleSDLEvents is too small to be worth splitting handle hwnd changes within the renderers, since it's tied to the window --- stepmania/src/SDL_utils.cpp | 19 ------------------- stepmania/src/SDL_utils.h | 2 -- stepmania/src/StepMania.cpp | 23 +---------------------- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/stepmania/src/SDL_utils.cpp b/stepmania/src/SDL_utils.cpp index 0c2aa81c9d..86e9f434f7 100644 --- a/stepmania/src/SDL_utils.cpp +++ b/stepmania/src/SDL_utils.cpp @@ -322,25 +322,6 @@ RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf ) return ret; } -void HandleSDLEvents() -{ - /* This needs to be called before anything that handles SDL events. */ - SDL_PumpEvents(); - - // process all queued events - SDL_Event event; - while(SDL_GetEvent(event, SDL_QUITMASK)) - { - switch(event.type) - { - case SDL_QUIT: - LOG->Trace("SDL_QUIT: shutting down"); - ExitGame(); - break; - } - } -} - void SDL_UpdateHWnd() { #ifdef _WINDOWS diff --git a/stepmania/src/SDL_utils.h b/stepmania/src/SDL_utils.h index 117ae5069c..70a3113e70 100644 --- a/stepmania/src/SDL_utils.h +++ b/stepmania/src/SDL_utils.h @@ -31,8 +31,6 @@ void mySDL_WM_SetIcon( CString sIconFile ); SDL_Surface *SDLSurfaceFromRageSurface( RageSurface *surf ); RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf ); -void HandleSDLEvents(); - void SDL_UpdateHWnd(); #endif diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 7f9679293e..cf541cb8e7 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -73,6 +73,7 @@ #define ZIPS_DIR "Packages/" #ifdef _WINDOWS +/* The renderer is responsible for setting this, and updating it when it changes. */ HWND g_hWndMain = NULL; #endif @@ -82,19 +83,6 @@ char **g_argv = NULL; static bool g_bHasFocus = true; static bool g_bQuitting = false; -void UpdateHWnd() -{ -#ifdef _WINDOWS - /* Grab the window manager specific information */ - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) < 0 ) - RageException::Throw( "SDL_GetWMInfo failed" ); - - g_hWndMain = info.window; -#endif -} - static RageDisplay::VideoModeParams GetCurVideoModeParams() { return RageDisplay::VideoModeParams( @@ -173,9 +161,6 @@ void ApplyGraphicOptions() StoreActualGraphicOptions( false ); - /* Recreating the window changes the hwnd. */ - UpdateHWnd(); - /* Give the input handlers a chance to re-open devices as necessary. */ INPUTMAN->WindowReset(); } @@ -1095,12 +1080,6 @@ int main(int argc, char* argv[]) StoreActualGraphicOptions( true ); - /* Now that we've started DISPLAY, we can set up event masks. */ - mySDL_EventState(SDL_QUIT, SDL_ENABLE); - mySDL_EventState(SDL_ACTIVEEVENT, SDL_ENABLE); - - UpdateHWnd(); - SONGMAN->PreloadSongImages(); /* This initializes objects that change the SDL event mask, and has other