Remove extra atexit() call.
Defer SDL_VIDEO_INIT as long as possible; remove extra call. Make sure seticon() doesn't bomb if we havn't yet initialized video.
This commit is contained in:
@@ -162,6 +162,7 @@ static void SetIcon()
|
|||||||
zoomSurface(srf, 32, 32);
|
zoomSurface(srf, 32, 32);
|
||||||
|
|
||||||
SDL_SetAlpha( srf, SDL_SRCALPHA, SDL_ALPHA_OPAQUE );
|
SDL_SetAlpha( srf, SDL_SRCALPHA, SDL_ALPHA_OPAQUE );
|
||||||
|
if(SDL_WasInit(SDL_INIT_VIDEO))
|
||||||
SDL_WM_SetIcon(srf, NULL /* derive from alpha */);
|
SDL_WM_SetIcon(srf, NULL /* derive from alpha */);
|
||||||
SDL_FreeSurface(srf);
|
SDL_FreeSurface(srf);
|
||||||
}
|
}
|
||||||
@@ -248,23 +249,20 @@ int main(int argc, char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
SDL_Init(SDL_flags);
|
SDL_Init(SDL_flags);
|
||||||
|
|
||||||
atexit(SDL_Quit);
|
|
||||||
|
|
||||||
CString g_sErrorString = "";
|
CString g_sErrorString = "";
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
try{
|
try{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize the SDL library. */
|
|
||||||
if( SDL_InitSubSystem(SDL_INIT_VIDEO) < 0 )
|
|
||||||
RageException::Throw( "Couldn't initialize SDL: %s", SDL_GetError() );
|
|
||||||
|
|
||||||
SetIcon();
|
|
||||||
|
|
||||||
LoadingWindow *loading_window = MakeLoadingWindow();
|
LoadingWindow *loading_window = MakeLoadingWindow();
|
||||||
/* This might be using SDL, so reset the caption. */
|
|
||||||
|
/* We might be using SDL, so set generic window properties (icon and caption).
|
||||||
|
* Be careful; we might not have an SDL window at all. */
|
||||||
SDL_WM_SetCaption("StepMania", "StepMania");
|
SDL_WM_SetCaption("StepMania", "StepMania");
|
||||||
|
SetIcon();
|
||||||
|
|
||||||
loading_window->Paint();
|
loading_window->Paint();
|
||||||
|
|
||||||
// changed to use time. GetTimeSinceStart is silly because it always return 0! -Chris
|
// changed to use time. GetTimeSinceStart is silly because it always return 0! -Chris
|
||||||
|
|||||||
Reference in New Issue
Block a user