30 Jun 2008

This commit is contained in:
g-cont 2008-06-30 00:00:00 +04:00 committed by Alibek Omarov
parent 123d64195c
commit e64f9f0c90
75 changed files with 1065 additions and 868 deletions

View File

@ -74,11 +74,11 @@ void CalcTextureReflectivity( void )
}
break;
default:
MsgWarn("Can't calculate reflectivity for %s\n", GetStringFromTable( texinfo[i].texid ));
MsgDev( D_WARN, "Can't calculate reflectivity for %s\n", GetStringFromTable( texinfo[i].texid ));
break;
}
}
else MsgWarn("Couldn't load %s\n", GetStringFromTable( texinfo[i].texid ));
else MsgDev( D_ERROR, "Couldn't load %s\n", GetStringFromTable( texinfo[i].texid ));
// try also get direct values from shader
if(si = FindShader( GetStringFromTable(texinfo[i].texid)))

View File

@ -990,7 +990,7 @@ void FindPortalSide (portal_t *p)
}
gotit:
if( !bestside ) MsgWarn("side not found for portal\n");
if( !bestside ) MsgDev( D_WARN, "side not found for portal\n");
p->sidefound = true;
p->side = bestside;

View File

@ -186,7 +186,7 @@ void ClusterMerge (int leafnum)
numvis = LeafVectorFromPortalVector(portalvector, uncompressed);
if (uncompressed[leafnum>>3] & (1<<(leafnum&7)))
MsgWarn("Leaf portals saw into leaf\n");
MsgDev( D_WARN, "Leaf portals saw into leaf\n");
uncompressed[leafnum>>3] |= (1<<(leafnum&7));
numvis++; // count the leaf itself

View File

@ -11,7 +11,6 @@
dll_info_t imglib_dll = { "imglib.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(imglib_exp_t) };
dll_info_t vprogs_dll = { "vprogs.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(vprogs_exp_t) };
bool host_debug = false;
imglib_exp_t *Image;
vprogs_exp_t *PRVM;
stdlib_api_t com;
@ -45,8 +44,6 @@ void InitPlatform ( uint funcname, int argc, char **argv )
CreateImglib = (void *)imglib_dll.main;
Image = CreateImglib( &com, NULL ); // second interface not allowed
if(FS_CheckParm("-debug")) host_debug = true;
switch( funcname )
{
case COMP_BSPLIB:

View File

@ -422,7 +422,7 @@ syntax: "blabla"
*/
void Cmd_MovieUnknown( void )
{
MsgWarn("Cmd_MovieUnknown: bad command %s\n", com_token);
MsgDev( D_WARN, "Cmd_MovieUnknown: bad command %s\n", com_token);
while(Com_TryToken());
}
@ -495,7 +495,7 @@ void ROQ_ProcessFrame( int num )
if(!ROQ_CompressRGB(comp, roqFile, ROQ_MakeUprightRGB( frames->filenames[num], frame )))
{
MsgWarn("ROQ_CompressRGB: frame encode failed\n");
MsgDev( D_ERROR, "ROQ_CompressRGB: frame encode failed\n");
return;
}
Sys_GetKeyEvents(); // update console output

View File

@ -298,7 +298,7 @@ void Cmd_Frame( void )
if((xl & 0x07)||(yl & 0x07)||(w & 0x07)||(h & 0x07))
{
// render will be resampled image, just throw warning
MsgWarn("frame dimensions not multiples of 8\n" );
MsgDev( D_WARN, "frame dimensions not multiples of 8\n" );
//return;
}
if ((w > MAX_FRAME_DIM) || (h > MAX_FRAME_DIM))
@ -387,7 +387,7 @@ syntax: "blabla"
*/
void Cmd_SpriteUnknown( void )
{
MsgWarn("Cmd_SpriteUnknown: bad command %s\n", com_token);
MsgDev( D_WARN, "Cmd_SpriteUnknown: bad command %s\n", com_token);
while(Com_TryToken());
}

View File

@ -6,6 +6,7 @@
#include "mdllib.h"
bool cdset;
bool ignore_errors;
byte *studiopool;
byte *pData;
@ -731,7 +732,7 @@ void SimplifyModel (void)
if (n != m)
{
MsgWarn("SimplifyModel: illegal parent bone replacement in model \"%s\"\n\t\"%s\" has \"%s\", previously was \"%s\"\n", model[i]->name, model[i]->node[j].name, (n != -1) ? bonetable[n].name : "ROOT", (m != -1) ? bonetable[m].name : "ROOT" );
MsgDev( D_ERROR, "SimplifyModel: illegal parent bone replacement in model \"%s\"\n\t\"%s\" has \"%s\", previously was \"%s\"\n", model[i]->name, model[i]->node[j].name, (n != -1) ? bonetable[n].name : "ROOT", (m != -1) ? bonetable[m].name : "ROOT" );
iError++;
}
}
@ -742,9 +743,9 @@ void SimplifyModel (void)
}
}
//handle errors
if (iError && !(host_debug)) Sys_Break("Unexpected errors, stop compilation\nRun with parm \"-debug\" to avoid this");
if (numbones >= MAXSTUDIOBONES) Sys_Break( "Too many bones in model: used %d, max %d\n", numbones, MAXSTUDIOBONES );
// handle errors
if( iError && !ignore_errors ) Sys_Break("Unexpected errors, compilation aborted\n");
if( numbones >= MAXSTUDIOBONES ) Sys_Break( "Too many bones in model: used %d, max %d\n", numbones, MAXSTUDIOBONES );
// rename sequence bones if needed
for (i = 0; i < numseq; i++)
@ -782,7 +783,7 @@ void SimplifyModel (void)
if (strcmp(szAnim, szNode))
{
MsgWarn("SimplifyModel: illegal parent bone replacement in sequence \"%s\"\n\t\"%s\" has \"%s\", reference has \"%s\"\n", sequence[i].name, sequence[i].panim[0]->node[j].name, szAnim, szNode );
MsgDev( D_ERROR, "SimplifyModel: illegal parent bone replacement in sequence \"%s\"\n\t\"%s\" has \"%s\", reference has \"%s\"\n", sequence[i].name, sequence[i].panim[0]->node[j].name, szAnim, szNode );
iError++;
}
sequence[i].panim[0]->bonemap[j] = k;
@ -792,7 +793,7 @@ void SimplifyModel (void)
}
//handle errors
if (iError && !(host_debug)) Sys_Break("unexpected errors, stop compilation\nRun with parm \"-debug\" to avoid this");
if( iError && !ignore_errors ) Sys_Break("unexpected errors, compilation aborted\n" );
// link bonecontrollers
for (i = 0; i < numbonecontrollers; i++)
@ -804,7 +805,7 @@ void SimplifyModel (void)
}
if (j >= numbones)
{
MsgWarn("SimplifyModel: unknown bonecontroller link '%s'\n", bonecontroller[i].name );
MsgDev( D_WARN, "SimplifyModel: unknown bonecontroller link '%s'\n", bonecontroller[i].name );
j = numbones - 1;
}
bonecontroller[i].bone = j;
@ -820,7 +821,7 @@ void SimplifyModel (void)
}
if (j >= numbones)
{
MsgWarn("SimplifyModel: unknown attachment link '%s'\n", attachment[i].bonename );
MsgDev( D_WARN, "SimplifyModel: unknown attachment link '%s'\n", attachment[i].bonename );
j = numbones - 1;
}
attachment[i].bone = j;
@ -847,7 +848,7 @@ void SimplifyModel (void)
}
if (k >= numbones)
{
MsgWarn( "SimplifyModel: cannot find bone %s for hitgroup %d\n", hitgroup[j].name, hitgroup[j].group );
MsgDev( D_WARN, "SimplifyModel: cannot find bone %s for hitgroup %d\n", hitgroup[j].name, hitgroup[j].group );
continue;
}
}
@ -936,7 +937,7 @@ void SimplifyModel (void)
}
if (k >= numbones)
{
MsgWarn("SimplifyModel: cannot find bone %s for bbox\n", hitbox[j].name );
MsgDev( D_WARN, "SimplifyModel: cannot find bone %s for bbox\n", hitbox[j].name );
continue;
}
}
@ -1371,10 +1372,10 @@ void Grab_Triangles( s_model_t *pmodel )
break;
}
}
if (strlen(texturename) < 5)//invalid name
if(com.strlen(texturename) < 5)//invalid name
{
// weird model problem, skip them
MsgWarn("Grab_Triangles: triangle with invalid texname\n");
MsgDev( D_ERROR, "Grab_Triangles: triangle with invalid texname\n" );
for(i = 0; i < 3; i++)
{
if(!Com_GetToken( true ))
@ -1454,7 +1455,7 @@ void Grab_Triangles( s_model_t *pmodel )
tcount++;
}
}
if (vmin[2] != 0.0) MsgWarn("Grab_Triangles: lowest vector at %f\n", vmin[2] );
if (vmin[2] != 0.0) MsgDev( D_NOTE, "Grab_Triangles: lowest vector at %f\n", vmin[2] );
}
void Grab_Skeleton( s_node_t *pnodes, s_bone_t *pbones )
@ -1472,7 +1473,7 @@ void Grab_Skeleton( s_node_t *pnodes, s_bone_t *pbones )
{
//check time
time += atoi(Com_GetToken( false ));
if(time > 0) MsgWarn("Grab_Skeleton: Warning! An animation file is probably used as a reference\n");
if(time > 0) MsgDev( D_WARN, "Grab_Skeleton: Warning! An animation file is probably used as a reference\n");
continue;
}
else
@ -1551,7 +1552,7 @@ void Grab_Studio ( s_model_t *pmodel )
if (Com_MatchToken( "version" ))
{
int option = atoi(Com_GetToken( false ));
if (option != 1) MsgWarn("Grab_Studio: %s bad version file\n", filename );
if (option != 1) MsgDev( D_ERROR, "Grab_Studio: %s bad version file\n", filename );
}
else if (Com_MatchToken( "nodes" ))
{
@ -1565,7 +1566,7 @@ void Grab_Studio ( s_model_t *pmodel )
{
Grab_Triangles( pmodel );
}
else MsgWarn("Grab_Studio: unknown studio command %s at line %d\n", com_token, linecount );
else MsgDev( D_WARN, "Grab_Studio: unknown studio command %s at line %d\n", com_token, linecount );
}
}
@ -1830,8 +1831,8 @@ void Option_Animation ( char *name, s_animation_t *panim )
}
else
{
MsgWarn("Option_Animation: unknown studio command : %s\n", com_token );
while(Com_TryToken());//skip other tokens at line
MsgDev( D_WARN, "Option_Animation: unknown studio command : %s\n", com_token );
while(Com_TryToken()); // skip other tokens at line
}
}
}
@ -1842,11 +1843,11 @@ int Option_Motion ( s_sequence_t *psequence )
return 0;
}
int Option_Event ( s_sequence_t *psequence )
int Option_Event( s_sequence_t *psequence )
{
if (psequence->numevents + 1 >= MAXSTUDIOEVENTS)
{
MsgWarn("Option_Event: MAXSTUDIOEVENTS limit excedeed.\n");
MsgDev( D_ERROR, "Option_Event: MAXSTUDIOEVENTS limit excedeed.\n");
return 0;
}
@ -2064,7 +2065,7 @@ static int Cmd_Sequence( void )
if (numblends == 0)
{
MsgWarn("Cmd_Sequence: \"%s\" has no animations. skipped...\n", sequence[numseq].name);
MsgDev( D_INFO, "Cmd_Sequence: \"%s\" has no animations. skipped...\n", sequence[numseq].name);
return 0;
}
for (i = 0; i < numblends; i++)
@ -2128,22 +2129,22 @@ Cmd_Controller
syntax: $controller "mouth"|<number> ("name") <type> <start> <end>
==============
*/
int Cmd_Controller (void)
int Cmd_Controller( void )
{
if (Com_GetToken (false))
{
//mouth is hardcoded at four controller
if (Com_MatchToken( "mouth" )) bonecontroller[numbonecontrollers].index = 4;
else bonecontroller[numbonecontrollers].index = atoi(com_token);
else bonecontroller[numbonecontrollers].index = com.atoi(com_token);
if (Com_GetToken(false))
{
strncpy( bonecontroller[numbonecontrollers].name, com_token, sizeof(bonecontroller[numbonecontrollers].name));
com.strncpy( bonecontroller[numbonecontrollers].name, com_token, sizeof(bonecontroller[numbonecontrollers].name));
Com_GetToken(false);
if ((bonecontroller[numbonecontrollers].type = lookupControl(com_token)) == -1)
{
MsgWarn("Cmd_Controller: unknown bonecontroller type '%s'\n", com_token );
MsgDev( D_ERROR, "Cmd_Controller: unknown bonecontroller type '%s'\n", com_token );
return 0;
}
@ -2241,7 +2242,7 @@ int Cmd_TextureGroup( void )
if (numtextures == 0)
{
MsgWarn("Cmd_TextureGroup: texturegroups must follow model loading\n");
MsgDev( D_ERROR, "Cmd_TextureGroup: texturegroups must follow model loading\n");
return 0;
}
@ -2252,7 +2253,7 @@ int Cmd_TextureGroup( void )
{
if(!Com_GetToken(true))
{
if (depth)MsgWarn("missing }\n");
if (depth)MsgDev( D_ERROR, "missing }\n");
break;
}
@ -2383,7 +2384,7 @@ void Cmd_TexRenderMode( void )
{
texture[lookup_texture(tex_name)].flags |= STUDIO_NF_BLENDED;
}
else MsgWarn("Cmd_TexRenderMode: texture '%s' have unknown render mode '%s'!\n", tex_name, com_token);
else MsgDev( D_WARN, "Cmd_TexRenderMode: texture '%s' have unknown render mode '%s'!\n", tex_name, com_token);
}
@ -2435,6 +2436,18 @@ void Cmd_CdTextureSet( void )
else Msg("Warning: $cdtexture already set\n");
}
/*
==============
Cmd_DebugBuild
syntax: $debug
==============
*/
void Cmd_DebugBuild( void )
{
ignore_errors = true;
}
void ResetModelInfo( void )
{
default_scale = 1.0;
@ -2466,7 +2479,7 @@ syntax: "blabla"
*/
void Cmd_StudioUnknown( void )
{
MsgWarn("Cmd_StudioUnknown: skip command \"%s\"\n", com_token);
MsgDev( D_WARN, "Cmd_StudioUnknown: skip command \"%s\"\n", com_token);
while(Com_TryToken());
}
@ -2480,6 +2493,7 @@ bool ParseModelScript (void)
if (Com_MatchToken("$modelname")) Cmd_Modelname ();
else if (Com_MatchToken("$cd")) Cmd_CdSet();
else if (Com_MatchToken("$debug")) Cmd_DebugBuild();
else if (Com_MatchToken("$cdtexture")) Cmd_CdTextureSet();
else if (Com_MatchToken("$scale")) Cmd_ScaleUp ();
else if (Com_MatchToken("$rotate")) Cmd_Rotate();
@ -2549,6 +2563,7 @@ void ClearModel( void )
{
cdset = false;
cdtextureset = 0;
ignore_errors = false;
numrep = gflags = numseq = nummirrored = 0;
numxnodes = numrenamedbones = totalframes = numbones = numhitboxes = 0;
@ -2560,7 +2575,7 @@ void ClearModel( void )
memset(numtexturelayers, 0, sizeof(int) * 32);
memset(numtexturereps, 0, sizeof(int) * 32);
memset(bodypart, 0, sizeof(s_bodypart_t) * MAXSTUDIOBODYPARTS);
Mem_EmptyPool( studiopool ); //free all memory
Mem_EmptyPool( studiopool ); // free all memory
}
bool CompileCurrentModel( const char *name )

View File

@ -48,7 +48,7 @@ void Profile_RatioResults( void )
Msg("Second code is %.2f%% faster\n", ratio * 100);
}
}
else MsgWarn("--- Profiler not supported ---\n");
else MsgDev( D_ERROR, "--- Profiler not supported ---\n");
}
void _Profile_Results( const char *function )
@ -63,7 +63,7 @@ void _Profile_Results( const char *function )
__g_ProfilerTotalTicks += total;
__g_ProfilerTotalMsec += msec;
}
else MsgWarn("--- Profiler not supported ---\n");
else MsgDev( D_ERROR, "--- Profiler not supported ---\n");
}
void Profile_Time( void )
@ -74,7 +74,7 @@ void Profile_Time( void )
Msg("----- total ticks: %I64d -----\n", __g_ProfilerTotalTicks);
Msg("----- total secs %f ----- \n", __g_ProfilerTotalMsec );
}
else MsgWarn("--- Profiler not supported ---\n");
else MsgDev( D_ERROR, "--- Profiler not supported ---\n");
}
/*
@ -235,7 +235,7 @@ byte *ReadBMP (char *filename, byte **palette, int *width, int *height)
//blank_frame
buf_p = (char *)blank_frame;
filesize = sizeof(blank_frame);
MsgWarn("ReadBMP: couldn't load %s, use blank image\n", filename );
MsgDev( D_WARN, "ReadBMP: couldn't load %s, use blank image\n", filename );
}
bhdr.id[0] = *buf_p++;
@ -261,28 +261,28 @@ byte *ReadBMP (char *filename, byte **palette, int *width, int *height)
if (memcmp(bhdr.id, "BM", 2))
{
MsgWarn("ReadBMP: only Windows-style BMP files supported (%s)\n", filename );
MsgDev( D_ERROR, "ReadBMP: only Windows-style BMP files supported (%s)\n", filename );
return NULL;
}
// Bogus info header check
if (bhdr.fileSize != filesize)
{
MsgWarn("ReadBMP: incorrect file size %i should be %i\n", filesize, bhdr.fileSize);
MsgDev( D_ERROR, "ReadBMP: incorrect file size %i should be %i\n", filesize, bhdr.fileSize);
return NULL;
}
// Bogus bit depth? Only 8-bit supported.
if (bhdr.bitsPerPixel != 8)
{
MsgWarn("ReadBMP: %d not a 8 bit image\n", bhdr.bitsPerPixel );
MsgDev( D_ERROR, "ReadBMP: %d not a 8 bit image\n", bhdr.bitsPerPixel );
return NULL;
}
// Bogus compression? Only non-compressed supported.
if (bhdr.compression != BI_RGB)
{
Msg("ReadBMP: it's compressed file\n");
MsgDev( D_ERROR, "ReadBMP: it's compressed file\n");
return NULL;
}

View File

@ -72,7 +72,6 @@ extern vprogs_exp_t *PRVM;
extern string gs_filename;
extern char gs_basedir[ MAX_SYSPATH ];
extern bool host_debug;
extern byte *studiopool;

View File

@ -70,19 +70,19 @@ void Wad3_AddLump( const char *name, bool compress )
if(!buffer)
{
MsgWarn("Wad3_AddLump: file %s not found\n", name );
MsgDev( D_ERROR, "Wad3_AddLump: file %s not found\n", name );
return;
}
if(type == TYPE_NONE)
{
MsgWarn("Wad3_AddLump: file %s have unsupported type\n", name );
MsgDev( D_ERROR, "Wad3_AddLump: file %s have unsupported type\n", name );
return;
}
FS_FileBase( name, lumpname );
if(strlen(lumpname) > WAD3_NAMELEN)
{
MsgWarn("Wad3_AddLump: %s have too long name, max %d symbols\n", lumpname, WAD3_NAMELEN );
MsgDev( D_ERROR, "Wad3_AddLump: %s have too long name, max %d symbols\n", lumpname, WAD3_NAMELEN );
return;
}
@ -202,7 +202,7 @@ syntax: "blabla"
*/
void Cmd_WadUnknown( void )
{
MsgWarn("Cmd_WadUnknown: skip command \"%s\"\n", com_token);
MsgDev( D_WARN, "Cmd_WadUnknown: skip command \"%s\"\n", com_token);
while(Com_TryToken());
}

View File

@ -1230,7 +1230,7 @@ bool CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemB
}
shutdown:
MsgWarn("CIN_PlayCinematic: can't loading %s\n", arg );
MsgDev( D_ERROR, "CIN_PlayCinematic: can't loading %s\n", arg );
RoQShutdown();
return false;
}

View File

@ -48,7 +48,7 @@ Con_ToggleConsole_f
*/
void Con_ToggleConsole_f (void)
{
if(!host.debug && !host.developer) return;
if(!host.developer) return;
Field_Clear( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
@ -217,8 +217,8 @@ void Con_Init (void)
Con_CheckResize();
// register our commands
con_notifytime = Cvar_Get ("con_notifytime", "3", 0);
con_speed = Cvar_Get ("con_speed", "3", 0);
con_notifytime = Cvar_Get ("con_notifytime", "3", 0, "notify time to live" );
con_speed = Cvar_Get ("con_speed", "3", 0, "console moving speed" );
Field_Clear( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
@ -530,7 +530,7 @@ Con_DrawConsole
*/
void Con_DrawConsole( void )
{
if(!host.debug && !host.developer) return;
if(!host.developer) return;
// check for console width changes from a vid mode change
Con_CheckResize ();
@ -572,7 +572,7 @@ Scroll it up or down
*/
void Con_RunConsole( void )
{
if(!host.debug && !host.developer) return;
if(!host.developer) return;
// decide on the destination height of the console
if (cls.key_dest == key_console)

View File

@ -18,76 +18,64 @@ struct cl_globalvars_s
{
int pad[28];
int pev;
int other;
int world;
string_t mapname;
vec3_t vieworg;
vec3_t viewangles;
vec3_t v_forward;
vec3_t v_right;
vec3_t v_up;
float time;
float frametime;
float player_localentnum;
float player_localnum;
float intermission;
float paused;
float spectator;
float onground;
float waterlevel;
vec3_t simvel;
vec3_t simorg;
vec3_t viewheight;
float idealpitch;
vec3_t cl_viewangles;
float health;
vec3_t crosshairangle;
vec3_t punchangle;
float maxclients;
float clientcommandframe;
float servercommandframe;
string_t mapname;
vec3_t v_forward;
vec3_t v_up;
vec3_t v_right;
float scr_width;
float scr_height;
float x_pos;
float y_pos;
float trace_allsolid;
float trace_startsolid;
float trace_fraction;
vec3_t trace_endpos;
vec3_t trace_plane_normal;
float trace_plane_dist;
float trace_hitgroup;
float trace_contents;
int trace_ent;
float trace_flags;
func_t main;
func_t ClientInit;
func_t ClientFree;
func_t ClientPreThink;
func_t ClientPostThink;
func_t UpdateView;
func_t ConsoleCommand;
vec3_t pmove_org;
vec3_t pmove_vel;
vec3_t pmove_mins;
vec3_t pmove_maxs;
int viewentity;
float playernum;
float max_entities;
float demoplayback;
float smoothing;
float screen_x;
float screen_y;
float screen_w;
float screen_h;
vec3_t blend_color;
float blend_alpha;
func_t HUD_Init;
func_t HUD_Render;
func_t HUD_ConsoleCommand;
func_t HUD_ParseMessage;
func_t HUD_Shutdown;
func_t V_CalcRefdef;
};
struct cl_entvars_s
{
float modelindex;
vec3_t absmin;
vec3_t absmax;
float entnum;
float drawmask;
func_t predraw;
float movetype;
float solid;
vec3_t origin;
vec3_t oldorigin;
vec3_t velocity;
vec3_t angles;
vec3_t avelocity;
string_t classname;
string_t model;
int chain;
float frame;
vec3_t origin;
vec3_t angles;
float sequence;
float animtime;
float framerate;
float alpha;
float body;
float skin;
float effects;
vec3_t mins;
vec3_t maxs;
vec3_t size;
float nextthink;
int chain;
string_t netname;
float flags;
float alpha;
float renderflags;
float scale;
};
@ -95,9 +83,7 @@ struct cl_entvars_s
static fields_t cl_reqfields[] =
{
{48, 1, "message"},
{49, 2, "enttype"},
{50, 2, "sv_entnum"}
{18, 2, "flags"}
};
#endif//CL_EDICT_H

View File

@ -151,7 +151,7 @@ void IN_StartupMouse (void)
{
cvar_t *cv;
cv = Cvar_Get ("in_initmouse", "1", CVAR_INIT);
cv = Cvar_Get ("in_initmouse", "1", CVAR_INIT, "allow mouse device" );
if ( !cv->value ) return;
mouseinitialized = true;
@ -683,15 +683,15 @@ CL_InitInput
void CL_InitInput (void)
{
// mouse variables
m_filter = Cvar_Get("m_filter", "0", 0);
m_mouse = Cvar_Get("mouse", "1", CVAR_ARCHIVE);
cl_sensitivity = Cvar_Get( "cl_sensitivity", "3", CVAR_ARCHIVE );
ui_sensitivity = Cvar_Get( "ui_sensitivity", "0.5", CVAR_ARCHIVE );
m_filter = Cvar_Get("m_filter", "0", 0, "enable mouse filter" );
m_mouse = Cvar_Get("mouse", "1", CVAR_ARCHIVE, "allow mouse in-game" );
cl_sensitivity = Cvar_Get( "cl_sensitivity", "3", CVAR_ARCHIVE, "mouse in-game sensitivity" );
ui_sensitivity = Cvar_Get( "ui_sensitivity", "0.5", CVAR_ARCHIVE, "mouse in-menu sensitivity" );
// centering
v_centermove = Cvar_Get ("v_centermove", "0.15", 0);
v_centerspeed = Cvar_Get ("v_centerspeed", "500", 0);
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0);
v_centermove = Cvar_Get ("v_centermove", "0.15", 0, "client center moving" );
v_centerspeed = Cvar_Get ("v_centerspeed", "500", 0, "client center speed" );
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0, "disable delta-compression for usercommnds" );
Cmd_AddCommand ("centerview", IN_CenterView, "gradually recenter view (stop looking up/down)" );
@ -789,7 +789,6 @@ void CL_SendCmd (void)
// send a userinfo update if needed
if (userinfo_modified)
{
CL_FixUpGender();
userinfo_modified = false;
MSG_WriteByte (&cls.netchan.message, clc_userinfo);
MSG_WriteString (&cls.netchan.message, Cvar_Userinfo());

View File

@ -1141,7 +1141,7 @@ void Key_Event(int key, bool down, uint time)
UI_KeyEvent( key );
break;
default:
MsgWarn("Key_Event: bad cls.key_dest\n");
MsgDev( D_ERROR, "Key_Event: bad cls.key_dest\n");
break;
}
return;

View File

@ -23,22 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "client.h"
cvar_t *freelook;
cvar_t *adr0;
cvar_t *adr1;
cvar_t *adr2;
cvar_t *adr3;
cvar_t *adr4;
cvar_t *adr5;
cvar_t *adr6;
cvar_t *adr7;
cvar_t *adr8;
cvar_t *rcon_client_password;
cvar_t *rcon_address;
cvar_t *cl_noskins;
cvar_t *cl_autoskins;
cvar_t *cl_footsteps;
cvar_t *cl_timeout;
cvar_t *cl_predict;
@ -77,8 +64,6 @@ cvar_t *skin;
cvar_t *rate;
cvar_t *fov;
cvar_t *hand;
cvar_t *gender;
cvar_t *gender_auto;
cvar_t *cl_vwep;
@ -853,7 +838,7 @@ void CL_ReadNetMessage( void )
// packet from server
if (!NET_CompareAdr (net_from, cls.netchan.remote_address))
{
MsgWarn("CL_ReadPackets: %s:sequenced packet without connection\n",NET_AdrToString(net_from));
MsgDev( D_WARN, "CL_ReadPackets: %s:sequenced packet without connection\n",NET_AdrToString(net_from));
continue;
}
if(!Netchan_Process(&cls.netchan, &net_message))
@ -896,38 +881,6 @@ void CL_ReadPackets (void)
//=============================================================================
/*
==============
CL_FixUpGender_f
==============
*/
void CL_FixUpGender(void)
{
char *p;
char sk[80];
if (gender_auto->value) {
if (gender->modified) {
// was set directly, don't override the user
gender->modified = false;
return;
}
strncpy(sk, skin->string, sizeof(sk) - 1);
if ((p = strchr(sk, '/')) != NULL)
*p = 0;
if (strcasecmp(sk, "male") == 0 || strcasecmp(sk, "cyborg") == 0)
Cvar_Set ("gender", "male");
else if (strcasecmp(sk, "female") == 0 || strcasecmp(sk, "crackhor") == 0)
Cvar_Set ("gender", "female");
else
Cvar_Set ("gender", "none");
gender->modified = false;
}
}
/*
==============
CL_Userinfo_f
@ -1214,71 +1167,56 @@ void CL_InitLocal (void)
cls.realtime = 1.0f;
CL_InitInput();
adr0 = Cvar_Get( "adr0", "", CVAR_ARCHIVE );
adr1 = Cvar_Get( "adr1", "", CVAR_ARCHIVE );
adr2 = Cvar_Get( "adr2", "", CVAR_ARCHIVE );
adr3 = Cvar_Get( "adr3", "", CVAR_ARCHIVE );
adr4 = Cvar_Get( "adr4", "", CVAR_ARCHIVE );
adr5 = Cvar_Get( "adr5", "", CVAR_ARCHIVE );
adr6 = Cvar_Get( "adr6", "", CVAR_ARCHIVE );
adr7 = Cvar_Get( "adr7", "", CVAR_ARCHIVE );
adr8 = Cvar_Get( "adr8", "", CVAR_ARCHIVE );
// register our variables
cl_add_blend = Cvar_Get ("cl_blend", "1", 0);
cl_add_lights = Cvar_Get ("cl_lights", "1", 0);
cl_add_particles = Cvar_Get ("cl_particles", "1", 0);
cl_add_entities = Cvar_Get ("cl_entities", "1", 0);
cl_gun = Cvar_Get ("cl_gun", "1", 0);
cl_footsteps = Cvar_Get ("cl_footsteps", "1", 0);
cl_noskins = Cvar_Get ("cl_noskins", "0", 0);
cl_autoskins = Cvar_Get ("cl_autoskins", "0", 0);
cl_predict = Cvar_Get ("cl_predict", "1", 0);
cl_add_blend = Cvar_Get ("cl_blend", "1", 0, "disables client blends" );
cl_add_lights = Cvar_Get ("cl_lights", "1", 0, "disables dynamic lights" );
cl_add_particles = Cvar_Get ("cl_particles", "1", 0, "disables particles engine" );
cl_add_entities = Cvar_Get ("cl_entities", "1", 0, "disables client entities" );
cl_gun = Cvar_Get ("cl_gun", "1", 0, "hide firstperson viewmodel" );
cl_footsteps = Cvar_Get ("cl_footsteps", "1", 0, "disables player footsteps" );
cl_predict = Cvar_Get ("cl_predict", "1", 0, "disables client movement prediction" );
// cl_minfps = Cvar_Get ("cl_minfps", "5", 0);
cl_maxfps = Cvar_Get ("cl_maxfps", "1000", 0);
cl_maxfps = Cvar_Get ("cl_maxfps", "1000", 0, "maximum client fps" );
cl_upspeed = Cvar_Get ("cl_upspeed", "200", 0);
cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", 0);
cl_sidespeed = Cvar_Get ("cl_sidespeed", "200", 0);
cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", 0);
cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", 0);
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", 0);
cl_upspeed = Cvar_Get ("cl_upspeed", "200", 0, "client upspeed limit" );
cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", 0, "client forward speed limit" );
cl_sidespeed = Cvar_Get ("cl_sidespeed", "200", 0, "client side-speed limit" );
cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", 0, "client yaw speed" );
cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", 0, "client pitch speed" );
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", 0, "client anglespeed" );
cl_run = Cvar_Get ("cl_run", "0", CVAR_ARCHIVE);
freelook = Cvar_Get( "freelook", "0", CVAR_ARCHIVE );
lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE);
lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE);
cl_run = Cvar_Get ("cl_run", "0", CVAR_ARCHIVE, "keep client for always run mode" );
freelook = Cvar_Get( "freelook", "1", CVAR_ARCHIVE, "enables mouse look" );
lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, "allow look spring" );
lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, "allow look strafe" );
m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE);
m_yaw = Cvar_Get ("m_yaw", "0.022", 0);
m_forward = Cvar_Get ("m_forward", "1", 0);
m_side = Cvar_Get ("m_side", "1", 0);
m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, "mouse pitch value" );
m_yaw = Cvar_Get ("m_yaw", "0.022", 0, "mouse yaw value" );
m_forward = Cvar_Get ("m_forward", "1", 0, "mouse forward speed" );
m_side = Cvar_Get ("m_side", "1", 0, "mouse side speed" );
cl_shownet = Cvar_Get ("cl_shownet", "0", 0);
cl_showmiss = Cvar_Get ("cl_showmiss", "0", 0);
cl_showclamp = Cvar_Get ("showclamp", "0", 0);
cl_timeout = Cvar_Get ("cl_timeout", "120", 0);
cl_shownet = Cvar_Get ("cl_shownet", "0", 0, "client show network packets" );
cl_showmiss = Cvar_Get ("cl_showmiss", "0", 0, "client show network errors" );
cl_showclamp = Cvar_Get ("showclamp", "0", 0, "show client clamping" );
cl_timeout = Cvar_Get ("cl_timeout", "120", 0, "connect timeout (in-seconds)" );
rcon_client_password = Cvar_Get ("rcon_password", "", 0);
rcon_address = Cvar_Get ("rcon_address", "", 0);
rcon_client_password = Cvar_Get ("rcon_password", "", 0, "remote control client password" );
rcon_address = Cvar_Get ("rcon_address", "", 0, "remote control address" );
cl_lightlevel = Cvar_Get ("r_lightlevel", "0", 0);
cl_lightlevel = Cvar_Get ("r_lightlevel", "0", 0, "no description" );
//
// userinfo
//
info_password = Cvar_Get ("password", "", CVAR_USERINFO);
info_spectator = Cvar_Get ("spectator", "0", CVAR_USERINFO);
name = Cvar_Get ("name", "unnamed", CVAR_USERINFO | CVAR_ARCHIVE);
skin = Cvar_Get ("skin", "male/grunt", CVAR_USERINFO | CVAR_ARCHIVE);
rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE); // FIXME
hand = Cvar_Get ("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
fov = Cvar_Get ("fov", "90", CVAR_USERINFO | CVAR_ARCHIVE);
gender = Cvar_Get ("gender", "male", CVAR_USERINFO | CVAR_ARCHIVE);
gender_auto = Cvar_Get ("gender_auto", "1", CVAR_ARCHIVE);
gender->modified = false; // clear this so we know when user sets it manually
cl_vwep = Cvar_Get ("cl_vwep", "1", CVAR_ARCHIVE);
cl_showfps = Cvar_Get ("cl_showfps", "1", CVAR_ARCHIVE );
info_password = Cvar_Get ("password", "", CVAR_USERINFO, "player password" );
info_spectator = Cvar_Get ("spectator", "0", CVAR_USERINFO, "spectator mode" );
name = Cvar_Get ("name", "unnamed", CVAR_USERINFO | CVAR_ARCHIVE, "player name" );
skin = Cvar_Get ("skin", "male/grunt", CVAR_USERINFO | CVAR_ARCHIVE, "playerskin" );
rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE, "player network rate" ); // FIXME
hand = Cvar_Get ("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE, "viewmodel handedness" );
fov = Cvar_Get ("fov", "90", CVAR_USERINFO | CVAR_ARCHIVE, "client fov" );
cl_vwep = Cvar_Get ("cl_vwep", "1", CVAR_ARCHIVE, "no description" );
cl_showfps = Cvar_Get ("cl_showfps", "1", CVAR_ARCHIVE, "show client fps" );
// register our commands
Cmd_AddCommand ("cmd", CL_ForwardToServer_f, "send a console commandline to the server" );
@ -1362,7 +1300,7 @@ void CL_WriteConfiguration (void)
Key_WriteBindings(f);
FS_Close (f);
}
else MsgWarn("Couldn't write keys.rc.\n");
else MsgDev( D_ERROR, "Couldn't write keys.rc.\n");
f = FS_Open("scripts/config/vars.rc", "w");
if(f)
@ -1374,7 +1312,7 @@ void CL_WriteConfiguration (void)
Cmd_WriteVariables(f);
FS_Close (f);
}
else MsgWarn("Couldn't write vars.rc.\n");
else MsgDev( D_ERROR, "Couldn't write vars.rc.\n");
}
@ -1399,7 +1337,6 @@ cheatvar_t cheatvars[] = {
{"r_fullbright", "0"},
{"r_drawflat", "0"},
{"paused", "0"},
{"fixedtime", "0"},
{"sw_draworder", "0"},
{"gl_lightmap", "0"},
{"gl_saturatelighting", "0"},
@ -1423,7 +1360,7 @@ void CL_FixCvarCheats (void)
while (cheatvars[numcheatvars].name)
{
cheatvars[numcheatvars].var = Cvar_Get (cheatvars[numcheatvars].name,
cheatvars[numcheatvars].value, 0);
cheatvars[numcheatvars].value, 0, "no description" );
numcheatvars++;
}
}
@ -1538,8 +1475,8 @@ void CL_Init( void )
if (dedicated->value) return; // nothing running on the client
// all archived variables will now be loaded
scr_loading = Cvar_Get("scr_loading", "0", 0 );
cl_paused = Cvar_Get( "paused", "0", 0 );
scr_loading = Cvar_Get("scr_loading", "0", 0, "loading bar progress" );
cl_paused = Cvar_Get( "paused", "0", 0, "game paused" );
Con_Init();
VID_Init();

View File

@ -155,8 +155,8 @@ void PF_newgame( void )
Cvar_SetValue( "paused", 0 );
Cvar_SetValue( "coop", 0 );
Cbuf_AddText("loading; killserver; wait; newgame\n");
cls.key_dest = key_game;
Cbuf_AddText("loading; killserver; wait; newgame\n");
}
/*
@ -257,7 +257,7 @@ void PF_getmapslist( void )
// create new maplist if not exist
if(!Cmd_CheckMapsList())
{
MsgWarn("GetMapsList: maps.lst not found\n");
MsgDev( D_ERROR, "GetMapsList: maps.lst not found\n");
return;
}
@ -445,234 +445,6 @@ void PF_loadfromfile( void )
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
PF_precache_pic
float precache_pic( string pic )
=========
*/
void PF_precache_pic( void )
{
if(!VM_ValidateArgs( "precache_pic", 1 ))
return;
VM_ValidateString(PRVM_G_STRING(OFS_PARM0));
if(re->RegisterPic((char *)PRVM_G_STRING(OFS_PARM0)))
PRVM_G_FLOAT(OFS_RETURN) = true;
else PRVM_G_FLOAT(OFS_RETURN) = false;
}
/*
=========
PF_drawcharacter
float drawchar( vector pos, float char, vector scale, vector rgb, float alpha )
=========
*/
void PF_drawcharacter( void )
{
char character;
float *pos, *rgb, *scale, alpha;
if(!VM_ValidateArgs( "drawchar", 5 ))
return;
character = (char)PRVM_G_FLOAT(OFS_PARM1);
if( character == 0 )
{
PRVM_G_FLOAT(OFS_RETURN) = false;
VM_Warning( "PF_drawcharacter: %s passed null character!\n", PRVM_NAME );
return;
}
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
re->SetColor( GetRGBA(rgb[0], rgb[1], rgb[2], alpha ));
SCR_DrawChar( pos[0], pos[1], scale[0], scale[1], character );
re->SetColor( NULL );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
PF_drawstring
float drawstring( vector pos, string text, vector scale, vector rgb, float alpha )
=========
*/
void PF_drawstring( void )
{
float *pos, *scale, *rgb, *rgba, alpha;
const char *string;
if(!VM_ValidateArgs( "drawstring", 5 ))
return;
string = PRVM_G_STRING(OFS_PARM1);
if( !string )
{
PRVM_G_FLOAT(OFS_RETURN) = false;
VM_Warning( "PF_drawstring: %s passed null string!\n", PRVM_NAME );
return;
}
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
rgba = GetRGBA(rgb[0], rgb[1], rgb[2], alpha );
SCR_DrawStringExt( pos[0], pos[1], scale[0], scale[1], string, rgba, true );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
PF_drawpic
float drawpic( vector pos, string pic, vector size, vector rgb, float alpha )
=========
*/
void PF_drawpic( void )
{
const char *picname;
float *size, *pos, *rgb, alpha;
if(!VM_ValidateArgs( "drawpic", 5 ))
return;
picname = PRVM_G_STRING(OFS_PARM1);
if(!picname)
{
VM_Warning( "PF_drawpic: %s passed null picture name!\n", PRVM_NAME );
PRVM_G_FLOAT(OFS_RETURN) = false;
return;
}
VM_ValidateString(PRVM_G_STRING(OFS_PARM1));
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
re->SetColor( GetRGBA(rgb[0], rgb[1], rgb[2], alpha ));
SCR_DrawPic( pos[0], pos[1], size[0], size[1], (char *)picname );
re->SetColor( NULL );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
PF_drawfill
void drawfill( vector pos, vector size, vector rgb, float alpha )
=========
*/
void PF_drawfill( void )
{
float *size, *pos, *rgb, alpha;
if(!VM_ValidateArgs( "drawfill", 4 ))
return;
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM1);
rgb = PRVM_G_VECTOR(OFS_PARM2);
alpha = PRVM_G_FLOAT(OFS_PARM3);
SCR_FillRect( pos[0], pos[1], size[0], size[1], GetRGBA( rgb[0], rgb[1], rgb[2], alpha ));
}
/*
=========
PF_drawmodel
void drawmodel( vector pos, vector size, string model, vector origin, vector angles, float sequence )
=========
*/
void PF_drawmodel( void )
{
float *size, *pos, *origin, *angles;
const char *modname;
refdef_t refdef;
int sequence;
static float frame;
entity_t entity;
if(!VM_ValidateArgs( "drawmodel", 4 ))
return;
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM1);
modname = PRVM_G_STRING(OFS_PARM2);
origin = PRVM_G_VECTOR(OFS_PARM3);
angles = PRVM_G_VECTOR(OFS_PARM4);
sequence = (int)PRVM_G_FLOAT(OFS_PARM5);
VM_ValidateString(PRVM_G_STRING(OFS_PARM2));
memset( &entity, 0, sizeof( entity ));
memset( &refdef, 0, sizeof( refdef ) );
SCR_AdjustSize( &pos[0], &pos[1], &size[0], &size[1] );
refdef.x = pos[0];
refdef.y = pos[1];
refdef.width = size[0];
refdef.height = size[1];
refdef.fov_x = 50;
refdef.fov_y = V_CalcFov( refdef.fov_x, refdef.width, refdef.height );
refdef.time = cls.realtime;
entity.model = re->RegisterModel( (char *)modname );
entity.flags = RF_FULLBRIGHT;
VectorCopy( origin, entity.origin );
VectorCopy( entity.origin, entity.oldorigin );
VectorCopy( angles, entity.angles );
entity.frame = frame += 0.7f;//FXIME
entity.sequence = sequence;
entity.prev.frame = 0;
entity.backlerp = 0.0;
entity.controller[0] = 90.0;
entity.controller[1] = 90.0;
entity.controller[2] = 180.0;
entity.controller[3] = 180.0;
refdef.areabits = 0;
refdef.num_entities = 1;
refdef.entities = &entity;
refdef.lightstyles = 0;
refdef.rdflags = RDF_NOWORLDMODEL;
re->RenderFrame( &refdef );
re->EndFrame();
}
/*
=========
PF_getimagesize
vector getimagesize( string pic )
=========
*/
void PF_getimagesize( void )
{
const char *p;
int w, h;
if(!VM_ValidateArgs( "getimagesize", 1 ))
return;
VM_ValidateString(PRVM_G_STRING(OFS_PARM0));
p = PRVM_G_STRING(OFS_PARM0);
re->DrawGetPicSize( &w, &h, (char *)p);
VectorSet(PRVM_G_VECTOR(OFS_RETURN), w, h, 0 );
}
/*
=========
PF_setkeydest
@ -986,13 +758,13 @@ PF_localsound, // #106 void localsound( string sample )
PF_getmousepos, // #107 vector getmousepos( void )
PF_loadfromdata, // #108 void loadfromdata( string data )
PF_loadfromfile, // #109 float loadfromfile( string file )
PF_precache_pic, // #110 float precache_pic( string pic )
PF_drawcharacter, // #111 float drawchar( vector pos, float char, vector scale, vector rgb, float alpha )
PF_drawstring, // #112 float drawstring( vector pos, string text, vector scale, vector rgb, float alpha )
PF_drawpic, // #113 float drawpic( vector pos, string pic, vector size, vector rgb, float alpha )
PF_drawfill, // #114 void drawfill( vector pos, vector size, vector rgb, float alpha )
PF_drawmodel, // #115 void drawmodel( vector pos, vector size, string model, vector origin, vector angles, float sequence )
PF_getimagesize, // #116 vector getimagesize( string pic )
VM_precache_pic, // #110 float precache_pic( string pic )
VM_drawcharacter, // #111 float drawchar( vector pos, float char, vector scale, vector rgb, float alpha )
VM_drawstring, // #112 float drawstring( vector pos, string text, vector scale, vector rgb, float alpha )
VM_drawpic, // #113 float drawpic( vector pos, string pic, vector size, vector rgb, float alpha )
VM_drawfill, // #114 void drawfill( vector pos, vector size, vector rgb, float alpha )
VM_drawmodel, // #115 void drawmodel( vector pos, vector size, string model, vector origin, vector angles, float sequence )
VM_getimagesize, // #116 vector getimagesize( string pic )
PF_setkeydest, // #117 void setkeydest( float dest )
PF_callfunction, // #118 void callfunction( ..., string function_name )
PF_testfunction, // #119 float testfunction( string function_name )

View File

@ -377,7 +377,7 @@ void CL_LoadClientinfo (clientinfo_t *ci, char *s)
s = t+1;
}
if (cl_noskins->value || *s == 0)
if( *s == 0)
{
com.sprintf (model_filename, "models/players/gordon/player.mdl");
com.sprintf (weapon_filename, "models/weapons/w_glock.mdl");

View File

@ -6,6 +6,71 @@
#include "common.h"
#include "client.h"
#define STAT_MINUS 10 // num frame for '-' stats digit
const char *field_nums[11] =
{
"hud/num_0",
"hud/num_1",
"hud/num_2",
"hud/num_3",
"hud/num_4",
"hud/num_5",
"hud/num_6",
"hud/num_7",
"hud/num_8",
"hud/num_9",
"hud/num_-",
};
/*
================
CL_FadeColor
================
*/
float *CL_FadeColor( float starttime, float endtime )
{
static vec4_t color;
float time, fade_time;
if( starttime == 0 ) return NULL;
time = cls.realtime - starttime;
if( time >= endtime ) return NULL;
// fade time is 1/4 of endtime
fade_time = endtime / 4;
fade_time = bound( 0.3f, fade_time, 10.0f );
// fade out
if((endtime - time) < fade_time)
color[3] = (endtime - time) * 1.0f / fade_time;
else color[3] = 1.0;
color[0] = color[1] = color[2] = 1.0f;
return color;
}
void CL_DrawHUD( void )
{
PRVM_Begin;
PRVM_SetProg( PRVM_CLIENTPROG );
// set time
*prog->time = cls.realtime;
// setup pparms
prog->globals.cl->health = cl.frame.playerstate.stats[STAT_HEALTH];
prog->globals.cl->maxclients = com.atoi(cl.configstrings[CS_MAXCLIENTS]);
prog->globals.cl->time = cl.time;
prog->globals.cl->paused = cl_paused->integer;
// setup args
PRVM_G_FLOAT(OFS_PARM0) = (float)cls.state;
PRVM_ExecuteProgram (prog->globals.cl->HUD_Render, "QC function HUD_Render is missing");
PRVM_End;
}
/*
===============================================================================
Client Builtin Functions
@ -13,45 +78,6 @@ Client Builtin Functions
mathlib, debugger, and various misc helpers
===============================================================================
*/
void PF_ScreenAdjustSize( void )
{
float xscale, yscale;
// scale for screen sizes
xscale = scr_width->integer / 640.0f;
yscale = scr_height->integer / 480.0f;
prog->globals.cl->x_pos *= xscale;
prog->globals.cl->y_pos *= yscale;
prog->globals.cl->scr_width *= xscale;
prog->globals.cl->scr_height *= yscale;
}
/*
================
PF_FillRect
Coordinates are 640*480 virtual values
=================
*/
void PF_FillRect( void )
{
float *rgb, x, y, width, height;
vec4_t color;
x = PRVM_G_FLOAT(OFS_PARM0);
y = PRVM_G_FLOAT(OFS_PARM1);
width = PRVM_G_FLOAT(OFS_PARM2);
height = PRVM_G_FLOAT(OFS_PARM3);
rgb = PRVM_G_VECTOR(OFS_PARM4);
Vector4Set( color, rgb[0], rgb[1], rgb[2], 1.0f );
re->SetColor( color );
SCR_AdjustSize( &x, &y, &width, &height );
re->DrawFill( x, y, width, height );
re->SetColor( NULL );
}
void CL_BeginIncreaseEdicts( void )
{
@ -74,7 +100,7 @@ void CL_CountEdicts( void )
{
int i;
edict_t *ent;
int active = 0, models = 0, solid = 0;
int active = 0, models = 0;
for (i = 0; i < prog->num_edicts; i++ )
{
@ -82,14 +108,11 @@ void CL_CountEdicts( void )
if( ent->priv.cl->free ) continue;
active++;
if( ent->progs.cl->solid ) solid++;
if( ent->progs.cl->model ) models++;
}
Msg("num_edicts:%3i\n", prog->num_edicts);
Msg("active :%3i\n", active);
Msg("view :%3i\n", models);
Msg("touch :%3i\n", solid);
}
void CL_VM_Begin( void )
@ -127,6 +150,254 @@ void PF_ReadCoord (void){ PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord32( cls.multic
void PF_ReadString (void){ PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString( MSG_ReadString( cls.multicast) ); }
void PF_ReadEntity (void){ VM_RETURN_EDICT( PRVM_PROG_TO_EDICT( MSG_ReadShort( cls.multicast ))); } // entindex
/*
=========
PF_drawfield
void DrawField( float value, vector pos, vector size )
=========
*/
void PF_drawfield( void )
{
char num[16], *ptr;
int l, frame;
float value, *pos, *size;
if(!VM_ValidateArgs( "drawpic", 3 ))
return;
value = PRVM_G_FLOAT(OFS_PARM0);
pos = PRVM_G_VECTOR(OFS_PARM1);
size = PRVM_G_VECTOR(OFS_PARM2);
com.snprintf( num, 16, "%i", (int)value );
l = com.strlen( num );
ptr = num;
if( size[0] == 0.0f ) size[0] = GIANTCHAR_WIDTH;
if( size[1] == 0.0f ) size[1] = GIANTCHAR_HEIGHT;
while( *ptr && l )
{
if( *ptr == '-' ) frame = STAT_MINUS;
else frame = *ptr -'0';
SCR_DrawPic( pos[0], pos[1], size[0], size[1], field_nums[frame] );
pos[0] += size[0];
ptr++;
l--;
}
re->SetColor( NULL );
}
/*
=========
PF_drawnet
void DrawNet( vector pos, vector size, string image )
=========
*/
void PF_drawnet( void )
{
float *pos, *size;
const char *pic;
if(!VM_ValidateArgs( "drawnet", 3 ))
return;
if(cls.netchan.outgoing_sequence - cls.netchan.incoming_acknowledged < CMD_BACKUP-1)
return;
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM1);
pic = PRVM_G_STRING(OFS_PARM2);
VM_ValidateString( pic );
if(size[0] == 0.0f) size[0] = 48;
if(size[1] == 0.0f) size[1] = 48;
SCR_DrawPic( pos[0], pos[1], size[0], size[1], pic );
}
/*
=========
PF_drawfps
void DrawFPS( vector pos )
=========
*/
void PF_drawfps( void )
{
float calc;
static double nexttime = 0, lasttime = 0;
static double framerate = 0;
static long framecount = 0;
double newtime;
bool red = false; // fps too low
char fpsstring[32];
float *color, *pos;
if(cls.state != ca_active) return;
if(!cl_showfps->integer) return;
if(!VM_ValidateArgs( "drawfps", 1 ))
return;
newtime = Sys_DoubleTime();
if( newtime >= nexttime )
{
framerate = framecount / (newtime - lasttime);
lasttime = newtime;
nexttime = max(nexttime + 1, lasttime - 1);
framecount = 0;
}
framecount++;
calc = framerate;
pos = PRVM_G_VECTOR(OFS_PARM0);
if ((red = (calc < 1.0f)))
{
com.snprintf(fpsstring, sizeof(fpsstring), "%4i spf", (int)(1.0f / calc + 0.5));
color = g_color_table[1];
}
else
{
com.snprintf(fpsstring, sizeof(fpsstring), "%4i fps", (int)(calc + 0.5));
color = g_color_table[3];
}
SCR_DrawBigStringColor(pos[0], pos[1], fpsstring, color );
}
/*
=========
PF_drawcenterprint
void DrawCenterPrint( void )
=========
*/
void PF_drawcenterprint( void )
{
char *start;
int l, x, y, w;
float *color;
if(!cl.centerPrintTime ) return;
if(!VM_ValidateArgs( "DrawCenterPrint", 0 ))
return;
color = CL_FadeColor( cl.centerPrintTime, scr_centertime->value );
if( !color )
{
cl.centerPrintTime = 0.0f;
return;
}
re->SetColor( color );
start = cl.centerPrint;
y = cl.centerPrintY - cl.centerPrintLines * BIGCHAR_HEIGHT/2;
while( 1 )
{
char linebuffer[1024];
for ( l = 0; l < 50; l++ )
{
if ( !start[l] || start[l] == '\n' )
break;
linebuffer[l] = start[l];
}
linebuffer[l] = 0;
w = cl.centerPrintCharWidth * com.cstrlen( linebuffer );
x = ( SCREEN_WIDTH - w )>>1;
SCR_DrawStringExt( x, y, cl.centerPrintCharWidth, BIGCHAR_HEIGHT, linebuffer, color, false );
y += cl.centerPrintCharWidth * 1.5;
while ( *start && ( *start != '\n' )) start++;
if( !*start ) break;
start++;
}
re->SetColor( NULL );
}
/*
=========
PF_centerprint
void HUD_CenterPrint( string text, float y, float charwidth )
=========
*/
void PF_centerprint( void )
{
float y, width;
const char *text;
char *s;
if(!VM_ValidateArgs( "HUD_CenterPrint", 3 ))
return;
text = PRVM_G_STRING(OFS_PARM0);
y = PRVM_G_FLOAT(OFS_PARM1);
width = PRVM_G_FLOAT(OFS_PARM2);
VM_ValidateString( text );
com.strncpy( cl.centerPrint, text, sizeof(cl.centerPrint));
cl.centerPrintTime = cls.realtime;
cl.centerPrintY = y;
cl.centerPrintCharWidth = width;
// count the number of lines for centering
cl.centerPrintLines = 1;
s = cl.centerPrint;
while( *s )
{
if (*s == '\n') cl.centerPrintLines++;
s++;
}
}
/*
=========
PF_levelshot
float HUD_MakeLevelShot( void )
=========
*/
void PF_levelshot( void )
{
PRVM_G_FLOAT(OFS_RETURN) = 0;
if(!VM_ValidateArgs( "HUD_MakeLevelShot", 0 ))
return;
if( cl.make_levelshot )
{
Con_ClearNotify();
cl.make_levelshot = false;
// make levelshot at nextframe()
Cbuf_ExecuteText( EXEC_APPEND, "levelshot\n" );
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
}
/*
=========
PF_setcolor
void HUD_SetColor( vector rgb, float alpha )
=========
*/
void PF_setcolor( void )
{
float *rgb, alpha;
if(!VM_ValidateArgs( "HUD_SetColor", 2 ))
return;
rgb = PRVM_G_VECTOR(OFS_PARM0);
alpha = PRVM_G_FLOAT(OFS_PARM1);
re->SetColor( GetRGBA( rgb[0], rgb[1], rgb[2], alpha ));
}
//NOTE: intervals between various "interfaces" was leave for future expansions
prvm_builtin_t vm_cl_builtins[] =
{
@ -237,8 +508,20 @@ PF_ReadEntity, // #110 entity ReadEntity (entity s)
PF_EndRead, // #111 void MsgEnd( void )
// clientfuncs_t
PF_ScreenAdjustSize, // #112 void SCR_AdjustSize( void )
PF_FillRect, // #113 void SCR_FillRect( float x, float y, float w, float h, vector col )
VM_precache_pic, // #112 float precache_pic( string pic )
VM_drawcharacter, // #113 float DrawChar( vector pos, float char, vector scale, vector rgb, float alpha )
VM_drawstring, // #114 float DrawString( vector pos, string text, vector scale, vector rgb, float alpha )
VM_drawpic, // #115 float DrawPic( vector pos, string pic, vector size, vector rgb, float alpha )
VM_drawfill, // #116 void DrawFill( vector pos, vector size, vector rgb, float alpha )
VM_drawmodel, // #117 void DrawModel( vector pos, vector size, string mod, vector org, vector ang, float seq )
PF_drawfield, // #118 void DrawField( float value, vector pos, vector size )
VM_getimagesize, // #119 vector getimagesize( string pic )
PF_drawnet, // #120 void DrawNet( vector pos, vector size, string image )
PF_drawfps, // #121 void DrawFPS( vector pos )
PF_drawcenterprint, // #122 void DrawCenterPrint( void )
PF_centerprint, // #123 void HUD_CenterPrint( string text, float y, float charwidth )
PF_levelshot, // #124 float HUD_MakeLevelShot( void )
PF_setcolor, // #125 void HUD_SetColor( vector rgb, float alpha )
};
const int vm_cl_numbuiltins = sizeof(vm_cl_builtins) / sizeof(prvm_builtin_t); //num of builtins
@ -278,10 +561,10 @@ void CL_InitClientProgs( void )
prog->globals.cl->time = cl.time;
prog->globals.cl->pev = 0;
prog->globals.cl->mapname = PRVM_SetEngineString( cls.servername );
prog->globals.cl->player_localentnum = cl.playernum;
prog->globals.cl->playernum = cl.playernum;
// call the prog init
PRVM_ExecuteProgram( prog->globals.cl->ClientInit, "QC function ClientInit is missing");
PRVM_ExecuteProgram( prog->globals.cl->HUD_Init, "QC function HUD_Init is missing");
PRVM_End;
}
@ -291,7 +574,7 @@ void CL_FreeClientProgs( void )
prog->globals.cl->time = cl.time;
prog->globals.cl->pev = 0;
PRVM_ExecuteProgram(prog->globals.cl->ClientFree, "QC function ClientFree is missing");
PRVM_ExecuteProgram(prog->globals.cl->HUD_Shutdown, "QC function HUD_Shutdown is missing");
PRVM_ResetProg();
CL_VM_End();

View File

@ -64,7 +64,7 @@ SCR_DrawPic
Coordinates are 640*480 virtual values
================
*/
void SCR_DrawPic( float x, float y, float width, float height, char *picname )
void SCR_DrawPic( float x, float y, float width, float height, const char *picname )
{
int w, h;
@ -317,16 +317,16 @@ void SCR_UpdateScreen( void )
SCR_DrawCinematic();
break;
case ca_disconnected:
V_RenderSplash();
CL_DrawHUD();
break;
case ca_connecting:
case ca_connected:
V_RenderLogo();
CL_DrawHUD();
break;
case ca_active:
V_CalcRect();
V_RenderView();
V_RenderHUD();
CL_DrawHUD();
break;
default:
Host_Error("SCR_UpdateScreen: bad cls.state" );
@ -343,11 +343,11 @@ SCR_Init
*/
void SCR_Init (void)
{
scr_showpause = Cvar_Get("scr_showpause", "1", 0);
scr_centertime = Cvar_Get("scr_centertime", "2.5", 0);
scr_printspeed = Cvar_Get("scr_printspeed", "8", 0);
cl_levelshot_name = Cvar_Get("cl_levelshot_name", "common/black", 0 );
cl_font = Cvar_Get("cl_font", "conchars", CVAR_ARCHIVE );
scr_showpause = Cvar_Get("scr_showpause", "1", 0, "show pause picture" );
scr_centertime = Cvar_Get("scr_centertime", "2.5", 0, "centerprint hold time" );
scr_printspeed = Cvar_Get("scr_printspeed", "8", 0, "centerprint speed of print" );
cl_levelshot_name = Cvar_Get("cl_levelshot_name", "common/black", 0, "contains path to current levelshot" );
cl_font = Cvar_Get("cl_font", "conchars", CVAR_ARCHIVE, "contains path to current charset" );
// register our commands
Cmd_AddCommand( "timerefresh", SCR_TimeRefresh_f, "turn quickly and print rendering statistcs" );

View File

@ -566,12 +566,12 @@ void V_Init (void)
Cmd_AddCommand ("viewpos", V_Viewpos_f, "prints current player origin" );
crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE);
crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, "crosshair style" );
cl_testblend = Cvar_Get ("cl_testblend", "0", 0);
cl_testparticles = Cvar_Get ("cl_testparticles", "0", 0);
cl_testentities = Cvar_Get ("cl_testentities", "0", 0);
cl_testlights = Cvar_Get ("cl_testlights", "0", 0);
cl_testblend = Cvar_Get ("cl_testblend", "0", 0, "test blending" );
cl_testparticles = Cvar_Get ("cl_testparticles", "0", 0, "test particle engine" );
cl_testentities = Cvar_Get ("cl_testentities", "0", 0, "test client entities" );
cl_testlights = Cvar_Get ("cl_testlights", "0", 0, "test dynamic lights" );
cl_stats = Cvar_Get ("cl_stats", "0", 0);
cl_stats = Cvar_Get ("cl_stats", "0", 0, "enable client stats" );
}

View File

@ -335,8 +335,6 @@ extern cvar_t *cl_add_particles;
extern cvar_t *cl_add_entities;
extern cvar_t *cl_predict;
extern cvar_t *cl_footsteps;
extern cvar_t *cl_noskins;
extern cvar_t *cl_autoskins;
extern cvar_t *cl_showfps;
extern cvar_t *cl_upspeed;
extern cvar_t *cl_forwardspeed;
@ -373,6 +371,9 @@ extern cvar_t *cl_levelshot_name;
extern cvar_t *cl_vwep;
extern cvar_t *scr_centertime;
extern cvar_t *scr_showpause;
typedef struct
{
int key; // so entities can reuse same entry
@ -510,9 +511,7 @@ void CL_SetFont_f( void );
//
extern render_exp_t *re;
void CL_Init (void);
void CL_FixUpGender(void);
void CL_Init( void );
void CL_Disconnect (void);
void CL_Disconnect_f (void);
void CL_GetChallengePacket (void);
@ -571,6 +570,8 @@ void CL_Stop_f( void );
//
void CL_InitClientProgs( void );
void CL_FreeClientProgs( void );
void CL_DrawHUD( void );
//
// cl_sound.c

View File

@ -6,6 +6,7 @@
#include "common.h"
#include "basefiles.h"
#include "mathlib.h"
#include "client.h"
/*
===============================================================================
@ -617,7 +618,7 @@ void VM_CvarRegister( void )
flags |= CVAR_CHEAT;
// register new cvar
Cvar_Get( name, value, flags );
Cvar_Get( name, value, flags, va("%s variable", prog->name ));
}
/*
@ -1041,6 +1042,240 @@ void VM_FS_Puts( void )
VFS_Print( handle, s );
}
/*
=======================================================================
PICTURE & MODEL DRAWING STUFF
=======================================================================
*/
/*
=========
VM_precache_pic
float precache_pic( string pic )
=========
*/
void VM_precache_pic( void )
{
if(!VM_ValidateArgs( "precache_pic", 1 ))
return;
VM_ValidateString(PRVM_G_STRING(OFS_PARM0));
if(re->RegisterPic((char *)PRVM_G_STRING(OFS_PARM0)))
PRVM_G_FLOAT(OFS_RETURN) = true;
else PRVM_G_FLOAT(OFS_RETURN) = false;
}
/*
=========
VM_drawcharacter
float drawchar( vector pos, float char, vector scale, vector rgb, float alpha )
=========
*/
void VM_drawcharacter( void )
{
char character;
float *pos, *rgb, *scale, alpha;
if(!VM_ValidateArgs( "drawchar", 5 ))
return;
character = (char)PRVM_G_FLOAT(OFS_PARM1);
if( character == 0 )
{
PRVM_G_FLOAT(OFS_RETURN) = false;
VM_Warning( "PF_drawcharacter: %s passed null character!\n", PRVM_NAME );
return;
}
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
re->SetColor( GetRGBA(rgb[0], rgb[1], rgb[2], alpha ));
SCR_DrawChar( pos[0], pos[1], scale[0], scale[1], character );
re->SetColor( NULL );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
VM_drawstring
float drawstring( vector pos, string text, vector scale, vector rgb, float alpha )
=========
*/
void VM_drawstring( void )
{
float *pos, *scale, *rgb, *rgba, alpha;
const char *string;
if(!VM_ValidateArgs( "drawstring", 5 ))
return;
string = PRVM_G_STRING(OFS_PARM1);
if( !string )
{
PRVM_G_FLOAT(OFS_RETURN) = false;
VM_Warning( "PF_drawstring: %s passed null string!\n", PRVM_NAME );
return;
}
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
rgba = GetRGBA(rgb[0], rgb[1], rgb[2], alpha );
SCR_DrawStringExt( pos[0], pos[1], scale[0], scale[1], string, rgba, true );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
VM_drawpic
float drawpic( vector pos, string pic, vector size, vector rgb, float alpha )
=========
*/
void VM_drawpic( void )
{
const char *picname;
float *size, *pos, *rgb, alpha;
if(!VM_ValidateArgs( "drawpic", 5 ))
return;
picname = PRVM_G_STRING(OFS_PARM1);
if(!picname)
{
VM_Warning( "PF_drawpic: %s passed null picture name!\n", PRVM_NAME );
PRVM_G_FLOAT(OFS_RETURN) = false;
return;
}
VM_ValidateString(PRVM_G_STRING(OFS_PARM1));
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
re->SetColor( GetRGBA(rgb[0], rgb[1], rgb[2], alpha ));
SCR_DrawPic( pos[0], pos[1], size[0], size[1], (char *)picname );
re->SetColor( NULL );
PRVM_G_FLOAT(OFS_RETURN) = true;
}
/*
=========
VM_drawfill
void drawfill( vector pos, vector size, vector rgb, float alpha )
=========
*/
void VM_drawfill( void )
{
float *size, *pos, *rgb, alpha;
if(!VM_ValidateArgs( "drawfill", 4 ))
return;
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM1);
rgb = PRVM_G_VECTOR(OFS_PARM2);
alpha = PRVM_G_FLOAT(OFS_PARM3);
SCR_FillRect( pos[0], pos[1], size[0], size[1], GetRGBA( rgb[0], rgb[1], rgb[2], alpha ));
}
/*
=========
VM_drawmodel
void drawmodel( vector pos, vector size, string model, vector origin, vector angles, float sequence )
=========
*/
void VM_drawmodel( void )
{
float *size, *pos, *origin, *angles;
const char *modname;
refdef_t refdef;
int sequence;
static float frame;
entity_t entity;
if(!VM_ValidateArgs( "drawmodel", 4 ))
return;
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM1);
modname = PRVM_G_STRING(OFS_PARM2);
origin = PRVM_G_VECTOR(OFS_PARM3);
angles = PRVM_G_VECTOR(OFS_PARM4);
sequence = (int)PRVM_G_FLOAT(OFS_PARM5);
VM_ValidateString(PRVM_G_STRING(OFS_PARM2));
memset( &entity, 0, sizeof( entity ));
memset( &refdef, 0, sizeof( refdef ) );
SCR_AdjustSize( &pos[0], &pos[1], &size[0], &size[1] );
refdef.x = pos[0];
refdef.y = pos[1];
refdef.width = size[0];
refdef.height = size[1];
refdef.fov_x = 50;
refdef.fov_y = V_CalcFov( refdef.fov_x, refdef.width, refdef.height );
refdef.time = cls.realtime;
entity.model = re->RegisterModel( (char *)modname );
entity.flags = RF_FULLBRIGHT;
VectorCopy( origin, entity.origin );
VectorCopy( entity.origin, entity.oldorigin );
VectorCopy( angles, entity.angles );
entity.frame = frame += 0.7f;//FXIME
entity.sequence = sequence;
entity.prev.frame = 0;
entity.backlerp = 0.0;
entity.controller[0] = 90.0;
entity.controller[1] = 90.0;
entity.controller[2] = 180.0;
entity.controller[3] = 180.0;
refdef.areabits = 0;
refdef.num_entities = 1;
refdef.entities = &entity;
refdef.lightstyles = 0;
refdef.rdflags = RDF_NOWORLDMODEL;
re->RenderFrame( &refdef );
re->EndFrame();
}
/*
=========
VM_getimagesize
vector getimagesize( string pic )
=========
*/
void VM_getimagesize( void )
{
const char *p;
int w, h;
if(!VM_ValidateArgs( "getimagesize", 1 ))
return;
VM_ValidateString(PRVM_G_STRING(OFS_PARM0));
p = PRVM_G_STRING(OFS_PARM0);
re->DrawGetPicSize( &w, &h, (char *)p);
VectorSet(PRVM_G_VECTOR(OFS_RETURN), w, h, 0 );
}
/*
=======================================================================
@ -2115,14 +2350,15 @@ with the archive flag set to true.
============
*/
static void Cmd_WriteCvar(const char *name, const char *string, const char *unused, void *f)
static void Cmd_WriteCvar(const char *name, const char *string, const char *desc, void *f )
{
//if(!desc) return; // ignore fantom cvars
FS_Printf(f, "seta %s \"%s\"\n", name, string );
}
void Cmd_WriteVariables( file_t *f )
{
FS_Printf (f, "unsetall\n" );
FS_Printf( f, "unsetall\n" );
Cvar_LookupVars( CVAR_ARCHIVE, NULL, f, Cmd_WriteCvar );
}

View File

@ -172,9 +172,7 @@ typedef struct host_parm_s
HWND hWnd; // main window
bool debug; // show all warnings mode
int developer; // show all developer's message
bool paused; // freeze server
bool stuffcmdsrun; // sturtup script
} host_parm_t;
@ -333,6 +331,13 @@ void VM_FS_Open( void );
void VM_FS_Close( void );
void VM_FS_Gets( void );
void VM_FS_Puts( void );
void VM_precache_pic( void );
void VM_drawcharacter( void );
void VM_drawstring( void );
void VM_drawpic( void );
void VM_drawfill( void );
void VM_drawmodel( void );
void VM_getimagesize( void );
void VM_min( void );
void VM_max( void );
void VM_bound( void );

View File

@ -25,7 +25,6 @@ dll_info_t vprogs_dll = { "vprogs.dll", NULL, "CreateAPI", NULL, NULL, true, siz
dll_info_t vsound_dll = { "vsound.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(vsound_exp_t) };
cvar_t *timescale;
cvar_t *fixedtime;
cvar_t *dedicated;
cvar_t *host_serverstate;
cvar_t *host_frametime;
@ -95,10 +94,9 @@ void Host_InitCommon( uint funcname, int argc, char **argv )
// overload some funcs
newcom.error = Host_Error;
// determine debug and developer mode
if(FS_CheckParm ("-debug")) host.debug = true;
// check developer mode
if(FS_GetParmFromCmdLine("-dev", dev_level ))
host.developer = atoi(dev_level);
host.developer = com.atoi(dev_level);
// TODO: init basedir here
FS_LoadGameInfo("gameinfo.txt");
@ -293,9 +291,9 @@ VID_Init
*/
void VID_Init( void )
{
scr_width = Cvar_Get("width", "640", 0 );
scr_height = Cvar_Get("height", "480", 0 );
vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE );
scr_width = Cvar_Get("width", "640", 0, "screen width" );
scr_height = Cvar_Get("height", "480", 0, "screen height" );
vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE, "screen gamma" );
Cmd_AddCommand ("vid_restart", Host_VidRestart_f, "restarts video system" );
Cmd_AddCommand ("snd_restart", Host_SndRestart_f, "restarts audio system" );
@ -365,9 +363,9 @@ long Host_WndProc( void *hWnd, uint uMsg, uint wParam, long lParam )
break;
case WM_CREATE:
host.hWnd = hWnd;
r_xpos = Cvar_Get("r_xpos", "3", CVAR_ARCHIVE );
r_ypos = Cvar_Get("r_ypos", "22", CVAR_ARCHIVE );
r_fullscreen = Cvar_Get("fullscreen", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_xpos = Cvar_Get("r_xpos", "3", CVAR_ARCHIVE, "window position by horizontal" );
r_ypos = Cvar_Get("r_ypos", "22", CVAR_ARCHIVE, "window position by vertical" );
r_fullscreen = Cvar_Get("fullscreen", "0", CVAR_ARCHIVE | CVAR_LATCH, "set in 1 to enable fullscreen mode" );
break;
case WM_DESTROY:
host.hWnd = NULL;
@ -564,21 +562,20 @@ void Host_Init (uint funcname, int argc, char **argv)
// init commands and vars
if(host.developer)
{
host_cheats = Cvar_Get("host_cheats", "1", CVAR_SYSTEMINFO );
host_cheats = Cvar_Get("host_cheats", "1", CVAR_SYSTEMINFO, "allow cheat variables to enable" );
Cmd_AddCommand ("error", Host_Error_f, "just throw a fatal error to test shutdown procedures" );
Cmd_AddCommand ("crash", Host_Crash_f, "a way to force a bus error for development reasons");
}
cm_paused = Cvar_Get("cm_paused", "0", 0 );
host_frametime = Cvar_Get ("host_frametime", "0.01", 0);
host_serverstate = Cvar_Get ("host_serverstate", "0", 0);
timescale = Cvar_Get ("timescale", "1", 0);
fixedtime = Cvar_Get ("fixedtime", "0", 0);
if(host.type == HOST_DEDICATED) dedicated = Cvar_Get ("dedicated", "1", CVAR_INIT);
else dedicated = Cvar_Get ("dedicated", "0", CVAR_INIT);
cm_paused = Cvar_Get("cm_paused", "0", 0, "physics module pause" );
host_frametime = Cvar_Get ("host_frametime", "0.01", 0, "host frametime" );
host_serverstate = Cvar_Get ("host_serverstate", "0", 0, "displays current server state" );
timescale = Cvar_Get ("timescale", "1", 0, "physics world timescale" );
if(host.type == HOST_DEDICATED) dedicated = Cvar_Get ("dedicated", "1", CVAR_INIT, "currently server is in dedicated mode" );
else dedicated = Cvar_Get ("dedicated", "0", CVAR_INIT, "currently server is in shared mode" );
s = va("^1Xash %g ^3%s", GI->version, buildstring );
Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_INIT );
Cvar_Get( "version", s, CVAR_SERVERINFO|CVAR_INIT, "engine current version" );
if(dedicated->value) Cmd_AddCommand ("quit", Sys_Quit, "quit the game" );

View File

@ -96,9 +96,9 @@ void Netchan_Init (void)
// pick a port value that should be nice and random
port = RANDOM_LONG(1, 65535);
showpackets = Cvar_Get ("showpackets", "0", 0);
showdrop = Cvar_Get ("showdrop", "0", 0);
qport = Cvar_Get ("qport", va("%i", port), CVAR_INIT);
showpackets = Cvar_Get ("showpackets", "0", 0, "show network packets" );
showdrop = Cvar_Get ("showdrop", "0", 0, "show packets that are dropped" );
qport = Cvar_Get( "qport", va("%i", port), CVAR_INIT, "current netport" );
}
/*
@ -261,7 +261,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
// add the unreliable part if space is available
if (send.maxsize - send.cursize >= length)
SZ_Write (&send, data, length);
else MsgWarn("Netchan_Transmit: dumped unreliable\n");
else MsgDev( D_WARN, "Netchan_Transmit: dumped unreliable\n");
// send the datagram
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);

View File

@ -24,7 +24,7 @@ void _MSG_WriteChar (sizebuf_t *sb, int c, const char *filename, int fileline)
byte *buf;
if (c < -128 || c > 127)
MsgWarn("MSG_WriteChar: range error %d (called at %s:%i)\n", c, filename, fileline);
MsgDev( D_ERROR, "MSG_WriteChar: range error %d (called at %s:%i)\n", c, filename, fileline);
buf = _SZ_GetSpace (sb, 1, filename, fileline );
buf[0] = c;
@ -35,7 +35,7 @@ void _MSG_WriteByte (sizebuf_t *sb, int c, const char *filename, int fileline)
byte *buf;
if (c < 0 || c > 255)
MsgWarn("MSG_WriteByte: range error %d (called at %s:%i)\n", c, filename, fileline);
MsgDev( D_ERROR, "MSG_WriteByte: range error %d (called at %s:%i)\n", c, filename, fileline);
buf = _SZ_GetSpace (sb, 1, filename, fileline);
buf[0] = c;
@ -46,7 +46,7 @@ void _MSG_WriteShort (sizebuf_t *sb, int c, const char *filename, int fileline)
byte *buf;
if (c < -32767 || c > 32767)
MsgWarn("MSG_WriteShort: range error %d (called at %s:%i)\n", c, filename, fileline);
MsgDev( D_ERROR, "MSG_WriteShort: range error %d (called at %s:%i)\n", c, filename, fileline);
buf = _SZ_GetSpace (sb, 2, filename, fileline);
buf[0] = c&0xff;
@ -58,7 +58,7 @@ void _MSG_WriteWord (sizebuf_t *sb, int c, const char *filename, int fileline)
byte *buf;
if (c < 0 || c > 65535)
MsgWarn("MSG_WriteWord: range error %d (called at %s:%i)\n", c, filename, fileline);
MsgDev( D_ERROR, "MSG_WriteWord: range error %d (called at %s:%i)\n", c, filename, fileline);
buf = _SZ_GetSpace (sb, 2, filename, fileline);
buf[0] = c&0xff;
@ -315,7 +315,7 @@ void MSG_BeginReading (sizebuf_t *msg)
void MSG_EndReading (sizebuf_t *msg)
{
if(!msg->errorcount) return;
MsgWarn("MSG_EndReading: received with errors\n");
MsgDev( D_ERROR, "MSG_EndReading: received with errors\n");
}
// returns -1 if no more characters are available
@ -581,7 +581,7 @@ void *_SZ_GetSpace (sizebuf_t *buf, int length, const char *filename, int fileli
if (length > buf->maxsize)
Host_Error("SZ_GetSpace: length[%i] > buffer maxsize [%i], called at %s:%i\n", length, buf->maxsize, filename, fileline );
MsgWarn("SZ_GetSpace: overflow [cursize %d maxsize %d], called at %s:%i\n", buf->cursize + length, buf->maxsize, filename, fileline );
MsgDev( D_WARN, "SZ_GetSpace: overflow [cursize %d maxsize %d], called at %s:%i\n", buf->cursize + length, buf->maxsize, filename, fileline );
SZ_Clear (buf);
buf->overflowed = true;
}

View File

@ -412,7 +412,7 @@ bool NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
continue;
if (err == WSAEMSGSIZE)
{
MsgWarn("NET_GetPacket: Oversize packet from %s\n", NET_AdrToString(*net_from));
MsgDev( D_ERROR, "NET_GetPacket: Oversize packet from %s\n", NET_AdrToString(*net_from));
continue;
}
@ -471,7 +471,7 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to)
}
else
{
MsgWarn("NET_SendPacket: bad address type\n");
MsgDev( D_ERROR, "NET_SendPacket: bad address type\n");
return;
}
@ -498,7 +498,7 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to)
{
if (err == WSAEADDRNOTAVAIL)
{
MsgWarn("NET_SendPacket: %s : %s\n", NET_ErrorString(), NET_AdrToString (to));
MsgDev( D_ERROR, "NET_SendPacket: %s : %s\n", NET_ErrorString(), NET_AdrToString (to));
}
else
{
@ -581,19 +581,19 @@ void NET_OpenIP (void)
int port;
int dedicated;
ip = Cvar_Get ("ip", "localhost", CVAR_INIT);
ip = Cvar_Get ("ip", "localhost", CVAR_INIT, "network ip address" );
dedicated = Cvar_VariableValue ("dedicated");
if (!ip_sockets[NS_SERVER])
{
port = Cvar_Get("ip_hostport", "0", CVAR_INIT)->value;
port = Cvar_Get("ip_hostport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("hostport", "0", CVAR_INIT)->value;
port = Cvar_Get("hostport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("port", va("%i", PORT_SERVER), CVAR_INIT)->value;
port = Cvar_Get("port", va("%i", PORT_SERVER), CVAR_INIT, "no description" )->value;
}
}
ip_sockets[NS_SERVER] = NET_IPSocket (ip->string, port);
@ -606,10 +606,10 @@ void NET_OpenIP (void)
if (!ip_sockets[NS_CLIENT])
{
port = Cvar_Get("ip_clientport", "0", CVAR_INIT)->value;
port = Cvar_Get("ip_clientport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("clientport", va("%i", PORT_CLIENT), CVAR_INIT)->value;
port = Cvar_Get("clientport", va("%i", PORT_CLIENT), CVAR_INIT, "no description" )->value;
if (!port)
port = PORT_ANY;
}
@ -687,13 +687,13 @@ void NET_OpenIPX (void)
if (!ipx_sockets[NS_SERVER])
{
port = Cvar_Get("ipx_hostport", "0", CVAR_INIT)->value;
port = Cvar_Get("ipx_hostport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("hostport", "0", CVAR_INIT)->value;
port = Cvar_Get("hostport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("port", va("%i", PORT_SERVER), CVAR_INIT)->value;
port = Cvar_Get("port", va("%i", PORT_SERVER ), CVAR_INIT, "no description" )->value;
}
}
ipx_sockets[NS_SERVER] = NET_IPXSocket (port);
@ -705,10 +705,10 @@ void NET_OpenIPX (void)
if (!ipx_sockets[NS_CLIENT])
{
port = Cvar_Get("ipx_clientport", "0", CVAR_INIT)->value;
port = Cvar_Get("ipx_clientport", "0", CVAR_INIT, "no description" )->value;
if (!port)
{
port = Cvar_Get("clientport", va("%i", PORT_CLIENT), CVAR_INIT)->value;
port = Cvar_Get("clientport", va("%i", PORT_CLIENT), CVAR_INIT, "no description" )->value;
if (!port)
port = PORT_ANY;
}
@ -810,10 +810,10 @@ void NET_Init (void)
MsgDev(D_NOTE, "NET_Init()\n");
noudp = Cvar_Get ("noudp", "0", CVAR_INIT);
noipx = Cvar_Get ("noipx", "0", CVAR_INIT);
noudp = Cvar_Get ("noudp", "0", CVAR_INIT, "no description" );
noipx = Cvar_Get ("noipx", "0", CVAR_INIT, "no description" );
net_shownet = Cvar_Get ("net_shownet", "0", 0);
net_shownet = Cvar_Get ("net_shownet", "0", 0, "show network status" );
}

View File

@ -78,7 +78,7 @@ extern cvar_t *scr_width;
extern cvar_t *scr_height;
void SCR_AdjustSize( float *x, float *y, float *w, float *h );
void SCR_DrawPic( float x, float y, float width, float height, char *picname );
void SCR_DrawPic( float x, float y, float width, float height, const char *picname );
void SCR_FillRect( float x, float y, float width, float height, const float *color );
void SCR_DrawSmallChar( int x, int y, int ch );
void SCR_DrawChar( int x, int y, float w, float h, int ch );

View File

@ -490,7 +490,7 @@ void SV_BuildClientFrame( client_state_t *client )
state = &svs.client_entities[svs.next_client_entities % svs.num_client_entities];
if (ent->priv.sv->serialnumber != e)
{
MsgWarn ("SV_BuildClientFrame: invalid ent->priv.sv->serialnumber %d\n", ent->priv.sv->serialnumber );
MsgDev( D_WARN, "SV_BuildClientFrame: invalid ent->priv.sv->serialnumber %d\n", ent->priv.sv->serialnumber );
ent->priv.sv->serialnumber = e; // ptr to current entity such as entnumber
}

View File

@ -43,7 +43,7 @@ int SV_FindIndex (const char *name, int start, int end, bool create)
if (i == end)
{
MsgWarn ("SV_FindIndex: %d out of range [%d - %d]\n", start, end );
MsgDev( D_WARN, "SV_FindIndex: %d out of range [%d - %d]\n", start, end );
return 0;
}

View File

@ -289,7 +289,7 @@ void SVC_DirectConnect( void )
if (version != PROTOCOL_VERSION)
{
Netchan_OutOfBandPrint (NS_SERVER, adr, "print\nServer is version %4.2f.\n", GI->version );
MsgWarn ("SVC_DirectConnect: rejected connect from version %i\n", version);
MsgDev( D_ERROR, "SVC_DirectConnect: rejected connect from version %i\n", version);
return;
}
@ -344,7 +344,7 @@ void SVC_DirectConnect( void )
{
if (!NET_IsLocalAddress (adr) && (svs.realtime - cl->lastconnect) < sv_reconnect_limit->value)
{
MsgWarn("SVC_DirectConnect: %s:reconnect rejected : too soon\n", NET_AdrToString (adr));
MsgDev( D_ERROR, "SVC_DirectConnect: %s:reconnect rejected : too soon\n", NET_AdrToString (adr));
return;
}
Msg ("%s:reconnect\n", NET_AdrToString (adr));
@ -388,7 +388,7 @@ gotnewcl:
if (*Info_ValueForKey (userinfo, "rejmsg"))
Netchan_OutOfBandPrint (NS_SERVER, adr, "print\n%s\nConnection refused.\n", Info_ValueForKey (userinfo, "rejmsg"));
else Netchan_OutOfBandPrint (NS_SERVER, adr, "print\nConnection refused.\n" );
MsgWarn("SVC_DirectConnect: Game rejected a connection.\n");
MsgDev( D_ERROR, "SVC_DirectConnect: Game rejected a connection.\n");
return;
}
@ -477,7 +477,7 @@ void SV_ConnectionlessPacket (void)
Cmd_TokenizeString(s);
c = Cmd_Argv(0);
MsgWarn("SV_ConnectionlessPacket: %s : %s\n", NET_AdrToString(net_from), c);
MsgDev( D_INFO, "SV_ConnectionlessPacket: %s : %s\n", NET_AdrToString(net_from), c);
if (!strcmp(c, "ping")) SVC_Ping();
else if (!strcmp(c, "ack")) SVC_Ack();
@ -931,37 +931,36 @@ void SV_Init (void)
{
SV_InitOperatorCommands();
rcon_password = Cvar_Get ("rcon_password", "", 0);
Cvar_Get ("skill", "1", 0);
Cvar_Get ("deathmatch", "0", CVAR_LATCH);
Cvar_Get ("coop", "0", CVAR_LATCH);
Cvar_Get ("dmflags", va("%i", DF_INSTANT_ITEMS), CVAR_SERVERINFO);
Cvar_Get ("fraglimit", "0", CVAR_SERVERINFO);
Cvar_Get ("timelimit", "0", CVAR_SERVERINFO);
Cvar_Get ("cheats", "0", CVAR_SERVERINFO|CVAR_LATCH);
Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO|CVAR_INIT);
maxclients = Cvar_Get ("maxclients", "1", CVAR_SERVERINFO | CVAR_LATCH);
hostname = Cvar_Get ("hostname", "unnamed", CVAR_SERVERINFO | CVAR_ARCHIVE);
timeout = Cvar_Get ("timeout", "125", 0);
zombietime = Cvar_Get ("zombietime", "2", 0);
sv_showclamp = Cvar_Get ("showclamp", "0", 0);
sv_paused = Cvar_Get ("paused", "0", 0);
sv_enforcetime = Cvar_Get ("sv_enforcetime", "0", 0);
allow_download = Cvar_Get ("allow_download", "1", CVAR_ARCHIVE);
allow_download_players = Cvar_Get ("allow_download_players", "0", CVAR_ARCHIVE);
allow_download_models = Cvar_Get ("allow_download_models", "1", CVAR_ARCHIVE);
allow_download_sounds = Cvar_Get ("allow_download_sounds", "1", CVAR_ARCHIVE);
allow_download_maps = Cvar_Get ("allow_download_maps", "1", CVAR_ARCHIVE);
rcon_password = Cvar_Get( "rcon_password", "", 0, "remote connect password" );
Cvar_Get ("skill", "1", 0, "game skill level" );
Cvar_Get ("deathmatch", "0", CVAR_LATCH, "displays deathmatch state" );
Cvar_Get ("coop", "0", CVAR_LATCH, "displays cooperative state" );
Cvar_Get ("dmflags", va("%i", DF_INSTANT_ITEMS), CVAR_SERVERINFO, "setup deathmatch flags" );
Cvar_Get ("fraglimit", "0", CVAR_SERVERINFO, "multiplayer fraglimit" );
Cvar_Get ("timelimit", "0", CVAR_SERVERINFO, "multiplayer timelimit" );
Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO|CVAR_INIT, "displays server protocol version" );
maxclients = Cvar_Get ("maxclients", "1", CVAR_SERVERINFO | CVAR_LATCH, "max count of clients for current game" );
hostname = Cvar_Get ("hostname", "unnamed", CVAR_SERVERINFO | CVAR_ARCHIVE, "host name" );
timeout = Cvar_Get ("timeout", "125", 0, "connection timeout" );
zombietime = Cvar_Get ("zombietime", "2", 0, "timeout for clients-zombie (who died but not respawned)" );
sv_showclamp = Cvar_Get ("showclamp", "0", 0, "show server clamping messages" );
sv_paused = Cvar_Get ("paused", "0", 0, "server pause" );
sv_enforcetime = Cvar_Get ("sv_enforcetime", "0", 0, "client enforce time" );
allow_download = Cvar_Get ("allow_download", "1", CVAR_ARCHIVE, "allow download resources" );
allow_download_players = Cvar_Get ("allow_download_players", "0", CVAR_ARCHIVE, "let downloading playermodels" );
allow_download_models = Cvar_Get ("allow_download_models", "1", CVAR_ARCHIVE, "let downloading models");
allow_download_sounds = Cvar_Get ("allow_download_sounds", "1", CVAR_ARCHIVE, "let downloading sounds" );
allow_download_maps = Cvar_Get ("allow_download_maps", "1", CVAR_ARCHIVE, "let downloading maps" );
sv_noreload = Cvar_Get ("sv_noreload", "0", 0);
sv_noreload = Cvar_Get ("sv_noreload", "0", 0, "ignore savepoints for singleplayer" );
sv_airaccelerate = Cvar_Get("sv_airaccelerate", "0", CVAR_LATCH);
sv_maxvelocity = Cvar_Get("sv_maxvelocity", "2000", 0 );
sv_gravity = Cvar_Get("sv_gravity", "800", 0 );
sv_airaccelerate = Cvar_Get("sv_airaccelerate", "0", CVAR_LATCH, "player accellerate in air" );
sv_maxvelocity = Cvar_Get("sv_maxvelocity", "2000", 0, "max world velocity" );
sv_gravity = Cvar_Get("sv_gravity", "800", 0, "world gravity" );
public_server = Cvar_Get ("public", "0", 0);
public_server = Cvar_Get ("public", "0", 0, "change server type from private to public" );
sv_reconnect_limit = Cvar_Get ("sv_reconnect_limit", "3", CVAR_ARCHIVE);
sv_reconnect_limit = Cvar_Get ("sv_reconnect_limit", "3", CVAR_ARCHIVE, "max reconnect attempts" );
SZ_Init (&net_message, net_message_buffer, sizeof(net_message_buffer));
}

View File

@ -152,12 +152,12 @@ void SV_CheckVelocity (edict_t *ent)
{
if (IS_NAN(ent->progs.sv->velocity[i]))
{
MsgWarn("Got a NaN velocity on %s\n", PRVM_GetString(ent->progs.sv->classname));
MsgDev( D_WARN, "Got a NaN velocity on %s\n", PRVM_GetString(ent->progs.sv->classname));
ent->progs.sv->velocity[i] = 0;
}
if (IS_NAN(ent->progs.sv->origin[i]))
{
MsgWarn("Got a NaN origin on %s\n", PRVM_GetString(ent->progs.sv->classname));
MsgDev( D_WARN, "Got a NaN origin on %s\n", PRVM_GetString(ent->progs.sv->classname));
ent->progs.sv->origin[i] = 0;
}
}
@ -307,7 +307,7 @@ static void SV_CheckStuck (edict_t *ent)
VectorCopy (ent->progs.sv->old_origin, ent->progs.sv->origin);
if (!SV_TestEntityPosition(ent))
{
MsgWarn("Unstuck player entity %i (classname \"%s\") by restoring old_origin.\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname));
MsgDev( D_INFO, "Unstuck player entity %i (classname \"%s\") by restoring old_origin.\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname));
SV_LinkEdict (ent);
return;
}
@ -321,14 +321,14 @@ static void SV_CheckStuck (edict_t *ent)
ent->progs.sv->origin[2] = org[2] + z;
if (!SV_TestEntityPosition(ent))
{
MsgWarn("Unstuck player entity %i (classname \"%s\") with offset %f %f %f.\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname), (float)i, (float)j, (float)z);
MsgDev( D_INFO, "Unstuck player entity %i (classname \"%s\") with offset %f %f %f.\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname), (float)i, (float)j, (float)z);
SV_LinkEdict (ent);
return;
}
}
VectorCopy (org, ent->progs.sv->origin);
MsgWarn("Stuck player entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname));
MsgDev( D_ERROR, "Stuck player entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->progs.sv->classname));
}
static void SV_UnstickEntity (edict_t *ent)
@ -771,18 +771,18 @@ void SV_MovePush(edict_t *pusher, float movetime)
SV_LinkEdict(pusher);
return;
default:
MsgWarn("SV_MovePush:");
MsgDev( D_ERROR, "SV_MovePush:");
PRVM_ED_Print(pusher);
MsgWarn(", have invalid solid type %g\n", pusher->progs.sv->solid );
MsgDev( D_ERROR, ", have invalid solid type %g\n", pusher->progs.sv->solid );
return;
}
index = (int)pusher->progs.sv->modelindex;
if (index < 1 || index >= MAX_MODELS)
{
MsgWarn("SV_MovePush:");
MsgDev( D_ERROR, "SV_MovePush:");
PRVM_ED_Print(pusher);
MsgWarn(", has an invalid modelindex %g\n", pusher->progs.sv->modelindex );
MsgDev( D_ERROR, ", has an invalid modelindex %g\n", pusher->progs.sv->modelindex );
return;
}
pushermodel = sv.models[index];

View File

@ -210,7 +210,7 @@ void _MSG_Send (msgtype_t to, vec3_t origin, edict_t *ent, const char *filename,
numclients = 1; // send to one
break;
default:
MsgWarn("MSG_Send: bad destination: %i (called at %s:%i)\n", to, filename, fileline);
MsgDev( D_ERROR, "MSG_Send: bad destination: %i (called at %s:%i)\n", to, filename, fileline);
return;
}
@ -282,17 +282,17 @@ void SV_StartSound (vec3_t origin, edict_t *entity, int channel, int soundindex,
if (volume < 0 || volume > 1.0)
{
MsgWarn("SV_StartSound: volume = %f\n", volume);
MsgDev( D_WARN, "SV_StartSound: volume = %f\n", volume);
volume = bound(0, volume, 1.0);
}
if (attenuation < 0 || attenuation > 4)
{
MsgWarn("SV_StartSound: attenuation = %f\n", attenuation);
MsgDev( D_WARN, "SV_StartSound: attenuation = %f\n", attenuation);
attenuation = bound(0, volume, 4);
}
if (timeofs < 0 || timeofs > 0.255)
{
MsgWarn("SV_StartSound: timeofs = %f\n", timeofs);
MsgDev( D_WARN, "SV_StartSound: timeofs = %f\n", timeofs);
timeofs = bound(0, timeofs, 0.255 );
}
ent = PRVM_NUM_FOR_EDICT(entity);

View File

@ -608,7 +608,7 @@ Make sure the event gets sent to all clients
*/
void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count)
{
MsgWarn("SV_StartParticle: implement me\n");
MsgDev( D_ERROR, "SV_StartParticle: implement me\n");
}
/*

View File

@ -297,7 +297,7 @@ void SV_BeginDownload_f(void)
if (!sv_client->download)
{
MsgWarn("SV_BeginDownload_f: couldn't download %s to %s\n", name, sv_client->name);
MsgDev( D_ERROR, "SV_BeginDownload_f: couldn't download %s to %s\n", name, sv_client->name);
if (sv_client->download)
{
sv_client->download = NULL;
@ -409,7 +409,7 @@ void SV_ClientThink (client_state_t *cl, usercmd_t *cmd)
if (cl->commandMsec < 0 && sv_enforcetime->value )
{
MsgWarn("SV_ClientThink: commandMsec underflow from %s\n", cl->name);
MsgDev( D_ERROR, "SV_ClientThink: commandMsec underflow from %s\n", cl->name);
return;
}
ClientThink (cl->edict, cmd);
@ -449,7 +449,7 @@ void SV_ExecuteClientMessage (client_state_t *cl)
{
if (net_message.readcount > net_message.cursize)
{
MsgWarn("SV_ReadClientMessage: bad read\n");
MsgDev( D_ERROR, "SV_ReadClientMessage: bad read\n");
SV_DropClient (cl);
return;
}
@ -460,7 +460,7 @@ void SV_ExecuteClientMessage (client_state_t *cl)
switch (c)
{
default:
MsgWarn("SV_ReadClientMessage: unknown command char\n");
MsgDev( D_ERROR, "SV_ReadClientMessage: unknown command char\n");
SV_DropClient (cl);
return;
@ -504,7 +504,7 @@ void SV_ExecuteClientMessage (client_state_t *cl)
if (calculatedChecksum != checksum)
{
MsgWarn("SV_ExecuteClientMessage: failed command checksum for %s (%d != %d)/%d\n", cl->name, calculatedChecksum, checksum, cl->netchan.incoming_sequence);
MsgDev( D_ERROR, "SV_ExecuteClientMessage: failed command checksum for %s (%d != %d)/%d\n", cl->name, calculatedChecksum, checksum, cl->netchan.incoming_sequence);
return;
}

View File

@ -137,7 +137,6 @@ void SV_UnlinkEdict( edict_t *ent )
ws = sv_ent->worldsector;
if( !ws ) return; // not linked in anywhere
sv_ent->worldsector = NULL;
//sv_ent->linked = false;
if( ws->entities == sv_ent )
{
@ -153,7 +152,7 @@ void SV_UnlinkEdict( edict_t *ent )
return;
}
}
MsgWarn("SV_UnlinkEdict: not found in worldSector\n" );
MsgDev( D_ERROR, "SV_UnlinkEdict: not found in worldSector\n" );
}
/*
@ -257,7 +256,7 @@ void SV_LinkEdict( edict_t *ent )
if (ent->priv.sv->areanum2 && ent->priv.sv->areanum2 != area && sv.state == ss_loading )
{
float *v = ent->progs.sv->absmin;
MsgWarn("SV_LinkEdict: object touching 3 areas at %f %f %f\n", v[0], v[1], v[2]);
MsgDev( D_WARN, "SV_LinkEdict: object touching 3 areas at %f %f %f\n", v[0], v[1], v[2]);
}
ent->priv.sv->areanum2 = area;
}
@ -308,8 +307,6 @@ void SV_LinkEdict( edict_t *ent )
sv_ent->worldsector = node;
sv_ent->nextedict = node->entities;
node->entities = sv_ent;
//sv_ent->linked = true;
}
/*

View File

@ -1209,7 +1209,7 @@ uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
if(filesize != buffsize) // main check
{
MsgWarn("LoadDDS: (%s) probably corrupted(%i should be %i)\n", name, buffsize, filesize );
MsgDev( D_WARN, "LoadDDS: (%s) probably corrupted(%i should be %i)\n", name, buffsize, filesize );
return false;
}
return buffsize;
@ -1274,12 +1274,12 @@ bool Image_LoadDDS( const char *name, byte *buffer, size_t filesize )
if(header.dwIdent != DDSHEADER) return false; // it's not a dds file, just skip it
if(header.dwSize != sizeof(dds_t) - 4 ) // size of the structure (minus MagicNum)
{
MsgWarn("LoadDDS: (%s) have corrupt header\n", name );
MsgDev( D_ERROR, "LoadDDS: (%s) have corrupt header\n", name );
return false;
}
if(header.dsPixelFormat.dwSize != sizeof(dds_pixf_t)) // size of the structure
{
MsgWarn("LoadDDS: (%s) have corrupt pixelformat header\n", name );
MsgDev( D_ERROR, "LoadDDS: (%s) have corrupt pixelformat header\n", name );
return false;
}
@ -1294,7 +1294,7 @@ bool Image_LoadDDS( const char *name, byte *buffer, size_t filesize )
if (image_type == PF_UNKNOWN)
{
MsgWarn("LoadDDS: (%s) have unsupported compression type\n", name );
MsgDev( D_WARN, "LoadDDS: (%s) have unsupported compression type\n", name );
return false; //unknown type
}

View File

@ -16,7 +16,7 @@ void ImageLib_Init ( uint funcname )
zonepool = Mem_AllocPool( "ImageLib Pool" );
app_name = funcname;
img_resample_lerp = Cvar_Get( "img_lerping", "1", CVAR_SYSTEMINFO );
img_resample_lerp = Cvar_Get( "img_lerping", "1", CVAR_SYSTEMINFO, "lerping images after resample" );
}
void ImageLib_Free ( void )

View File

@ -77,7 +77,7 @@ bool Image_LoadTGA( const char *name, byte *buffer, size_t filesize )
if( targa_header.attributes & 0x10 )
{
MsgWarn("LoadTGA: (%s): top right and bottom right origin are not supported\n", name );
MsgDev( D_WARN, "LoadTGA: (%s): top right and bottom right origin are not supported\n", name );
return false;
}
@ -85,7 +85,7 @@ bool Image_LoadTGA( const char *name, byte *buffer, size_t filesize )
alphabits = targa_header.attributes & 0x0F;
if( alphabits != 8 && alphabits != 0 )
{
MsgWarn("LoadTGA: (%s) have invalid attributes '%i'\n", name, alphabits );
MsgDev( D_WARN, "LoadTGA: (%s) have invalid attributes '%i'\n", name, alphabits );
return false;
}
@ -279,7 +279,7 @@ bool Image_SaveTGA( const char *name, rgbdata_t *pix, int saveformat )
case PF_RGB_24: pixel_size = 3; break;
case PF_RGBA_32: pixel_size = 4; break;
default:
MsgWarn("SaveTGA: unsupported image type %s\n", PFDesc[pix->type].name );
MsgDev( D_ERROR, "SaveTGA: unsupported image type %s\n", PFDesc[pix->type].name );
return false;
}

View File

@ -12,7 +12,7 @@ bool Image_ValidSize( const char *name )
{
if( image_width > IMAGE_MAXWIDTH || image_height > IMAGE_MAXHEIGHT || image_width <= 0 || image_height <= 0 )
{
MsgWarn( "Image_ValidSize: (%s) dimensions out of range [%dx%d]\n", name, image_width, image_height );
MsgDev( D_WARN, "Image_ValidSize: (%s) dimensions out of range [%dx%d]\n",name, image_width, image_height );
return false;
}
return true;

View File

@ -113,7 +113,7 @@ void Cbuf_ExecuteText (int exec_when, const char *text)
Cbuf_AddText (text);
break;
default:
MsgWarn("Cbuf_ExecuteText: bad execute target\n");
MsgDev( D_ERROR, "Cbuf_ExecuteText: bad execute target\n");
break;
}
}
@ -275,7 +275,7 @@ void Cmd_Exec_f (void)
f = FS_LoadFile(rcpath, &len );
if (!f)
{
MsgWarn("couldn't exec %s\n", Cmd_Argv(1));
MsgDev( D_WARN, "couldn't exec %s\n", Cmd_Argv(1));
return;
}
MsgDev(D_INFO, "execing %s\n",Cmd_Argv(1));
@ -296,7 +296,7 @@ void Cmd_SystemCfg_f( void )
f = FS_LoadFile( "system.rc", &len );
if (!f)
{
MsgWarn("couldn't exec system.rc\n" );
MsgDev( D_WARN, "couldn't exec system.rc\n" );
return;
}
MsgDev(D_INFO, "execing system.rc\n" );

View File

@ -202,6 +202,8 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags, const
Cvar_Set2( var_name, s, true );
Mem_Free( s );
}
// update description if needs
if( var_desc ) var->description = copystring(var_desc);
return var;
}
@ -216,7 +218,8 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags, const
cvar_numIndexes++;
var->name = copystring(var_name);
var->string = copystring(var_value);
var->description = copystring(var_desc);
if( var_desc ) var->description = copystring(var_desc);
var->modified = true;
var->modificationCount = 1;
var->value = com_atof(var->string);
@ -262,8 +265,8 @@ cvar_t *Cvar_Set2 (const char *var_name, const char *value, bool force)
if( !value ) return NULL;
// create it
if ( !force ) return Cvar_Get( var_name, value, CVAR_USER_CREATED, "user variable" );
else return Cvar_Get (var_name, value, 0, "" );
if ( !force ) return Cvar_Get( var_name, value, CVAR_USER_CREATED, NULL );
else return Cvar_Get (var_name, value, 0, NULL );
}
if(!value ) value = var->reset_string;

View File

@ -886,7 +886,7 @@ static bool FS_AddPack_Fullpath(const char *pakfile, bool *already_loaded, bool
}
else
{
MsgWarn("FS_AddPack_Fullpath: unable to load pak \"%s\"\n", pakfile);
MsgDev( D_ERROR, "FS_AddPack_Fullpath: unable to load pak \"%s\"\n", pakfile);
return false;
}
}
@ -918,7 +918,7 @@ bool FS_AddPack(const char *pakfile, bool *already_loaded, bool keep_plain_dirs)
search = FS_FindFile(pakfile, &index, true);
if(!search || search->pack)
{
MsgWarn("FS_AddPack: could not find pak \"%s\"\n", pakfile);
MsgDev( D_WARN, "FS_AddPack: could not find pak \"%s\"\n", pakfile);
return false;
}
com_sprintf(fullpath, "%s%s", search->filename, pakfile);
@ -1523,7 +1523,7 @@ void FS_Init( void )
// checked nasty path: "bin" it's a reserved word
if(FS_CheckNastyPath( gs_basedir, true ) || !com_stricmp("bin", gs_basedir ))
{
MsgWarn("FS_Init: invalid game directory \"%s\"\n", gs_basedir );
MsgDev( D_INFO, "FS_Init: invalid game directory \"%s\"\n", gs_basedir );
com_strcpy(gs_basedir, "tmpQuArK" ); // default dir
}
@ -1536,7 +1536,7 @@ void FS_Init( void )
if(i == dirs.numstrings)
{
MsgWarn("FS_Init: game directory \"%s\" not exist\n", gs_basedir );
MsgDev( D_INFO, "FS_Init: game directory \"%s\" not exist\n", gs_basedir );
com_strcpy(gs_basedir, "tmpQuArK" ); // default dir
}
stringlistfreecontents(&dirs);
@ -1633,7 +1633,7 @@ void FS_Shutdown( void )
FS_WriteVariables( f );
FS_Close (f);
}
else MsgWarn("Couldn't write system.rc.\n");
else MsgDev( D_ERROR, "Couldn't write system.rc.\n");
Mem_FreePool(&fs_mempool);
}
@ -2052,7 +2052,7 @@ file_t* _FS_Open (const char* filepath, const char* mode, bool quiet, bool nonbl
{
if (FS_CheckNastyPath(filepath, false))
{
MsgWarn("FS_Open: (\"%s\", \"%s\"): nasty filename rejected\n", filepath, mode );
MsgDev( D_ERROR, "FS_Open: (\"%s\", \"%s\"): nasty filename rejected\n", filepath, mode );
return NULL;
}
@ -2583,7 +2583,7 @@ bool FS_WriteFile (const char *filename, const void *data, fs_offset_t len)
file = _FS_Open (filename, "wb", false, false);
if (!file)
{
MsgWarn("FS_WriteFile: failed on %s\n", filename);
MsgDev( D_ERROR, "FS_WriteFile: failed on %s\n", filename);
return false;
}
@ -3082,7 +3082,7 @@ vfile_t *VFS_Open(file_t *handle, const char* mode)
else
{
Mem_Free( file );
MsgWarn("VFS_Open: unsupported mode %s\n", mode );
MsgDev( D_ERROR, "VFS_Open: unsupported mode %s\n", mode );
return NULL;
}
return file;
@ -3112,7 +3112,7 @@ fs_offset_t VFS_Read( vfile_t* file, void* buffer, size_t buffersize)
Mem_Copy( buffer, file->buff + file->offset, reduced_size );
file->offset += reduced_size;
read_size = reduced_size;
MsgWarn("VFS_Read: vfs buffer is out\n");
MsgDev( D_NOTE, "VFS_Read: vfs buffer is out\n");
}
return read_size;
}

View File

@ -36,7 +36,7 @@ bool SC_AddScriptToStack(const char *name, byte *buffer, int size)
{
if (script == &scriptstack[MAX_INCLUDES - 1])
{
MsgWarn("AddScriptToStack: script file limit exceeded %d\n", MAX_INCLUDES );
MsgDev( D_ERROR, "AddScriptToStack: script file limit exceeded %d\n", MAX_INCLUDES );
return false;
}
if(!buffer || !size) return false;
@ -199,7 +199,7 @@ skip_whitespace: // skip whitespace
{
if (token_p == &token[MAX_SYSPATH - 1])
{
MsgWarn("GetToken: Token too large on line %i\n",scriptline);
MsgDev( D_WARN, "GetToken: Token too large on line %i\n",scriptline);
break;
}
*token_p = c;
@ -330,7 +330,7 @@ skip_whitespace: // skip whitespace
{
if (token_p == &token[MAX_SYSPATH - 1])
{
MsgWarn("GetToken: Token too large on line %i\n",scriptline);
MsgDev( D_WARN, "GetToken: Token too large on line %i\n",scriptline);
break;
}

View File

@ -32,7 +32,6 @@ void Sys_GetStdAPI( void )
// base events
com.printf = Sys_Msg;
com.dprintf = Sys_MsgDev;
com.wprintf = Sys_MsgWarn;
com.error = Sys_Error;
com.abort = Sys_Break;
com.exit = Sys_Exit;
@ -670,19 +669,6 @@ void Sys_MsgDev( int level, const char *pMsg, ... )
}
}
void Sys_MsgWarn( const char *pMsg, ... )
{
va_list argptr;
char text[MAX_INPUTLINE];
if(!Sys.debug) return;
va_start (argptr, pMsg);
com_vsprintf (text, pMsg, argptr);
va_end (argptr);
Sys_Print(va("^3Warning:^7 %s", text));
}
/*
================
Sys_DoubleTime
@ -865,7 +851,7 @@ void Sys_Error(const char *error, ...)
va_end (argptr);
Con_ShowConsole( true );
if(Sys.developer) Sys_Print( text ); // print error message
if(Sys.debug) Sys_Print( text ); // print error message
else Sys_Print( "Internal engine error\n" ); // don't confuse non-developers with technique stuff
Sys_WaitForQuit();

View File

@ -131,7 +131,6 @@ void Sys_Break(const char *error, ...);
void Sys_PrintLog( const char *pMsg );
void Sys_Print(const char *pMsg);
void Sys_Msg( const char *pMsg, ... );
void Sys_MsgWarn( const char *pMsg, ... );
void Sys_MsgDev( int level, const char *pMsg, ... );
int Sys_GetThreadWork( void );
void Sys_ThreadWorkerFunction (int threadnum);
@ -144,7 +143,6 @@ void Sys_RunThreadsOn (int workcnt, bool showpacifier, void(*func)(int));
#define Msg Sys_Msg
#define MsgDev Sys_MsgDev
#define MsgWarn Sys_MsgWarn
// registry common tools
bool REG_GetValue( HKEY hKey, const char *SubKey, const char *Value, char *pBuffer);

View File

@ -1040,7 +1040,7 @@ void CM_ModelBounds( cmodel_t *cmod, vec3_t mins, vec3_t maxs )
{
VectorSet( mins, -32, -32, -32 );
VectorSet( maxs, 32, 32, 32 );
MsgWarn("can't compute bounding box, use default size\n");
MsgDev( D_WARN, "can't compute bounding box, use default size\n");
}
}
@ -1259,7 +1259,7 @@ bool CM_StudioModel( byte *buffer, uint filesize )
phdr = (studiohdr_t *)buffer;
if( phdr->version != STUDIO_VERSION )
{
MsgWarn("CM_StudioModel: %s has wrong version number (%i should be %i)", phdr->name, phdr->version, STUDIO_VERSION);
MsgDev( D_ERROR, "CM_StudioModel: %s has wrong version number (%i should be %i)", phdr->name, phdr->version, STUDIO_VERSION);
return false;
}
@ -1285,7 +1285,7 @@ bool CM_SpriteModel( byte *buffer, uint filesize )
if( phdr->version != SPRITE_VERSION )
{
MsgWarn("CM_SpriteModel: %s has wrong version number (%i should be %i)\n", loadmodel->name, phdr->version, SPRITE_VERSION );
MsgDev( D_ERROR, "CM_SpriteModel: %s has wrong version number (%i should be %i)\n", loadmodel->name, phdr->version, SPRITE_VERSION );
return false;
}
@ -1346,7 +1346,7 @@ cmodel_t *CM_RegisterModel( const char *name )
{
if( cm.numcmodels == MAX_MODELS )
{
MsgWarn("CM_LoadModel: MAX_MODELS limit exceeded\n" );
MsgDev( D_ERROR, "CM_LoadModel: MAX_MODELS limit exceeded\n" );
return NULL;
}
cm.numcmodels++;
@ -1356,7 +1356,7 @@ cmodel_t *CM_RegisterModel( const char *name )
buf = FS_LoadFile( name, &size );
if(!buf)
{
MsgWarn("CM_LoadModel: %s not found\n", name );
MsgDev( D_ERROR, "CM_LoadModel: %s not found\n", name );
memset(mod->name, 0, sizeof(mod->name));
return NULL;
}

View File

@ -42,7 +42,7 @@ physbody_t *Phys_CreateBody( sv_edict_t *ed, cmodel_t *mod, matrix4x3 transform,
// default size
VectorSet( mins, -32, -32, -32 );
VectorSet( maxs, 32, 32, 32 );
MsgWarn("can't compute bounding box, use default size\n");
MsgDev( D_WARN, "can't compute bounding box, use default size\n");
}
// setup offset matrix

View File

@ -25,11 +25,11 @@ bool InitPhysics( void )
CM_InitMaterials();
cm_noareas = Cvar_Get( "cm_noareas", "0", 0 );
cm_use_triangles = Cvar_Get("cm_convert_polygons", "1", CVAR_SYSTEMINFO );//, "convert bsp polygons to triangles, slowly but more safety way" );
cm_solver_model = Cvar_Get("cm_solver", "0", CVAR_SYSTEMINFO );//, "change solver model: 0 - precision, 1 - adaptive, 2 - fast. (changes need restart server to take effect)" );
cm_friction_model = Cvar_Get("cm_friction", "0", CVAR_SYSTEMINFO );//, "change solver model: 0 - precision, 1 - adaptive. (changes need restart server to take effect)" );
cm_physics_model = Cvar_Get("cm_physic", "1", CVAR_ARCHIVE );//, "change physic model: 0 - Classic Quake Physic, 1 - Physics Engine" );
cm_noareas = Cvar_Get( "cm_noareas", "0", 0, "ignore clipmap areas" );
cm_use_triangles = Cvar_Get("cm_convert_polygons", "1", CVAR_SYSTEMINFO, "convert bsp polygons to triangles, slowly but more safety way" );
cm_solver_model = Cvar_Get("cm_solver", "0", CVAR_SYSTEMINFO, "change solver model: 0 - precision, 1 - adaptive, 2 - fast. (changes need restart server to take effect)" );
cm_friction_model = Cvar_Get("cm_friction", "0", CVAR_SYSTEMINFO, "change solver model: 0 - precision, 1 - adaptive. (changes need restart server to take effect)" );
cm_physics_model = Cvar_Get("cm_physic", "1", CVAR_ARCHIVE, "change physic model: 0 - Classic Quake Physic, 1 - Physics Engine" );
return true;
}

View File

@ -165,7 +165,7 @@ enum host_state
enum dev_level
{
D_INFO = 1, // "-dev 1", shows various system messages
D_WARN, // "-dev 2", shows not critical system warnings, same as MsgWarn
D_WARN, // "-dev 2", shows not critical system warnings
D_ERROR, // "-dev 3", shows critical warnings
D_LOAD, // "-dev 4", show messages about loading resources
D_NOTE, // "-dev 5", show system notifications for engine develeopers

View File

@ -399,10 +399,10 @@ typedef struct render_exp_s
void (*SetColor)( const float *rgba );
bool (*ScrShot)( const char *filename, bool levelshot ); // write screenshot with same name
void (*DrawFill)(float x, float y, float w, float h );
void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, byte *data, bool redraw );
void (*DrawStretchPic)(float x, float y, float w, float h, float s1, float t1, float s2, float t2, char *name);
void (*DrawStretchRaw)( int x, int y, int w, int h, int cols, int rows, byte *data, bool redraw );
void (*DrawStretchPic)( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const char *name );
void (*DrawGetPicSize) (int *w, int *h, char *name); // get rid of this
void (*DrawGetPicSize)( int *w, int *h, const char *name );
} render_exp_t;

View File

@ -22,7 +22,6 @@ typedef struct stdilib_api_s
void (*print)( const char *msg ); // basic text message
void (*printf)( const char *msg, ... ); // formatted text message
void (*dprintf)( int level, const char *msg, ...); // developer text message
void (*wprintf)( const char *msg, ... ); // warning text message
void (*error)( const char *msg, ... ); // abnormal termination with message
void (*abort)( const char *msg, ... ); // normal tremination with message
void (*exit)( void ); // normal silent termination
@ -283,7 +282,7 @@ filesystem manager
console variables
===========================================
*/
#define Cvar_Get(name, value, flags) com.Cvar_Get(name, value, flags, "no description" ) //FIXME
#define Cvar_Get com.Cvar_Get
#define Cvar_LookupVars com.Cvar_LookupVars
#define Cvar_Set com.Cvar_SetString
#define Cvar_FullSet com.Cvar_FullSet
@ -351,7 +350,6 @@ misc utils
#define GI com.GameInfo
#define Msg com.printf
#define MsgDev com.dprintf
#define MsgWarn com.wprintf
#define Sys_LoadLibrary com.Com_LoadLibrary
#define Sys_FreeLibrary com.Com_FreeLibrary
#define Sys_GetProcAddress com.Com_GetProcAddress
@ -373,7 +371,7 @@ misc utils
/*
===========================================
stdlib functions that not across with win stdlib
stdlib function names that not across with windows stdlib
===========================================
*/
#define timestamp com.timestamp

View File

@ -29,7 +29,7 @@ image_t *draw_chars;
Draw_FindPic
=============
*/
image_t *Draw_FindPic( char *name )
image_t *Draw_FindPic( const char *name )
{
string fullname;
byte *buffer = NULL;
@ -110,7 +110,7 @@ void Draw_Char (float x, float y, int num)
Draw_GetPicSize
=============
*/
void Draw_GetPicSize (int *w, int *h, char *pic)
void Draw_GetPicSize (int *w, int *h, const char *pic)
{
image_t *gl;
@ -129,7 +129,7 @@ void Draw_GetPicSize (int *w, int *h, char *pic)
Draw_StretchPic
=============
*/
void Draw_StretchPic (float x, float y, float w, float h, float s1, float t1, float s2, float t2, char *pic)
void Draw_StretchPic (float x, float y, float w, float h, float s1, float t1, float s2, float t2, const char *pic)
{
image_t *gl;
@ -175,7 +175,7 @@ void Draw_StretchPic (float x, float y, float w, float h, float s1, float t1, fl
Draw_Pic
=============
*/
void Draw_Pic (int x, int y, char *pic)
void Draw_Pic (int x, int y, const char *pic)
{
image_t *gl;

View File

@ -359,9 +359,9 @@ char *va(char *format, ...);
void COM_StripExtension (char *in, char *out);
void COM_FileBase (char *in, char *out);
void Draw_GetPicSize (int *w, int *h, char *name);
void Draw_Pic (int x, int y, char *name);
void Draw_StretchPic(float x, float y, float w, float h, float s1, float t1, float s2, float t2, char *pic);
void Draw_GetPicSize( int *w, int *h, const char *name );
void Draw_Pic (int x, int y, const char *name);
void Draw_StretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const char *pic );
void Draw_Char (float x, float y, int c);
void Draw_String (int x, int y, char *str);
void Draw_TileClear (int x, int y, int w, int h, char *name);

View File

@ -217,7 +217,7 @@ model_t *Mod_ForName(char *name, bool crash)
{
if (mod_numknown == MAX_MODELS)
{
MsgWarn("Mod_ForName: MAX_MODELS limit exceeded\n" );
MsgDev( D_ERROR, "Mod_ForName: MAX_MODELS limit exceeded\n" );
return NULL;
}
mod_numknown++;
@ -950,17 +950,15 @@ Specifies the model that will be used as the world
void R_BeginRegistration (char *model)
{
char fullname[MAX_QPATH];
cvar_t *flushmap;
registration_sequence++;
r_oldviewcluster = -1; // force markleafs
sprintf (fullname, "maps/%s.bsp", model);
com.sprintf (fullname, "maps/%s.bsp", model);
// explicitly free the old map if different
// this guarantees that mod_known[0] is the world map
flushmap = Cvar_Get ("flushmap", "0", 0);
if(com.strcmp(mod_known[0].name, fullname) || flushmap->value)
if(com.strcmp(mod_known[0].name, fullname))
{
Mod_Free (&mod_known[0]);
}

View File

@ -964,94 +964,94 @@ void R_RenderFrame (refdef_t *fd)
void R_Register( void )
{
r_lefthand = Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );
r_norefresh = Cvar_Get ("r_norefresh", "0", 0);
r_fullbright = Cvar_Get ("r_fullbright", "0", 0);
r_drawentities = Cvar_Get ("r_drawentities", "1", 0);
r_drawworld = Cvar_Get ("r_drawworld", "1", 0);
r_novis = Cvar_Get ("r_novis", "0", 0);
r_nocull = Cvar_Get ("r_nocull", "0", 0);
r_lerpmodels = Cvar_Get ("r_lerpmodels", "1", 0);
r_speeds = Cvar_Get ("r_speeds", "0", 0);
r_pause = Cvar_Get("paused", "0", 0);
r_pause_bw = Cvar_Get("r_pause_effect", "0", CVAR_ARCHIVE );
r_physbdebug = Cvar_Get( "cm_debugdraw", "0", CVAR_ARCHIVE );
r_lefthand = Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE, "viewmodel handedness" );
r_norefresh = Cvar_Get ("r_norefresh", "0", 0, "no description" );
r_fullbright = Cvar_Get ("r_fullbright", "0", 0, "disable lightmaps" );
r_drawentities = Cvar_Get ("r_drawentities", "1", 0, "render entities" );
r_drawworld = Cvar_Get ("r_drawworld", "1", 0, "render world" );
r_novis = Cvar_Get ("r_novis", "0", 0, "ignore vis information (perfomance test)");
r_nocull = Cvar_Get ("r_nocull", "0", 0, "ignore frustrum culling (perfomance test)");
r_lerpmodels = Cvar_Get ("r_lerpmodels", "1", 0, "lerping model animations" );
r_speeds = Cvar_Get ("r_speeds", "0", 0, "shows r_speeds" );
r_pause = Cvar_Get("paused", "0", 0, "renderer pause" );
r_pause_bw = Cvar_Get("r_pause_effect", "0", CVAR_ARCHIVE, "allow pause effect" );
r_physbdebug = Cvar_Get( "cm_debugdraw", "0", CVAR_ARCHIVE, "draw physics hulls" );
// must been already existing
r_width = Cvar_Get("width", "640", 0);
r_height = Cvar_Get("height", "480", 0);
r_mode = Cvar_Get( "r_mode", "0", CVAR_ARCHIVE );
r_width = Cvar_Get("width", "640", 0, "screen width" );
r_height = Cvar_Get("height", "480", 0, "screen height" );
r_mode = Cvar_Get( "r_mode", "0", CVAR_ARCHIVE, "display resolution mode" );
r_loading = Cvar_Get("scr_loading", "0", 0 );
r_lightlevel = Cvar_Get ("r_lightlevel", "0", 0);
r_loading = Cvar_Get("scr_loading", "0", 0, "loading bar progress" );
r_lightlevel = Cvar_Get ("r_lightlevel", "0", 0, "no description" );
r_motionblur_intens = Cvar_Get( "r_motionblur_intens", "0.65", CVAR_ARCHIVE );
r_motionblur = Cvar_Get( "r_motionblur", "0", CVAR_ARCHIVE );
r_motionblur_intens = Cvar_Get( "r_motionblur_intens", "0.65", CVAR_ARCHIVE, "no description" );
r_motionblur = Cvar_Get( "r_motionblur", "0", CVAR_ARCHIVE, "no description" );
gl_nosubimage = Cvar_Get( "gl_nosubimage", "0", 0 );
gl_allow_software = Cvar_Get( "gl_allow_software", "0", 0 );
gl_nosubimage = Cvar_Get( "gl_nosubimage", "0", 0, "no description" );
gl_allow_software = Cvar_Get( "gl_allow_software", "0", 0, "no description" );
gl_particle_min_size = Cvar_Get( "gl_particle_min_size", "2", CVAR_ARCHIVE );
gl_particle_max_size = Cvar_Get( "gl_particle_max_size", "40", CVAR_ARCHIVE );
gl_particle_size = Cvar_Get( "gl_particle_size", "40", CVAR_ARCHIVE );
gl_particle_att_a = Cvar_Get( "gl_particle_att_a", "0.01", CVAR_ARCHIVE );
gl_particle_att_b = Cvar_Get( "gl_particle_att_b", "0.0", CVAR_ARCHIVE );
gl_particle_att_c = Cvar_Get( "gl_particle_att_c", "0.01", CVAR_ARCHIVE );
gl_particle_min_size = Cvar_Get( "gl_particle_min_size", "2", CVAR_ARCHIVE, "no description" );
gl_particle_max_size = Cvar_Get( "gl_particle_max_size", "40", CVAR_ARCHIVE, "no description" );
gl_particle_size = Cvar_Get( "gl_particle_size", "40", CVAR_ARCHIVE, "no description" );
gl_particle_att_a = Cvar_Get( "gl_particle_att_a", "0.01", CVAR_ARCHIVE, "no description" );
gl_particle_att_b = Cvar_Get( "gl_particle_att_b", "0.0", CVAR_ARCHIVE, "no description" );
gl_particle_att_c = Cvar_Get( "gl_particle_att_c", "0.01", CVAR_ARCHIVE, "no description" );
r_bloom = Cvar_Get( "r_bloom", "0", CVAR_ARCHIVE );
r_bloom_alpha = Cvar_Get( "r_bloom_alpha", "0.5", CVAR_ARCHIVE );
r_bloom_diamond_size = Cvar_Get( "r_bloom_diamond_size", "8", CVAR_ARCHIVE );
r_bloom_intensity = Cvar_Get( "r_bloom_intensity", "0.6", CVAR_ARCHIVE );
r_bloom_darken = Cvar_Get( "r_bloom_darken", "4", CVAR_ARCHIVE );
r_bloom_sample_size = Cvar_Get( "r_bloom_sample_size", "128", CVAR_ARCHIVE );
r_bloom_fast_sample = Cvar_Get( "r_bloom_fast_sample", "0", CVAR_ARCHIVE );
r_bloom = Cvar_Get( "r_bloom", "0", CVAR_ARCHIVE, "no description" );
r_bloom_alpha = Cvar_Get( "r_bloom_alpha", "0.5", CVAR_ARCHIVE, "no description" );
r_bloom_diamond_size = Cvar_Get( "r_bloom_diamond_size", "8", CVAR_ARCHIVE, "no description" );
r_bloom_intensity = Cvar_Get( "r_bloom_intensity", "0.6", CVAR_ARCHIVE, "no description" );
r_bloom_darken = Cvar_Get( "r_bloom_darken", "4", CVAR_ARCHIVE, "no description" );
r_bloom_sample_size = Cvar_Get( "r_bloom_sample_size", "128", CVAR_ARCHIVE, "no description" );
r_bloom_fast_sample = Cvar_Get( "r_bloom_fast_sample", "0", CVAR_ARCHIVE, "no description" );
r_minimap_size = Cvar_Get ("r_minimap_size", "256", CVAR_ARCHIVE );
r_minimap_zoom = Cvar_Get ("r_minimap_zoom", "1", CVAR_ARCHIVE );
r_minimap_style = Cvar_Get ("r_minimap_style", "1", CVAR_ARCHIVE );
r_minimap = Cvar_Get("r_minimap", "0", CVAR_ARCHIVE );
r_minimap_size = Cvar_Get ("r_minimap_size", "256", CVAR_ARCHIVE, "no description" );
r_minimap_zoom = Cvar_Get ("r_minimap_zoom", "1", CVAR_ARCHIVE, "no description" );
r_minimap_style = Cvar_Get ("r_minimap_style", "1", CVAR_ARCHIVE, "no description" );
r_minimap = Cvar_Get("r_minimap", "0", CVAR_ARCHIVE, "no description" );
r_mirroralpha = Cvar_Get( "r_mirroralpha", "0.5", CVAR_ARCHIVE );
r_interpolate = Cvar_Get( "r_interpolate", "0", CVAR_ARCHIVE );
r_mirroralpha = Cvar_Get( "r_mirroralpha", "0.5", CVAR_ARCHIVE, "no description" );
r_interpolate = Cvar_Get( "r_interpolate", "0", CVAR_ARCHIVE, "no description" );
gl_modulate = Cvar_Get ("gl_modulate", "1", CVAR_ARCHIVE );
gl_log = Cvar_Get( "gl_log", "0", 0 );
gl_bitdepth = Cvar_Get( "gl_bitdepth", "0", 0 );
gl_modulate = Cvar_Get ("gl_modulate", "1", CVAR_ARCHIVE, "no description" );
gl_log = Cvar_Get( "gl_log", "0", 0, "no description" );
gl_bitdepth = Cvar_Get( "gl_bitdepth", "0", 0, "no description" );
gl_lightmap = Cvar_Get ("gl_lightmap", "0", 0);
gl_shadows = Cvar_Get ("gl_shadows", "0", CVAR_ARCHIVE );
gl_dynamic = Cvar_Get ("gl_dynamic", "1", 0);
gl_nobind = Cvar_Get ("gl_nobind", "0", 0);
gl_round_down = Cvar_Get ("gl_round_down", "1", 0);
gl_skymip = Cvar_Get ("gl_skymip", "0", 0);
gl_showtris = Cvar_Get ("gl_showtris", "0", 0);
gl_ztrick = Cvar_Get ("gl_ztrick", "0", 0);
gl_finish = Cvar_Get ("gl_finish", "0", CVAR_ARCHIVE);
gl_clear = Cvar_Get ("gl_clear", "0", 0);
gl_cull = Cvar_Get ("gl_cull", "1", 0);
gl_polyblend = Cvar_Get ("gl_polyblend", "1", 0);
gl_flashblend = Cvar_Get ("gl_flashblend", "0", 0);
gl_playermip = Cvar_Get ("gl_playermip", "0", 0);
gl_texturemode = Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
gl_texturealphamode = Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE );
gl_texturesolidmode = Cvar_Get( "gl_texturesolidmode", "default", CVAR_ARCHIVE );
gl_lockpvs = Cvar_Get( "gl_lockpvs", "0", 0 );
gl_lightmap = Cvar_Get ("gl_lightmap", "0", 0, "no description" );
gl_shadows = Cvar_Get ("gl_shadows", "0", CVAR_ARCHIVE, "no description" );
gl_dynamic = Cvar_Get ("gl_dynamic", "1", 0, "no description" );
gl_nobind = Cvar_Get ("gl_nobind", "0", 0, "no description" );
gl_round_down = Cvar_Get ("gl_round_down", "1", 0, "no description" );
gl_skymip = Cvar_Get ("gl_skymip", "0", 0, "no description" );
gl_showtris = Cvar_Get ("gl_showtris", "0", 0, "no description" );
gl_ztrick = Cvar_Get ("gl_ztrick", "0", 0, "no description" );
gl_finish = Cvar_Get ("gl_finish", "0", CVAR_ARCHIVE, "no description" );
gl_clear = Cvar_Get ("gl_clear", "0", 0, "no description" );
gl_cull = Cvar_Get ("gl_cull", "1", 0, "no description" );
gl_polyblend = Cvar_Get ("gl_polyblend", "1", 0, "no description" );
gl_flashblend = Cvar_Get ("gl_flashblend", "0", 0, "no description" );
gl_playermip = Cvar_Get ("gl_playermip", "0", 0, "no description" );
gl_texturemode = Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE, "no description" );
gl_texturealphamode = Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE, "no description" );
gl_texturesolidmode = Cvar_Get( "gl_texturesolidmode", "default", CVAR_ARCHIVE, "no description" );
gl_lockpvs = Cvar_Get( "gl_lockpvs", "0", 0, "no description" );
gl_vertex_arrays = Cvar_Get( "gl_vertex_arrays", "0", CVAR_ARCHIVE );
gl_vertex_arrays = Cvar_Get( "gl_vertex_arrays", "0", CVAR_ARCHIVE, "no description" );
gl_ext_swapinterval = Cvar_Get( "gl_ext_swapinterval", "1", CVAR_ARCHIVE );
gl_ext_multitexture = Cvar_Get( "gl_ext_multitexture", "1", CVAR_ARCHIVE );
gl_ext_compiled_vertex_array = Cvar_Get( "gl_ext_compiled_vertex_array", "1", CVAR_ARCHIVE );
gl_ext_swapinterval = Cvar_Get( "gl_ext_swapinterval", "1", CVAR_ARCHIVE, "no description" );
gl_ext_multitexture = Cvar_Get( "gl_ext_multitexture", "1", CVAR_ARCHIVE, "no description" );
gl_ext_compiled_vertex_array = Cvar_Get( "gl_ext_compiled_vertex_array", "1", CVAR_ARCHIVE, "no description" );
gl_drawbuffer = Cvar_Get( "gl_drawbuffer", "GL_BACK", 0 );
gl_swapinterval = Cvar_Get( "gl_swapinterval", "1", CVAR_ARCHIVE );
gl_drawbuffer = Cvar_Get( "gl_drawbuffer", "GL_BACK", 0, "no description" );
gl_swapinterval = Cvar_Get( "gl_swapinterval", "1", CVAR_ARCHIVE, "no description" );
gl_saturatelighting = Cvar_Get( "gl_saturatelighting", "0", 0 );
gl_saturatelighting = Cvar_Get( "gl_saturatelighting", "0", 0, "no description" );
gl_3dlabs_broken = Cvar_Get( "gl_3dlabs_broken", "1", CVAR_ARCHIVE );
gl_3dlabs_broken = Cvar_Get( "gl_3dlabs_broken", "1", CVAR_ARCHIVE, "no description" );
r_fullscreen = Cvar_Get( "fullscreen", "0", CVAR_ARCHIVE );
vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE );
r_fullscreen = Cvar_Get( "fullscreen", "0", CVAR_ARCHIVE, "set in 1 to enable fullscreen mode" );
vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE, "screen gamma" );
Cmd_AddCommand( "imagelist", R_ImageList_f, "display loaded images list" );
Cmd_AddCommand( "modellist", Mod_Modellist_f, "display loaded models list" );
@ -1070,7 +1070,7 @@ bool R_SetMode (void)
if ( r_fullscreen->modified && !gl_config.allow_cds )
{
MsgWarn("R_SetMode: CDS not allowed with this driver\n" );
MsgDev( D_ERROR, "R_SetMode: CDS not allowed with this driver\n" );
Cvar_SetValue( "fullscreen", !r_fullscreen->value );
r_fullscreen->modified = false;
}
@ -1090,7 +1090,7 @@ bool R_SetMode (void)
{
Cvar_SetValue( "fullscreen", 0 );
r_fullscreen->modified = false;
MsgWarn("R_SetMode: fullscreen unavailable in this mode\n" );
MsgDev( D_ERROR, "R_SetMode: fullscreen unavailable in this mode\n" );
if (( err = GLimp_SetMode( r_mode->integer, false ) ) == rserr_ok )
return true;
}
@ -1098,13 +1098,13 @@ bool R_SetMode (void)
{
Cvar_SetValue( "r_mode", gl_state.prev_mode );
r_mode->modified = false;
MsgWarn("R_SetMode: invalid mode\n" );
MsgDev( D_ERROR, "R_SetMode: invalid mode\n" );
}
// try setting it back to something safe
if(( err = GLimp_SetMode( gl_state.prev_mode, false )) != rserr_ok )
{
MsgWarn("R_SetMode: could not revert to safe mode\n" );
MsgDev( D_ERROR, "R_SetMode: could not revert to safe mode\n" );
return false;
}
}
@ -1149,7 +1149,7 @@ int R_Init( void *hinstance )
if ( !R_SetMode () )
{
QGL_Shutdown();
MsgWarn("R_Init: could not R_SetMode()\n" );
MsgDev( D_ERROR, "R_Init: could not R_SetMode()\n" );
return false;
}
@ -1242,7 +1242,7 @@ int R_Init( void *hinstance )
if(!r_framebuffer) r_framebuffer = Z_Malloc(r_width->integer * r_height->integer * 3);
err = qglGetError();
if ( err != GL_NO_ERROR ) MsgWarn("glGetError = 0x%x\n", err );
if ( err != GL_NO_ERROR ) MsgDev( D_ERROR, "glGetError = 0x%x\n", err );
return 1;
}

View File

@ -164,8 +164,8 @@ bool VID_CreateWindow( int width, int height, bool fullscreen )
}
else
{
r_xpos = Cvar_Get ("r_xpos", "3", 0);
r_ypos = Cvar_Get ("r_ypos", "22", 0);
r_xpos = Cvar_Get ("r_xpos", "3", CVAR_ARCHIVE, "window position by horizontal" );
r_ypos = Cvar_Get ("r_ypos", "22", CVAR_ARCHIVE, "window position by vertical" );
x = r_xpos->value;
y = r_ypos->value;
}

View File

@ -152,7 +152,7 @@ void R_SpriteLoadModel( model_t *mod, void *buffer )
if(numframes < 1)
{
MsgWarn("%s has invalid # of frames: %d\n", mod->name, numframes );
MsgDev( D_ERROR, "%s has invalid # of frames: %d\n", mod->name, numframes );
return;
}

View File

@ -311,7 +311,7 @@ void R_InitTextures( void )
Image->Init( HOST_NORMAL );
r_imagepool = Mem_AllocPool("Texture Pool");
gl_maxsize = Cvar_Get( "gl_maxsize", "4096", CVAR_ARCHIVE );
gl_maxsize = Cvar_Get( "gl_maxsize", "4096", CVAR_ARCHIVE, "texture dimension max size" );
qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &texsize); // merge value
if( gl_maxsize->integer != texsize ) Cvar_SetValue( "gl_maxsize", texsize );
@ -319,7 +319,7 @@ void R_InitTextures( void )
registration_sequence = 1;
// init intensity conversions
intensity = Cvar_Get ("intensity", "2", 0 );
intensity = Cvar_Get ("intensity", "2", 0, "gamma intensity value" );
if( intensity->value <= 1 ) Cvar_SetValue( "intensity", 1 );
gl_state.inverse_intensity = 1 / intensity->value;
@ -1205,7 +1205,7 @@ image_t *R_LoadImage( char *name, rgbdata_t *pic, imagetype_t type )
// check for errors
if(!iResult)
{
MsgWarn("R_LoadImage: can't loading %s with bpp %d\n", name, image_desc.bpp );
MsgDev( D_ERROR, "R_LoadImage: can't loading %s with bpp %d\n", name, image_desc.bpp );
return r_notexture;
}
return image;

View File

@ -7,7 +7,6 @@
#include "pal_utils.h"
dll_info_t imglib_dll = { "imglib.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(imglib_exp_t) };
bool host_debug = false;
imglib_exp_t *Image;
stdlib_api_t com;
byte *basepool;

View File

@ -227,7 +227,7 @@ bool ConvPAL( const char *name, char *buffer, int filesize )
{
if( filesize != 768 )
{
MsgWarn("LoadPAL: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadPAL: file (%s) have invalid size\n", name );
return false;
}
@ -300,7 +300,7 @@ bool Lump_ValidSize( char *name, rgbdata_t *pic, int maxwidth, int maxheight )
{
if(pic->width > maxwidth || pic->height > maxheight || pic->width <= 0 || pic->height <= 0)
{
MsgWarn( "Lump_ValidSize: (%s) dimensions out of range [%dx%d]\n", name, pic->width, pic->height );
MsgDev( D_WARN, "Lump_ValidSize: (%s) dimensions out of range [%dx%d]\n", name, pic->width, pic->height );
return false;
}
return true;

View File

@ -22,7 +22,7 @@ bool PCX_ConvertImage( const char *name, char *buffer, int filesize )
if (pcx.manufacturer != 0x0a || pcx.version != 5 || pcx.encoding != 1 ) return false;
if (filesize < (int)sizeof(pcx) + 768)
{
MsgWarn("ConvPCX: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "ConvPCX: file (%s) have invalid size\n", name );
return false;
}
memset( &pic, 0, sizeof(pic));
@ -41,12 +41,12 @@ bool PCX_ConvertImage( const char *name, char *buffer, int filesize )
if( pcx.bits_per_pixel != 8 || pcx.manufacturer != 0x0a || pcx.version != 5 || pcx.encoding != 1)
{
MsgWarn("ConvPCX: (%s) have illegal pixel size '%d'\n", name, pcx.bits_per_pixel );
MsgDev( D_ERROR, "ConvPCX: (%s) have illegal pixel size '%d'\n", name, pcx.bits_per_pixel );
return false;
}
if(pic.width > 512 || pic.height > 512 || pic.width <= 0 || pic.height <= 0)
if(pic.width > 640 || pic.height > 640 || pic.width <= 0 || pic.height <= 0)
{
MsgWarn( "ConvPCX: (%s) dimensions out of range [%dx%d]\n", name, pic.width, pic.height );
MsgDev( D_ERROR, "ConvPCX: (%s) dimensions out of range [%dx%d]\n", name, pic.width, pic.height );
return false;
}
palette = buffer + filesize - 768;

View File

@ -19,7 +19,7 @@ rgbdata_t *Conv_FlatImage( const char *name, char *buffer, int filesize )
if(filesize < (int)sizeof(flat))
{
MsgWarn("LoadFLAT: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadFLAT: file (%s) have invalid size\n", name );
return NULL;
}
@ -165,7 +165,7 @@ bool ConvMIP( const char *name, char *buffer, int filesize )
if (filesize < (int)sizeof(mip))
{
MsgWarn("LoadMIP: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadMIP: file (%s) have invalid size\n", name );
return false;
}
memset( &pic, 0, sizeof(pic));
@ -225,7 +225,7 @@ bool ConvMIP( const char *name, char *buffer, int filesize )
}
else
{
MsgWarn("LoadMIP: lump (%s) is corrupted\n", savedname );
MsgDev( D_ERROR, "LoadMIP: lump (%s) is corrupted\n", savedname );
return false;
}
@ -257,7 +257,7 @@ bool ConvLMP( const char *name, char *buffer, int filesize )
if (filesize < (int)sizeof(lmp))
{
MsgWarn("LoadLMP: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadLMP: file (%s) have invalid size\n", name );
return false;
}
memset( &pic, 0, sizeof(pic));
@ -271,7 +271,7 @@ bool ConvLMP( const char *name, char *buffer, int filesize )
if(filesize < (int)sizeof(lmp) + pixels)
{
MsgWarn("LoadLMP: file (%s) have invalid size %d\n", name, filesize );
MsgDev( D_ERROR, "LoadLMP: file (%s) have invalid size %d\n", name, filesize );
return false;
}
@ -323,7 +323,7 @@ bool ConvFNT( const char *name, char *buffer, int filesize )
if(filesize < (int)sizeof(font))
{
MsgWarn("LoadFNT: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadFNT: file (%s) have invalid size\n", name );
return false;
}
Mem_Copy(&font, buffer, sizeof(font));
@ -377,7 +377,7 @@ bool ConvFNT( const char *name, char *buffer, int filesize )
}
else
{
MsgWarn("LoadFNT: file (%s) have invalid palette size %d\n", name, numcolors );
MsgDev( D_ERROR, "LoadFNT: file (%s) have invalid palette size %d\n", name, numcolors );
return false;
}

View File

@ -21,7 +21,7 @@ bool ConvWAL( const char *name, char *buffer, int filesize )
if (filesize < (int)sizeof(wal))
{
MsgWarn("LoadWAL: file (%s) have invalid size\n", name );
MsgDev( D_ERROR, "LoadWAL: file (%s) have invalid size\n", name );
return false;
}
Mem_Copy(&wal, buffer, sizeof(wal));
@ -41,8 +41,8 @@ bool ConvWAL( const char *name, char *buffer, int filesize )
mipsize = (int)sizeof(wal) + ofs[0] + pixels;
if( pixels > 256 && filesize < mipsize )
{
// note: wal's with dimensions < 32 have invalid sizes.
MsgWarn("LoadWAL: file (%s) have invalid size\n", name );
// NOTE: wal's with dimensions < 32 have invalid sizes.
MsgDev( D_ERROR, "LoadWAL: file (%s) have invalid size\n", name );
return false;
}
pic.buffer = Mem_Alloc( zonepool, pic.size );

View File

@ -20,10 +20,9 @@ fopen
4. snd encoder äëÿ roqlib
Òåêóùèå çàäà÷è:
0. Ïðåâðàòèòü host.debug è host.developer â cvars
1. Èìïëåìåíòàöèÿ client.dat
2. Èìïîðò cg_user.c â client.dat
3. Ïîääåðæêà êàñòîìíûõ ìåññàã
0. Èìïëåìåíòàöèÿ client.dat
1. Èìïîðò cg_user.c â client.dat
2. Ïîääåðæêà êàñòîìíûõ ìåññàã
Ôèçèêà èãðîêà:

View File

@ -420,8 +420,7 @@ void GUI_ResetWndOptions( void )
{
char dev_level[4];
//get info about debug mode
if(FS_CheckParm ("-debug")) debug_mode = true;
//get info about developer mode
if(FS_GetParmFromCmdLine("-dev", dev_level ))
dev_mode = atoi(dev_level);
@ -786,7 +785,7 @@ void GUI_HotKeys( WPARAM wParam )
GUI_HideConsole();
break;
default:
MsgWarn("GUI_HotKeys: call unused hotkey %d\n", LOWORD(wParam));
MsgDev( D_WARN, "GUI_HotKeys: call unused hotkey %d\n", LOWORD(wParam));
break;
}
}
@ -907,12 +906,12 @@ void InitViewer ( uint funcname, int argc, char **argv )
{
if(config_dat->id != IDVIEWERHEADER)
{
MsgWarn("InitViewer: viewer.rc have mismath header!\n");
MsgDev( D_ERROR, "InitViewer: viewer.rc have mismath header!\n");
iErrors++;
}
if(config_dat->csize != config_size)
{
MsgWarn("InitViewer: viewer.rc have mismath size!\n");
MsgDev( D_ERROR, "InitViewer: viewer.rc have mismath size!\n");
iErrors++;
}
//copy settings into main structure

View File

@ -5,7 +5,6 @@
#include "viewer.h"
bool debug_mode = false;
int dev_mode = 0;
/*
=============================================================================
@ -77,7 +76,7 @@ void GUI_AddAccelerator(int key, int flags, int cmd)
g_AccelTable[g_numAccel].cmd = cmd;
g_numAccel++;
}
else MsgWarn("GUI_AddAccelerator: can't register hotkey! Hokey limit exceed\n");
else MsgDev( D_ERROR, "GUI_AddAccelerator: can't register hotkey! Hokey limit exceed\n");
}
/*
@ -91,7 +90,7 @@ void GUI_CreateAccelTable( void )
{
//create accel table
g_hAccel = CreateAcceleratorTable (g_AccelTable, g_numAccel);
if(!g_hAccel) MsgWarn("GUI_CreateAccelTable: can't create accel table\n");
if(!g_hAccel) MsgDev( D_ERROR, "GUI_CreateAccelTable: can't create accel table\n");
}
/*

View File

@ -31,7 +31,6 @@ void FreeViewer ( void );
extern int com_argc;
extern int dev_mode;
extern bool debug_mode;
extern char *com_argv[MAX_NUM_ARGVS];
/*
@ -39,10 +38,6 @@ extern char *com_argv[MAX_NUM_ARGVS];
System Events
===========================================
*/
void GUI_Msg( const char *pMsg, ... );
void GUI_MsgDev( int level, const char *pMsg, ... );
void GUI_MsgWarn( const char *pMsg, ... );
extern stdlib_api_t com;
#define Sys_Error com.error

View File

@ -973,7 +973,7 @@ void PRVM_ED_EdictSet_f(void)
ed = PRVM_EDICT_NUM(com.atoi(Cmd_Argv(2)));
if((key = PRVM_ED_FindField(Cmd_Argv(3))) == 0)
MsgWarn("Key %s not found !\n", Cmd_Argv(3));
MsgDev( D_WARN, "Key %s not found !\n", Cmd_Argv(3));
else PRVM_ED_ParseEpair(ed, key, Cmd_Argv(4));
vm.prog = NULL;
@ -1133,7 +1133,7 @@ void PRVM_ED_LoadFromFile (const char *data)
{
if(prvm_developer >= D_NOTE)
{
MsgWarn("No classname for:\n");
MsgDev( D_ERROR, "No classname for:\n");
PRVM_ED_Print(ent);
}
PRVM_ED_Free (ent);
@ -1147,7 +1147,7 @@ void PRVM_ED_LoadFromFile (const char *data)
{
if(prvm_developer >= D_NOTE)
{
MsgWarn("No spawn function for:\n");
MsgDev( D_ERROR, "No spawn function for:\n");
PRVM_ED_Print(ent);
}
PRVM_ED_Free (ent);

View File

@ -220,7 +220,7 @@ void PR_Init( const char *name )
memset(&ret_temp, 0, sizeof(ret_temp));
memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
if (opt_locals_marshalling) MsgWarn("Locals marshalling might be buggy. Use with caution\n");
if (opt_locals_marshalling) MsgDev( D_INFO, "Locals marshalling might be buggy. Use with caution\n");
com.strncpy( sourcefilename, name, sizeof(sourcefilename));
// default parms
@ -268,9 +268,9 @@ void PRVM_Init( uint funcname, int argc, char **argv )
Cmd_AddCommand("prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
// LordHavoc: optional runtime bounds checking (speed drain, but worth it for security, on by default - breaks most QCCX features (used by CRMod and others))
prvm_boundscheck = Cvar_Get( "prvm_boundscheck", "0", 0 );
prvm_traceqc = Cvar_Get( "prvm_traceqc", "0", 0 );
prvm_statementprofiling = Cvar_Get ("prvm_statementprofiling", "0", 0);
prvm_boundscheck = Cvar_Get( "prvm_boundscheck", "0", 0, "enable vm internal boundschecker" );
prvm_traceqc = Cvar_Get( "prvm_traceqc", "0", 0, "enable tracing (only for debug)" );
prvm_statementprofiling = Cvar_Get ("prvm_statementprofiling", "0", 0, "counts how many times each QC statement has been executed" );
if( funcname == HOST_NORMAL || funcname == HOST_DEDICATED )
{

View File

@ -24,7 +24,7 @@ extern int prvm_developer;
#define Host_Error com.error
#define PROG_CRC_SERVER 5103
#define PROG_CRC_CLIENT 7430
#define PROG_CRC_CLIENT 9014
#define PROG_CRC_UIMENU 2460
enum op_state

View File

@ -594,7 +594,7 @@ sfx_t *S_FindSound( const char *name )
{
if( s_numSfx == MAX_SFX )
{
MsgWarn("S_FindName: MAX_SFX limit exceeded\n" );
MsgDev( D_ERROR, "S_FindName: MAX_SFX limit exceeded\n" );
return NULL;
}
s_numSfx++;
@ -676,7 +676,7 @@ sfx_t *S_GetSfxByHandle( sound_t handle )
{
if( handle < 0 || handle >= s_numSfx )
{
MsgWarn("S_GetSfxByHandle: handle %i out of range (%i)\n", handle, s_numSfx );
MsgDev( D_ERROR, "S_GetSfxByHandle: handle %i out of range (%i)\n", handle, s_numSfx );
return NULL;
}
return &s_knownSfx[handle];

View File

@ -731,18 +731,18 @@ void S_Init( void *hInst )
{
int num_mono_src, num_stereo_src;
host_sound = Cvar_Get("host_sound", "1", CVAR_SYSTEMINFO );
s_alDevice = Cvar_Get("s_device", "Generic Software", CVAR_LATCH|CVAR_ARCHIVE );
s_soundfx = Cvar_Get("s_soundfx", "1", CVAR_LATCH|CVAR_ARCHIVE );
s_check_errors = Cvar_Get("s_check_errors", "1", CVAR_ARCHIVE );
s_volume = Cvar_Get("s_volume", "1.0", CVAR_ARCHIVE );
s_musicvolume = Cvar_Get("s_musicvolume", "1.0", CVAR_ARCHIVE );
s_minDistance = Cvar_Get("s_mindistance", "240.0", CVAR_ARCHIVE );
s_maxDistance = Cvar_Get("s_maxdistance", "8192.0", CVAR_ARCHIVE );
s_rolloffFactor = Cvar_Get("s_rollofffactor", "1.0", CVAR_ARCHIVE );
s_dopplerFactor = Cvar_Get("s_dopplerfactor", "1.0", CVAR_ARCHIVE );
s_dopplerVelocity = Cvar_Get("s_dopplervelocity", "10976.0", CVAR_ARCHIVE );
s_pause = Cvar_Get( "paused", "0", 0 );
host_sound = Cvar_Get("host_sound", "1", CVAR_SYSTEMINFO, "enable sound system" );
s_alDevice = Cvar_Get("s_device", "Generic Software", CVAR_LATCH|CVAR_ARCHIVE, "OpenAL curent device name" );
s_soundfx = Cvar_Get("s_soundfx", "1", CVAR_LATCH|CVAR_ARCHIVE, "allow OpenAl extensions" );
s_check_errors = Cvar_Get("s_check_errors", "1", CVAR_ARCHIVE, "ignore sound engine errors" );
s_volume = Cvar_Get("s_volume", "1.0", CVAR_ARCHIVE, "sound volume" );
s_musicvolume = Cvar_Get("s_musicvolume", "1.0", CVAR_ARCHIVE, "background music volume" );
s_minDistance = Cvar_Get("s_mindistance", "240.0", CVAR_ARCHIVE, "3d sound min distance" );
s_maxDistance = Cvar_Get("s_maxdistance", "8192.0", CVAR_ARCHIVE, "3d sound max distance" );
s_rolloffFactor = Cvar_Get("s_rollofffactor", "1.0", CVAR_ARCHIVE, "3d sound rolloff factor" );
s_dopplerFactor = Cvar_Get("s_dopplerfactor", "1.0", CVAR_ARCHIVE, "cutoff doppler effect value" );
s_dopplerVelocity = Cvar_Get("s_dopplervelocity", "10976.0", CVAR_ARCHIVE, "doppler effect maxvelocity" );
s_pause = Cvar_Get( "paused", "0", 0, "sound engine pause" );
Cmd_AddCommand("playsound", S_PlaySound_f, "playing a specified sound file" );
Cmd_AddCommand("music", S_Music_f, "starting a background track" );

View File

@ -75,21 +75,21 @@ static bool S_OpenBackgroundTrack (const char *name, bg_track_t *track)
track->file = FS_Open( name, "rb" );
if( !track->file )
{
MsgWarn( "S_OpenBackgroundTrack: couldn't find %s\n", name );
MsgDev( D_ERROR, "S_OpenBackgroundTrack: couldn't find %s\n", name );
return false;
}
track->vorbisFile = vorbisFile = Z_Malloc(sizeof(vorbisfile_t));
if( ov_open_callbacks(track, vorbisFile, NULL, 0, vorbisCallbacks) < 0 )
{
MsgWarn( "S_OpenBackgroundTrack: couldn't open ogg stream %s\n", name );
MsgDev( D_ERROR, "S_OpenBackgroundTrack: couldn't open ogg stream %s\n", name );
return false;
}
vorbisInfo = ov_info( vorbisFile, -1 );
if( vorbisInfo->channels != 1 && vorbisInfo->channels != 2)
{
MsgWarn( "S_OpenBackgroundTrack: only mono and stereo ogg files supported %s\n", name );
MsgDev( D_ERROR, "S_OpenBackgroundTrack: only mono and stereo ogg files supported %s\n", name );
return false;
}