本文整理汇总了C++中MsgDev函数的典型用法代码示例。如果您正苦于以下问题:C++ MsgDev函数的具体用法?C++ MsgDev怎么用?C++ MsgDev使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MsgDev函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cmd_ForwardToServer
/*
===================
Cmd_ForwardToServer
adds the current command line as a clc_stringcmd to the client message.
things like godmode, noclip, etc, are commands directed to the server,
so when they are typed in at the console, they will need to be forwarded.
===================
*/
void Cmd_ForwardToServer( void )
{
char str[MAX_CMD_BUFFER];
if( cls.demoplayback )
{
if( !Q_stricmp( Cmd_Argv( 0 ), "pause" ))
cl.refdef.paused ^= 1;
return;
}
if( cls.state != ca_connected && cls.state != ca_active )
{
MsgDev( D_INFO, "Can't \"%s\", not connected\n", Cmd_Argv( 0 ));
return; // not connected
}
BF_WriteByte( &cls.netchan.message, clc_stringcmd );
str[0] = 0;
if( Q_stricmp( Cmd_Argv( 0 ), "cmd" ))
{
Q_strcat( str, Cmd_Argv( 0 ));
Q_strcat( str, " " );
}
if( Cmd_Argc() > 1 )
Q_strcat( str, Cmd_Args( ));
else Q_strcat( str, "\n" );
BF_WriteString( &cls.netchan.message, str );
}
示例2: SCR_InstallParticlePalette
void SCR_InstallParticlePalette( void )
{
rgbdata_t *pic;
int i;
// first check 'palette.lmp' then 'palette.pal'
pic = FS_LoadImage( "gfx/palette.lmp", NULL, 0 );
if( !pic ) pic = FS_LoadImage( "gfx/palette.pal", NULL, 0 );
// NOTE: imagelib required this fakebuffer for loading internal palette
if( !pic ) pic = FS_LoadImage( "#valve.pal", ((byte *)&i), 768 );
if( pic )
{
for( i = 0; i < 256; i++ )
{
clgame.palette[i][0] = pic->palette[i*4+0];
clgame.palette[i][1] = pic->palette[i*4+1];
clgame.palette[i][2] = pic->palette[i*4+2];
}
FS_FreeImage( pic );
}
else
{
for( i = 0; i < 256; i++ )
{
clgame.palette[i][0] = i;
clgame.palette[i][1] = i;
clgame.palette[i][2] = i;
}
MsgDev( D_WARN, "CL_InstallParticlePalette: failed. Force to grayscale\n" );
}
}
示例3: CL_NextDemo
/*
==================
CL_NextDemo
Called when a demo or cinematic finishes
If the "nextdemo" cvar is set, that command will be issued
==================
*/
qboolean CL_NextDemo( void )
{
string str;
if( cls.demonum == -1 )
return false; // don't play demos
S_StopAllSounds();
if( !cls.demos[cls.demonum][0] || cls.demonum == MAX_DEMOS )
{
cls.demonum = 0;
if( !cls.demos[cls.demonum][0] )
{
MsgDev( D_INFO, "no demos listed with startdemos\n" );
cls.demonum = -1;
return false;
}
}
Q_snprintf( str, MAX_STRING, "playdemo %s\n", cls.demos[cls.demonum] );
Cbuf_InsertText( str );
cls.demonum++;
return true;
}
示例4: SV_InitPhysicsAPI
/*
===============
SV_InitPhysicsAPI
Initialize server external physics
===============
*/
qboolean SV_InitPhysicsAPI( void )
{
#ifdef _DEDICATED
return false;
#else
static PHYSICAPI pPhysIface;
pPhysIface = (PHYSICAPI)Com_GetProcAddress( svgame.hInstance, "Server_GetPhysicsInterface" );
if( pPhysIface )
{
if( pPhysIface( SV_PHYSICS_INTERFACE_VERSION, &gPhysicsAPI, &svgame.physFuncs ))
{
MsgDev( D_AICONSOLE, "SV_LoadProgs: ^2initailized extended PhysicAPI ^7ver. %i\n", SV_PHYSICS_INTERFACE_VERSION );
if( svgame.physFuncs.SV_CheckFeatures != NULL )
{
// grab common engine features (it will be shared across the network)
host.features = svgame.physFuncs.SV_CheckFeatures();
Host_PrintEngineFeatures ();
}
return true;
}
// make sure what physic functions is cleared
Q_memset( &svgame.physFuncs, 0, sizeof( svgame.physFuncs ));
return false; // just tell user about problems
}
// physic interface is missed
return true;
#endif
}
示例5: GL_SelectTexture
/*
=================
GL_SelectTexture
=================
*/
void GL_SelectTexture( GLint tmu )
{
if( !GL_Support( GL_ARB_MULTITEXTURE ))
return;
// don't allow negative texture units
if( tmu < 0 ) return;
if( tmu >= GL_MaxTextureUnits( ))
{
MsgDev( D_ERROR, "GL_SelectTexture: bad tmu state %i\n", tmu );
return;
}
if( glState.activeTMU == tmu )
return;
glState.activeTMU = tmu;
if( pglActiveTextureARB )
{
pglActiveTextureARB( tmu + GL_TEXTURE0_ARB );
if( tmu < glConfig.max_texture_coords )
pglClientActiveTextureARB( tmu + GL_TEXTURE0_ARB );
}
#ifndef __ANDROID__
else if( pglSelectTextureSGIS )
{
pglSelectTextureSGIS( tmu + GL_TEXTURE0_SGIS );
}
#endif
}
示例6: Sys_InitLog
/*
===============================================================================
SYSTEM LOG
===============================================================================
*/
void Sys_InitLog( void )
{
const char *mode;
if( host.change_game )
mode = "a";
else mode = "w";
// print log to stdout
printf( "=================================================================================\n" );
printf( "\t%s (build %i) started at %s\n", s_wcd.title, Q_buildnum(), Q_timestamp( TIME_FULL ));
printf( "=================================================================================\n" );
s_wcd.logfileno = -1;
// create log if needed
if( s_wcd.log_active )
{
s_wcd.logfile = fopen( s_wcd.log_path, mode );
if( !s_wcd.logfile ) MsgDev( D_ERROR, "Sys_InitLog: can't create log file %s\n", s_wcd.log_path );
else s_wcd.logfileno = fileno( s_wcd.logfile );
fprintf( s_wcd.logfile, "=================================================================================\n" );
fprintf( s_wcd.logfile, "\t%s (build %i) started at %s\n", s_wcd.title, Q_buildnum(), Q_timestamp( TIME_FULL ));
fprintf( s_wcd.logfile, "=================================================================================\n" );
}
}
示例7: VGUI_UploadTexture
/*
================
VGUI_UploadTexture
Upload texture into video memory
================
*/
void VGUI_UploadTexture( int id, const char *buffer, int width, int height )
{
rgbdata_t r_image;
char texName[32];
if( id <= 0 || id >= VGUI_MAX_TEXTURES )
{
MsgDev( D_ERROR, "VGUI_UploadTexture: bad texture %i. Ignored\n", id );
return;
}
Q_snprintf( texName, sizeof( texName ), "*vgui%i", id );
Q_memset( &r_image, 0, sizeof( r_image ));
r_image.width = width;
r_image.height = height;
r_image.type = PF_RGBA_32;
r_image.size = r_image.width * r_image.height * 4;
r_image.flags = IMAGE_HAS_COLOR|IMAGE_HAS_ALPHA;
r_image.buffer = (byte *)buffer;
g_textures[id] = GL_LoadTextureInternal( texName, &r_image, TF_IMAGE, false );
GL_SetTextureType( g_textures[id], TEX_VGUI );
g_iBoundTexture = id;
}
示例8: Key_EnumCmds_f
void Key_EnumCmds_f( void )
{
file_t *f;
FS_AllowDirectPaths( true );
if( FS_FileExists( "../help.txt", false ))
{
Msg( "help.txt already exist\n" );
FS_AllowDirectPaths( false );
return;
}
f = FS_Open( "../help.txt", "w", false );
if( f )
{
FS_Printf( f, "//=======================================================================\n");
FS_Printf( f, "//\t\t\tCopyright XashXT Group %s ©\n", Q_timestamp( TIME_YEAR_ONLY ));
FS_Printf( f, "//\t\thelp.txt - xash commands and console variables\n");
FS_Printf( f, "//=======================================================================\n");
FS_Printf( f, "\n\n\t\t\tconsole variables\n\n");
Cvar_LookupVars( 0, NULL, f, Cmd_WriteHelp );
FS_Printf( f, "\n\n\t\t\tconsole commands\n\n");
Cmd_LookupCmds( NULL, f, Cmd_WriteHelp );
FS_Printf( f, "\n\n");
FS_Close( f );
Msg( "help.txt created\n" );
}
else MsgDev( D_ERROR, "Couldn't write help.txt.\n");
FS_AllowDirectPaths( false );
}
示例9: CL_InitClientMove
/*
===============
CL_InitClientMove
===============
*/
void CL_InitClientMove( void )
{
int i;
Pmove_Init ();
clgame.pmove->server = false; // running at client
clgame.pmove->movevars = &clgame.movevars;
clgame.pmove->runfuncs = false;
Mod_SetupHulls( clgame.player_mins, clgame.player_maxs );
// enumerate client hulls
for( i = 0; i < MAX_MAP_HULLS; i++ )
{
if( clgame.dllFuncs.pfnGetHullBounds( i, clgame.player_mins[i], clgame.player_maxs[i] ))
MsgDev( D_NOTE, "CL: hull%i, player_mins: %g %g %g, player_maxs: %g %g %g\n", i,
clgame.player_mins[i][0], clgame.player_mins[i][1], clgame.player_mins[i][2],
clgame.player_maxs[i][0], clgame.player_maxs[i][1], clgame.player_maxs[i][2] );
}
Q_memcpy( clgame.pmove->player_mins, clgame.player_mins, sizeof( clgame.player_mins ));
Q_memcpy( clgame.pmove->player_maxs, clgame.player_maxs, sizeof( clgame.player_maxs ));
// common utilities
clgame.pmove->PM_Info_ValueForKey = Info_ValueForKey;
clgame.pmove->PM_Particle = pfnParticle;
clgame.pmove->PM_TestPlayerPosition = pfnTestPlayerPosition;
clgame.pmove->Con_NPrintf = Con_NPrintf;
clgame.pmove->Con_DPrintf = Con_DPrintf;
clgame.pmove->Con_Printf = Con_Printf;
clgame.pmove->Sys_FloatTime = Sys_DoubleTime;
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
clgame.pmove->PM_PointContents = pfnPointContents;
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
clgame.pmove->PM_TraceLine = pfnTraceLine;
clgame.pmove->RandomLong = Com_RandomLong;
clgame.pmove->RandomFloat = Com_RandomFloat;
clgame.pmove->PM_GetModelType = pfnGetModelType;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_HullForBsp = pfnHullForBsp;
clgame.pmove->PM_TraceModel = pfnTraceModel;
clgame.pmove->COM_FileSize = COM_FileSize;
clgame.pmove->COM_LoadFile = COM_LoadFile;
clgame.pmove->COM_FreeFile = COM_FreeFile;
clgame.pmove->memfgets = COM_MemFgets;
clgame.pmove->PM_PlaySound = pfnPlaySound;
clgame.pmove->PM_TraceTexture = pfnTraceTexture;
clgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;
clgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx;
clgame.pmove->PM_TestPlayerPositionEx = pfnTestPlayerPositionEx;
clgame.pmove->PM_TraceLineEx = pfnTraceLineEx;
clgame.pmove->PM_TraceSurface = pfnTraceSurface;
// initalize pmove
clgame.dllFuncs.pfnPlayerMoveInit( clgame.pmove );
}
示例10: FS_FileExtension
/*
================
FS_OpenStream
open and reading basic info from sound stream
================
*/
stream_t *FS_OpenStream( const char *filename )
{
const char *ext = FS_FileExtension( filename );
string path, loadname;
qboolean anyformat = true;
const streamfmt_t *format;
stream_t *stream;
Sound_Reset(); // clear old streaminfo
Q_strncpy( loadname, filename, sizeof( loadname ));
if( Q_stricmp( ext, "" ))
{
// we needs to compare file extension with list of supported formats
// and be sure what is real extension, not a filename with dot
for( format = sound.streamformat; format && format->formatstring; format++ )
{
if( !Q_stricmp( format->ext, ext ))
{
FS_StripExtension( loadname );
anyformat = false;
break;
}
}
}
// now try all the formats in the selected list
for( format = sound.streamformat; format && format->formatstring; format++)
{
if( anyformat || !Q_stricmp( ext, format->ext ))
{
Q_sprintf( path, format->formatstring, loadname, "", format->ext );
if(( stream = format->openfunc( path )) != NULL )
{
stream->format = format;
return stream; // done
}
}
}
if( !sound.streamformat || sound.streamformat->ext == NULL )
MsgDev( D_NOTE, "FS_OpenStream: soundlib offline\n" );
else MsgDev( D_NOTE, "FS_OpenStream: couldn't open \"%s\"\n", loadname );
return NULL;
}
示例11: Host_WriteOpenGLConfig
/*
===============
Host_WriteOpenGLConfig
save opengl variables into opengl.cfg
===============
*/
void Host_WriteOpenGLConfig( void )
{
file_t *f;
MsgDev( D_NOTE, "Host_WriteGLConfig()\n" );
f = FS_Open( "opengl.cfg", "w", false );
if( f )
{
FS_Printf( f, "//=======================================================================\n" );
FS_Printf( f, "//\t\t\tCopyright XashXT Group %s ©\n", Q_timestamp( TIME_YEAR_ONLY ));
FS_Printf( f, "//\t\t opengl.cfg - archive of opengl extension cvars\n");
FS_Printf( f, "//=======================================================================\n" );
Cmd_WriteOpenGLVariables( f );
FS_Close( f );
}
else MsgDev( D_ERROR, "can't update opengl.cfg.\n" );
}
示例12: CL_ParseStatusMessage
/*
=================
CL_ParseStatusMessage
Handle a reply from a info
=================
*/
void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg )
{
char *s;
s = BF_ReadString( msg );
MsgDev( D_NOTE, "Got info string: %s\n", s );
UI_AddServerToList( from, s );
}
示例13: CL_ReadRawNetworkData
qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
{
int msglen = 0;
ASSERT( buffer != NULL );
ASSERT( length != NULL );
*length = 0; // assume we fail
FS_Read( cls.demofile, &msglen, sizeof( int ));
if( msglen < 0 )
{
MsgDev( D_ERROR, "Demo message length < 0\n" );
CL_DemoCompleted();
return false;
}
if( msglen < 8 )
{
MsgDev( D_NOTE, "read runt demo message\n" );
}
if( msglen > NET_MAX_PAYLOAD )
{
MsgDev( D_ERROR, "Demo message %i > %i\n", msglen, NET_MAX_PAYLOAD );
CL_DemoCompleted();
return false;
}
if( msglen > 0 )
{
if( FS_Read( cls.demofile, buffer, msglen ) != msglen )
{
MsgDev( D_ERROR, "Error reading demo message data\n" );
CL_DemoCompleted();
return false;
}
}
*length = msglen;
if( cls.state != ca_active )
Cbuf_Execute();
return true;
}
示例14: Host_WriteVideoConfig
/*
===============
Host_WriteVideoConfig
save render variables into video.cfg
===============
*/
void Host_WriteVideoConfig( void )
{
file_t *f;
MsgDev( D_NOTE, "Host_WriteVideoConfig()\n" );
f = FS_Open( "video.cfg", "w", false );
if( f )
{
FS_Printf( f, "//=======================================================================\n" );
FS_Printf( f, "//\t\t\tCopyright XashXT Group %s ©\n", Q_timestamp( TIME_YEAR_ONLY ));
FS_Printf( f, "//\t\tvideo.cfg - archive of renderer variables\n");
FS_Printf( f, "//=======================================================================\n" );
Cmd_WriteRenderVariables( f );
FS_Close( f );
}
else MsgDev( D_ERROR, "can't update video.cfg.\n" );
}
示例15: SV_CheckAllEnts
/*
================
SV_CheckAllEnts
================
*/
void SV_CheckAllEnts( void )
{
edict_t *e;
int i;
if( !sv_check_errors->integer || sv.state != ss_active )
return;
// check edicts errors
for( i = svgame.globals->maxClients + 1; i < svgame.numEntities; i++ )
{
e = EDICT_NUM( i );
// DEBUG: check 'gamestate' for using by mods
if( e->v.gamestate != 0 )
{
MsgDev( D_INFO, "Entity %s[%i] uses gamestate %i\n", SV_ClassName( e ), NUM_FOR_EDICT( e ), e->v.gamestate );
}
if( e->free && e->pvPrivateData != NULL )
{
MsgDev( D_ERROR, "Freed entity %s (%i) has private data.\n", SV_ClassName( e ), i );
continue;
}
if( !SV_IsValidEdict( e ))
continue;
if( !e->v.pContainingEntity || e->v.pContainingEntity != e )
{
MsgDev( D_ERROR, "Entity %s (%i) has invalid container, fixed.\n", SV_ClassName( e ), i );
e->v.pContainingEntity = e;
continue;
}
if( !e->pvPrivateData || !Mem_IsAllocatedExt( svgame.mempool, e->pvPrivateData ))
{
MsgDev( D_ERROR, "Entity %s (%i) trashed private data.\n", SV_ClassName( e ), i );
e->pvPrivateData = NULL;
continue;
}
SV_CheckVelocity( e );
}
}