split out SetupSDL
This commit is contained in:
@@ -335,6 +335,19 @@ void SDL_UpdateHWnd()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupSDL()
|
||||||
|
{
|
||||||
|
static bool bDone = false;
|
||||||
|
if( bDone )
|
||||||
|
return;
|
||||||
|
bDone = true;
|
||||||
|
|
||||||
|
/* Start SDL (with no subsystems), to make sure we don't use SDL's error handler. */
|
||||||
|
SDL_Init( SDL_INIT_NOPARACHUTE );
|
||||||
|
|
||||||
|
/* Clean up on exit. */
|
||||||
|
atexit( SDL_Quit );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2002-2004 Glenn Maynard
|
* (c) 2002-2004 Glenn Maynard
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf );
|
|||||||
|
|
||||||
void SDL_UpdateHWnd();
|
void SDL_UpdateHWnd();
|
||||||
|
|
||||||
|
void SetupSDL();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -968,15 +968,13 @@ int main(int argc, char* argv[])
|
|||||||
PREFSMAN->ReadGlobalPrefsFromDisk();
|
PREFSMAN->ReadGlobalPrefsFromDisk();
|
||||||
ApplyLogPreferences();
|
ApplyLogPreferences();
|
||||||
|
|
||||||
atexit(SDL_Quit); /* Clean up on exit */
|
#if defined(HAVE_SDL)
|
||||||
|
SetupSDL();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This should be done after PREFSMAN is set up, so it can use Dialog::OK(). */
|
/* This should be done after PREFSMAN is set up, so it can use Dialog::OK(). */
|
||||||
Dialog::Init();
|
Dialog::Init();
|
||||||
|
|
||||||
/* Fire up the SDL, but don't actually start any subsystems.
|
|
||||||
* We use our own error handlers. */
|
|
||||||
SDL_Init( SDL_INIT_NOPARACHUTE );
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create game objects
|
// Create game objects
|
||||||
//
|
//
|
||||||
@@ -1067,8 +1065,7 @@ int main(int argc, char* argv[])
|
|||||||
SONGMAN->PreloadSongImages();
|
SONGMAN->PreloadSongImages();
|
||||||
|
|
||||||
/* This initializes objects that change the SDL event mask, and has other
|
/* This initializes objects that change the SDL event mask, and has other
|
||||||
* dependencies on the SDL video subsystem, so it must be initialized after
|
* dependencies on the SDL video subsystem, so it must be initialized after DISPLAY. */
|
||||||
* DISPLAY and setting the default SDL event mask. */
|
|
||||||
INPUTMAN = new RageInput;
|
INPUTMAN = new RageInput;
|
||||||
|
|
||||||
// These things depend on the TextureManager, so do them after!
|
// These things depend on the TextureManager, so do them after!
|
||||||
|
|||||||
Reference in New Issue
Block a user