diff --git a/include/video.h b/include/video.h index 25199495..5fd7a8cb 100644 --- a/include/video.h +++ b/include/video.h @@ -18,7 +18,8 @@ #ifndef __VIDEO_H #define __VIDEO_H - +#include +#include typedef void (GFX_DrawHandler)(Bit8u * vidstart); /* Used to reply to the renderer what size to set */ typedef void (GFX_ResizeHandler)(Bitu * width,Bitu * height); @@ -34,8 +35,27 @@ struct GFX_Info { Bitu width,height,bpp,pitch; }; + extern GFX_Info gfx_info; +struct SDL_Block { + bool active; //If this isn't set don't draw + Bitu width; + Bitu height; + Bitu bpp; + GFX_DrawHandler * draw; + GFX_ResizeHandler * resize; + bool mouse_grabbed; + bool full_screen; + SDL_Thread * thread; + SDL_mutex * mutex; + SDL_Surface * surface; + SDL_Joystick * joy; + SDL_Color pal[256]; +}; + +extern SDL_Block sdl; + void GFX_Events(void); void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries); void GFX_SetDrawHandler(GFX_DrawHandler * handler); diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 63810e91..3bc5868e 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -32,23 +32,7 @@ //#define DISABLE_JOYSTICK -struct SDL_Block { - bool active; //If this isn't set don't draw - Bitu width; - Bitu height; - Bitu bpp; - GFX_DrawHandler * draw; - GFX_ResizeHandler * resize; - bool mouse_grabbed; - bool full_screen; - SDL_Thread * thread; - SDL_mutex * mutex; - SDL_Surface * surface; - SDL_Joystick * joy; - SDL_Color pal[256]; -}; - -static SDL_Block sdl; +SDL_Block sdl; GFX_Info gfx_info; @@ -120,6 +104,10 @@ static void SwitchFullScreen(void) { ResetScreen(); GFX_Start(); } +//only prototype existed +void GFX_SwitchFullScreen(void) { + SwitchFullScreen(); +} static void GFX_Redraw() { #if C_THREADED diff --git a/src/misc/support.cpp b/src/misc/support.cpp index 42959512..6e5f7cae 100644 --- a/src/misc/support.cpp +++ b/src/misc/support.cpp @@ -216,6 +216,10 @@ void S_Warn(char * format,...) { } void E_Exit(char * format,...) { + + if (sdl.full_screen) { + GFX_SwitchFullScreen(); + } char buf[1024]; @@ -225,7 +229,7 @@ void E_Exit(char * format,...) { va_start(msg,format); vsprintf(buf+strlen(buf),format,msg); va_end(msg); - + strcat(buf,"\n"); printf(buf); printf("Press ENTER to stop\n");