Add HUD_MessageBox. Rename isXashFWGS to IsXashFWGS

This commit is contained in:
Alibek Omarov 2018-04-02 23:56:01 +03:00
parent 0c515e3464
commit cec6d7a1bc
4 changed files with 20 additions and 4 deletions

View File

@ -376,7 +376,22 @@ void DLLEXPORT HUD_MobilityInterface( mobile_engfuncs_t *gpMobileEngfuncs )
gMobileEngfuncs = gpMobileEngfuncs;
}
bool isXashFWGS()
bool HUD_MessageBox( const char *msg )
{
gEngfuncs.Con_Printf( msg ); // just in case
if( IsXashFWGS() )
{
gMobileEngfuncs->pfnSys_Warn( msg );
return true;
}
// TODO: Load SDL2 and call ShowSimpleMessageBox
return false;
}
bool IsXashFWGS()
{
return gMobileEngfuncs != NULL;
}

View File

@ -181,5 +181,6 @@ inline void UnpackRGB( int &r, int &g, int &b, unsigned long ulRGB )\
HSPRITE LoadSprite( const char *pszName );
bool isXashFWGS();
bool HUD_MessageBox( const char *msg );
bool IsXashFWGS();
#endif

View File

@ -235,7 +235,7 @@ int CHud::DrawHudString( int xpos, int ypos, int iMaxX, const char *szIt, int r,
int DrawUtfString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b )
{
if (isXashFWGS())
if (IsXashFWGS())
{
// xash3d: reset unicode state
gEngfuncs.pfnVGUI2DrawCharacterAdditive( 0, 0, 0, 0, 0, 0, 0 );

View File

@ -69,7 +69,7 @@ void IN_Shutdown( void )
void IN_Init( void )
{
#ifdef SUPPORT_GOLDSOURCE_INPUT
if (isXashFWGS()) {
if (IsXashFWGS()) {
gEngfuncs.Con_Printf( "FWGS Xash3D input is in use\n" );
currentInput = &fwgsInput;
} else {