diff --git a/engine/common/host.c b/engine/common/host.c index be299e7a..30eb3b00 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -14,9 +14,6 @@ GNU General Public License for more details. */ #include "build.h" -#ifdef XASH_SDL -#include -#endif // XASH_SDL #include // va_args #if !XASH_WIN32 #include // fork @@ -542,13 +539,6 @@ static void Host_MemStats_f( void ) } } -static void Host_Minimize_f( void ) -{ -#ifdef XASH_SDL - if( host.hWnd ) SDL_MinimizeWindow( host.hWnd ); -#endif -} - /* ================= Host_RegisterDecal @@ -1279,7 +1269,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa Cmd_AddRestrictedCommand( "quit", Sys_Quit_f, "quit the game" ); Cmd_AddRestrictedCommand( "exit", Sys_Quit_f, "quit the game" ); } - else Cmd_AddRestrictedCommand( "minimize", Host_Minimize_f, "minimize main window to tray" ); + else Cmd_AddRestrictedCommand( "minimize", Platform_Minimize_f, "minimize main window to tray" ); host.errorframe = 0; diff --git a/engine/platform/dos/vid_dos.c b/engine/platform/dos/vid_dos.c index 14621225..40eee4f7 100644 --- a/engine/platform/dos/vid_dos.c +++ b/engine/platform/dos/vid_dos.c @@ -27,6 +27,11 @@ GNU General Public License for more details. #include #include +void Platform_Minimize_f( void ) +{ + // stub +} + /* ======================== Android_SwapBuffers diff --git a/engine/platform/linux/vid_fbdev.c b/engine/platform/linux/vid_fbdev.c index 134f7601..ca20765a 100644 --- a/engine/platform/linux/vid_fbdev.c +++ b/engine/platform/linux/vid_fbdev.c @@ -28,6 +28,11 @@ struct fb_s #define DEFAULT_FBDEV "/dev/fb0" +void Platform_Minimize_f( void ) +{ + // stub +} + /* ======================== Android_SwapBuffers diff --git a/engine/platform/platform.h b/engine/platform/platform.h index f2a4bfd5..c5ed6019 100644 --- a/engine/platform/platform.h +++ b/engine/platform/platform.h @@ -257,7 +257,6 @@ void Platform_SetClipboardText( const char *buffer ); #if XASH_SDL == 1 #define SDL_SetWindowGrab( wnd, state ) SDL_WM_GrabInput( (state) ? SDL_GRAB_ON : SDL_GRAB_OFF ) #define SDL_GetWindowGrab( wnd ) ( SDL_WM_GrabInput( SDL_GRAB_QUERY ) != SDL_GRAB_OFF ) -#define SDL_MinimizeWindow( wnd ) SDL_WM_IconifyWindow() #define SDL_IsTextInputActive() host.textmode #endif @@ -311,6 +310,7 @@ void GL_SwapBuffers( void ); void *SW_LockBuffer( void ); void SW_UnlockBuffer( void ); qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint *r, uint *g, uint *b ); +void Platform_Minimize_f( void ); // diff --git a/engine/platform/sdl1/vid_sdl1.c b/engine/platform/sdl1/vid_sdl1.c index 8aa7473b..f785ae8d 100644 --- a/engine/platform/sdl1/vid_sdl1.c +++ b/engine/platform/sdl1/vid_sdl1.c @@ -33,6 +33,11 @@ struct SDL_Surface *win; } sw; +void Platform_Minimize_f( void ) +{ + SDL_WM_IconifyWindow(); +} + qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint *r, uint *g, uint *b ) { sw.width = width; diff --git a/engine/platform/sdl2/vid_sdl2.c b/engine/platform/sdl2/vid_sdl2.c index 31cc6262..c8deb85d 100644 --- a/engine/platform/sdl2/vid_sdl2.c +++ b/engine/platform/sdl2/vid_sdl2.c @@ -35,6 +35,12 @@ struct SDL_Surface *win; } sw; +void Platform_Minimize_f( void ) +{ + if( host.hWnd ) + SDL_MinimizeWindow( host.hWnd ); +} + qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint *r, uint *g, uint *b ) { sw.width = width;