mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-25 02:05:26 +01:00
engine: fix implicit declaration, remove dead MsgDev now, fix const modifier loss in host.c
This commit is contained in:
parent
b60b3f7d18
commit
25d8a94c1c
@ -1940,7 +1940,7 @@ void CL_ParseUserMessage( sizebuf_t *msg, int svc_num )
|
||||
|
||||
if( cl_trace_messages->value )
|
||||
{
|
||||
MsgDev( D_INFO, "^3USERMSG %s SIZE %i SVC_NUM %i\n",
|
||||
Con_Reportf( "^3USERMSG %s SIZE %i SVC_NUM %i\n",
|
||||
clgame.msg[i].name, iSize, clgame.msg[i].number );
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ void Joy_AxisMotionEvent( int id, byte axis, short value )
|
||||
|
||||
if( axis >= MAX_AXES )
|
||||
{
|
||||
MsgDev( D_INFO, "Only 6 axes is supported\n" );
|
||||
Con_Reportf( "Only 6 axes is supported\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ void Joy_ButtonEvent( int id, byte button, byte down )
|
||||
int origbutton = button;
|
||||
button = ( button & 31 ) + K_AUX1;
|
||||
|
||||
MsgDev( D_INFO, "Only 32 joybuttons is supported, converting %i button ID to %s\n", origbutton, Key_KeynumToString( button ) );
|
||||
Con_Reportf( "Only 32 joybuttons is supported, converting %i button ID to %s\n", origbutton, Key_KeynumToString( button ) );
|
||||
}
|
||||
else button += K_AUX1;
|
||||
|
||||
|
@ -24,6 +24,7 @@ GNU General Public License for more details.
|
||||
#ifdef XASH_SDL
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
#include "platform/platform.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -27,6 +27,8 @@ GNU General Public License for more details.
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
||||
#include "platform/platform.h"
|
||||
|
||||
void* in_mousecursor;
|
||||
qboolean in_mouseactive; // false when not focus app
|
||||
qboolean in_mouseinitialized;
|
||||
|
@ -28,6 +28,7 @@ GNU General Public License for more details.
|
||||
#include <SDL_events.h>
|
||||
static SDL_Cursor* s_pDefaultCursor[20];
|
||||
#endif
|
||||
#include "platform/platform.h"
|
||||
|
||||
int g_textures[VGUI_MAX_TEXTURES];
|
||||
int g_textureId = 0;
|
||||
@ -246,7 +247,7 @@ void VGui_Startup( int width, int height )
|
||||
F( &vgui );
|
||||
vgui.initialized = true;
|
||||
VGUI_InitCursors();
|
||||
MsgDev( D_INFO, "vgui_support: found interal client support\n" );
|
||||
Con_Reportf( "vgui_support: found interal client support\n" );
|
||||
}
|
||||
}
|
||||
#endif // XASH_INTERNAL_GAMELIBS
|
||||
@ -282,7 +283,7 @@ void VGui_Startup( int width, int height )
|
||||
if( FS_FileExists( vguiloader, false ) )
|
||||
Con_Reportf( S_ERROR "Failed to load vgui_support library: %s", COM_GetLibraryError() );
|
||||
else
|
||||
MsgDev( D_INFO, "vgui_support: not found\n" );
|
||||
Con_Reportf( "vgui_support: not found\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -626,7 +626,7 @@ static qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loade
|
||||
search->flags |= flags;
|
||||
fs_searchpaths = search;
|
||||
|
||||
MsgDev( D_REPORT, "Adding wadfile: %s (%i files)\n", wadfile, wad->numlumps );
|
||||
Con_Reportf( "Adding wadfile: %s (%i files)\n", wadfile, wad->numlumps );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -683,7 +683,7 @@ static qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loade
|
||||
search->flags |= flags;
|
||||
fs_searchpaths = search;
|
||||
|
||||
MsgDev( D_REPORT, "Adding pakfile: %s (%i files)\n", pakfile, pak->numfiles );
|
||||
Con_Reportf( "Adding pakfile: %s (%i files)\n", pakfile, pak->numfiles );
|
||||
|
||||
// time to add in search list all the wads that contains in current pakfile (if do)
|
||||
for( i = 0; i < pak->numfiles; i++ )
|
||||
|
@ -684,7 +684,7 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
|
||||
if( daemon > 0 )
|
||||
{
|
||||
// parent
|
||||
MsgDev( D_INFO, "Child pid: %i\n", daemon );
|
||||
Con_Reportf( "Child pid: %i\n", daemon );
|
||||
exit( 0 );
|
||||
}
|
||||
else
|
||||
@ -726,10 +726,12 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
|
||||
const char *IOS_GetDocsDir();
|
||||
Q_strncpy( host.rootdir, IOS_GetDocsDir(), sizeof(host.rootdir) );
|
||||
#elif defined(XASH_SDL)
|
||||
if( !( baseDir = SDL_GetBasePath() ) )
|
||||
char *szBasePath;
|
||||
|
||||
if( !( szBasePath = SDL_GetBasePath() ) )
|
||||
Sys_Error( "couldn't determine current directory: %s", SDL_GetError() );
|
||||
Q_strncpy( host.rootdir, baseDir, sizeof( host.rootdir ) );
|
||||
SDL_free( (void*)baseDir );
|
||||
Q_strncpy( host.rootdir, szBasePath, sizeof( host.rootdir ) );
|
||||
SDL_free( szBasePath );
|
||||
#else
|
||||
if( !getcwd( host.rootdir, sizeof(host.rootdir) ) )
|
||||
{
|
||||
@ -821,7 +823,7 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
|
||||
#endif
|
||||
|
||||
if ( !host.rootdir[0] || SetCurrentDirectory( host.rootdir ) != 0)
|
||||
MsgDev( D_INFO, "%s is working directory now\n", host.rootdir );
|
||||
Con_Reportf( "%s is working directory now\n", host.rootdir );
|
||||
else
|
||||
Sys_Error( "Changing working directory to %s failed.\n", host.rootdir );
|
||||
|
||||
|
@ -806,7 +806,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
|
||||
|
||||
if( !HPAK_FindResource( &hpak_read, pResource->rgucMD5_hash, NULL ))
|
||||
{
|
||||
Con_DPrintf( S_ERROR "HPAK doesn't contain specified lump: %s\n", pResource->szFileName, read_path );
|
||||
Con_DPrintf( S_ERROR "HPAK %s doesn't contain specified lump: %s\n", read_path, pResource->szFileName );
|
||||
Mem_Free( hpak_read.entries );
|
||||
Mem_Free( hpak_save.entries );
|
||||
FS_Close( file_src );
|
||||
|
@ -54,7 +54,7 @@ qboolean NET_SendToMasters( netsrc_t sock, size_t len, const void *data )
|
||||
|
||||
if( !res )
|
||||
{
|
||||
MsgDev( D_INFO, "Can't resolve adr: %s\n", list->address );
|
||||
Con_Reportf( "Can't resolve adr: %s\n", list->address );
|
||||
list->sent = true;
|
||||
continue;
|
||||
}
|
||||
@ -181,7 +181,7 @@ static void NET_LoadMasters( void )
|
||||
|
||||
if( !afile ) // file doesn't exist yet
|
||||
{
|
||||
MsgDev( D_INFO, "Cannot load xashcomm.lst\n" );
|
||||
Con_Reportf( "Cannot load xashcomm.lst\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1564,7 +1564,7 @@ void Sequence_ParseFile( const char *fileName, qboolean isGlobal )
|
||||
if( !buffer )
|
||||
return;
|
||||
|
||||
MsgDev( D_INFO, "reading sequence file: %s\n", fileName );
|
||||
Con_Reportf( "reading sequence file: %s\n", fileName );
|
||||
|
||||
Sequence_ParseBuffer( buffer, bufSize );
|
||||
|
||||
|
@ -731,38 +731,3 @@ void Sys_Print( const char *pMsg )
|
||||
|
||||
// Rcon_Print( pMsg );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
MsgDev
|
||||
|
||||
formatted developer message
|
||||
================
|
||||
*/
|
||||
void MsgDev( int type, const char *pMsg, ... )
|
||||
{
|
||||
static char text[MAX_PRINT_MSG];
|
||||
va_list argptr;
|
||||
|
||||
if( type >= D_REPORT && host_developer.value < DEV_EXTENDED )
|
||||
return;
|
||||
|
||||
va_start( argptr, pMsg );
|
||||
Q_vsnprintf( text, sizeof( text ) - 1, pMsg, argptr );
|
||||
va_end( argptr );
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case D_WARN:
|
||||
Sys_Print( va( "^3Warning:^7 %s", text ));
|
||||
break;
|
||||
case D_ERROR:
|
||||
Sys_Print( va( "^1Error:^7 %s", text ));
|
||||
break;
|
||||
case D_INFO:
|
||||
case D_NOTE:
|
||||
case D_REPORT:
|
||||
Sys_Print( text );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ void *COM_FunctionFromName( void *hInstance, const char *pName )
|
||||
void *function;
|
||||
if( !( function = COM_GetProcAddress( hInstance, pName ) ) )
|
||||
{
|
||||
MsgDev(D_ERROR, "FunctionFromName: Can't get symbol %s: %s\n", pName, dlerror());
|
||||
Con_Reportf( S_ERROR "FunctionFromName: Can't get symbol %s: %s\n", pName, dlerror());
|
||||
}
|
||||
return function;
|
||||
}
|
||||
|
@ -137,11 +137,11 @@ static void SDLash_KeyEvent( SDL_KeyboardEvent key )
|
||||
return;
|
||||
case SDL_SCANCODE_UNKNOWN:
|
||||
{
|
||||
if( down ) MsgDev( D_INFO, "SDLash_KeyEvent: Unknown scancode\n" );
|
||||
if( down ) Con_Reportf( "SDLash_KeyEvent: Unknown scancode\n" );
|
||||
return;
|
||||
}
|
||||
default:
|
||||
if( down ) MsgDev( D_INFO, "SDLash_KeyEvent: Unknown key: %s = %i\n", SDL_GetScancodeName( keynum ), keynum );
|
||||
if( down ) Con_Reportf( "SDLash_KeyEvent: Unknown key: %s = %i\n", SDL_GetScancodeName( keynum ), keynum );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,7 @@ static void SDLash_EventFilter( SDL_Event *event )
|
||||
if( ( event->tfinger.x > 2 ) && ( event->tfinger.y > 2 ) )
|
||||
{
|
||||
scale = 2;
|
||||
MsgDev( D_INFO, "SDL reports screen coordinates, workaround enabled!\n");
|
||||
Con_Reportf( "SDL reports screen coordinates, workaround enabled!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -111,12 +111,12 @@ static int SDLash_JoyInit_Old( int numjoy )
|
||||
int num;
|
||||
int i;
|
||||
|
||||
MsgDev( D_INFO, "Joystick: SDL\n" );
|
||||
Con_Reportf( "Joystick: SDL\n" );
|
||||
|
||||
if( SDL_WasInit( SDL_INIT_JOYSTICK ) != SDL_INIT_JOYSTICK &&
|
||||
SDL_InitSubSystem( SDL_INIT_JOYSTICK ) )
|
||||
{
|
||||
MsgDev( D_INFO, "Failed to initialize SDL Joysitck: %s\n", SDL_GetError() );
|
||||
Con_Reportf( "Failed to initialize SDL Joysitck: %s\n", SDL_GetError() );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -128,27 +128,27 @@ static int SDLash_JoyInit_Old( int numjoy )
|
||||
num = SDL_NumJoysticks();
|
||||
|
||||
if( num > 0 )
|
||||
MsgDev( D_INFO, "%i joysticks found:\n", num );
|
||||
Con_Reportf( "%i joysticks found:\n", num );
|
||||
else
|
||||
{
|
||||
MsgDev( D_INFO, "No joystick found.\n" );
|
||||
Con_Reportf( "No joystick found.\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
for( i = 0; i < num; i++ )
|
||||
MsgDev( D_INFO, "%i\t: %s\n", i, SDL_JoystickNameForIndex( i ) );
|
||||
Con_Reportf( "%i\t: %s\n", i, SDL_JoystickNameForIndex( i ) );
|
||||
|
||||
MsgDev( D_INFO, "Pass +set joy_index N to command line, where N is number, to select active joystick\n" );
|
||||
Con_Reportf( "Pass +set joy_index N to command line, where N is number, to select active joystick\n" );
|
||||
|
||||
joy = SDL_JoystickOpen( numjoy );
|
||||
|
||||
if( !joy )
|
||||
{
|
||||
MsgDev( D_INFO, "Failed to select joystick: %s\n", SDL_GetError( ) );
|
||||
Con_Reportf( "Failed to select joystick: %s\n", SDL_GetError( ) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
MsgDev( D_INFO, "Selected joystick: %s\n"
|
||||
Con_Reportf( "Selected joystick: %s\n"
|
||||
"\tAxes: %i\n"
|
||||
"\tHats: %i\n"
|
||||
"\tButtons: %i\n"
|
||||
@ -173,12 +173,12 @@ static int SDLash_JoyInit_New( int numjoy )
|
||||
int temp, num;
|
||||
int i;
|
||||
|
||||
MsgDev( D_INFO, "Joystick: SDL GameController API\n" );
|
||||
Con_Reportf( "Joystick: SDL GameController API\n" );
|
||||
|
||||
if( SDL_WasInit( SDL_INIT_GAMECONTROLLER ) != SDL_INIT_GAMECONTROLLER &&
|
||||
SDL_InitSubSystem( SDL_INIT_GAMECONTROLLER ) )
|
||||
{
|
||||
MsgDev( D_INFO, "Failed to initialize SDL GameController API: %s\n", SDL_GetError() );
|
||||
Con_Reportf( "Failed to initialize SDL GameController API: %s\n", SDL_GetError() );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -200,28 +200,28 @@ static int SDLash_JoyInit_New( int numjoy )
|
||||
}
|
||||
|
||||
if( num > 0 )
|
||||
MsgDev( D_INFO, "%i joysticks found:\n", num );
|
||||
Con_Reportf( "%i joysticks found:\n", num );
|
||||
else
|
||||
{
|
||||
MsgDev( D_INFO, "No joystick found.\n" );
|
||||
Con_Reportf( "No joystick found.\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
for( i = 0; i < num; i++ )
|
||||
MsgDev( D_INFO, "%i\t: %s\n", i, SDL_GameControllerNameForIndex( i ) );
|
||||
Con_Reportf( "%i\t: %s\n", i, SDL_GameControllerNameForIndex( i ) );
|
||||
|
||||
MsgDev( D_INFO, "Pass +set joy_index N to command line, where N is number, to select active joystick\n" );
|
||||
Con_Reportf( "Pass +set joy_index N to command line, where N is number, to select active joystick\n" );
|
||||
|
||||
gamecontroller = SDL_GameControllerOpen( numjoy );
|
||||
|
||||
if( !gamecontroller )
|
||||
{
|
||||
MsgDev( D_INFO, "Failed to select joystick: %s\n", SDL_GetError( ) );
|
||||
Con_Reportf( "Failed to select joystick: %s\n", SDL_GetError( ) );
|
||||
return 0;
|
||||
}
|
||||
// was added in SDL2-2.0.6, allow build with earlier versions just in case
|
||||
#if SDL_MAJOR_VERSION > 2 || SDL_MINOR_VERSION > 0 || SDL_PATCHLEVEL >= 6
|
||||
MsgDev( D_INFO, "Selected joystick: %s (%i:%i:%i)\n",
|
||||
Con_Reportf( "Selected joystick: %s (%i:%i:%i)\n",
|
||||
SDL_GameControllerName( gamecontroller ),
|
||||
SDL_GameControllerGetVendor( gamecontroller ),
|
||||
SDL_GameControllerGetProduct( gamecontroller ),
|
||||
|
@ -445,7 +445,7 @@ qboolean GL_CreateContext( void )
|
||||
|
||||
if( ( glw_state.context = SDL_GL_CreateContext( host.hWnd ) ) == NULL)
|
||||
{
|
||||
MsgDev(D_ERROR, "GL_CreateContext: %s\n", SDL_GetError());
|
||||
Con_Reportf( S_ERROR "GL_CreateContext: %s\n", SDL_GetError());
|
||||
return GL_DeleteContext();
|
||||
}
|
||||
|
||||
@ -478,7 +478,7 @@ qboolean GL_UpdateContext( void )
|
||||
{
|
||||
if( SDL_GL_MakeCurrent( host.hWnd, glw_state.context ))
|
||||
{
|
||||
MsgDev(D_ERROR, "GL_UpdateContext: %s\n", SDL_GetError());
|
||||
Con_Reportf( S_ERROR "GL_UpdateContext: %s\n", SDL_GetError());
|
||||
return GL_DeleteContext();
|
||||
}
|
||||
|
||||
@ -502,7 +502,7 @@ qboolean VID_SetScreenResolution( int width, int height )
|
||||
if( !SDL_GetClosestDisplayMode(0, &want, &got) )
|
||||
return false;
|
||||
|
||||
MsgDev(D_NOTE, "Got closest display mode: %ix%i@%i\n", got.w, got.h, got.refresh_rate);
|
||||
Con_Reportf( "Got closest display mode: %ix%i@%i\n", got.w, got.h, got.refresh_rate);
|
||||
|
||||
if( SDL_SetWindowDisplayMode( host.hWnd, &got) == -1 )
|
||||
return false;
|
||||
@ -1099,7 +1099,7 @@ void GL_InitExtensions( void )
|
||||
glConfig.renderer_string = pglGetString( GL_RENDERER );
|
||||
glConfig.version_string = pglGetString( GL_VERSION );
|
||||
glConfig.extensions_string = pglGetString( GL_EXTENSIONS );
|
||||
MsgDev( D_INFO, "^3Video^7: %s\n", glConfig.renderer_string );
|
||||
Con_Reportf( "^3Video^7: %s\n", glConfig.renderer_string );
|
||||
|
||||
#ifdef XASH_GLES
|
||||
GL_InitExtensionsGLES();
|
||||
@ -1146,7 +1146,7 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen )
|
||||
|
||||
SDL_GetCurrentDisplayMode( 0, &displayMode );
|
||||
|
||||
MsgDev( D_INFO, "R_ChangeDisplaySettings: Setting video mode to %dx%d %s\n", width, height, fullscreen ? "fullscreen" : "windowed" );
|
||||
Con_Reportf( "R_ChangeDisplaySettings: Setting video mode to %dx%d %s\n", width, height, fullscreen ? "fullscreen" : "windowed" );
|
||||
|
||||
// check our desktop attributes
|
||||
glw_state.desktopBitsPixel = SDL_BITSPERPIXEL( displayMode.format );
|
||||
|
Loading…
Reference in New Issue
Block a user