mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: platform: move Host_Minimize_f into platform code
This commit is contained in:
@@ -14,9 +14,6 @@ GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "build.h"
|
||||
#ifdef XASH_SDL
|
||||
#include <SDL.h>
|
||||
#endif // XASH_SDL
|
||||
#include <stdarg.h> // va_args
|
||||
#if !XASH_WIN32
|
||||
#include <unistd.h> // 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;
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@ GNU General Public License for more details.
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void Platform_Minimize_f( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
/*
|
||||
========================
|
||||
Android_SwapBuffers
|
||||
|
||||
@@ -28,6 +28,11 @@ struct fb_s
|
||||
|
||||
#define DEFAULT_FBDEV "/dev/fb0"
|
||||
|
||||
void Platform_Minimize_f( void )
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
||||
/*
|
||||
========================
|
||||
Android_SwapBuffers
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user