mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
Replace hardcoded functions names by __func__ macro
* while we're here, fix some possible bugs * and fix -Wformat=2 s/__FUNCTION__/__func__/g awawawa
This commit is contained in:
@@ -270,7 +270,7 @@ static GLuint GL2_GenerateShader( gl2wrap_prog_t *prog, GLenum type )
|
||||
|
||||
if( status == GL_FALSE )
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_ERROR "GL2_GenerateShader( 0x%04x, 0x%x ): compile failed: %s\n", prog->flags, type, GL_PrintInfoLog( id, false ));
|
||||
gEngfuncs.Con_Reportf( S_ERROR "%s( 0x%04x, 0x%x ): compile failed: %s\n", __func__, prog->flags, type, GL_PrintInfoLog( id, false ));
|
||||
|
||||
gEngfuncs.Con_DPrintf( "Shader text:\n%s\n\n", shader );
|
||||
pglDeleteObjectARB( id );
|
||||
@@ -301,13 +301,13 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags )
|
||||
|
||||
if( i == MAX_PROGS )
|
||||
{
|
||||
gEngfuncs.Host_Error( "GL2_GetProg: Ran out of program slots for 0x%04x\n", flags );
|
||||
gEngfuncs.Host_Error( "%s: Ran out of program slots for 0x%04x\n", __func__, flags );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// new prog; generate shaders
|
||||
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "GL2_GetProg: Generating progs for 0x%04x\n", flags );
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "%s: Generating progs for 0x%04x\n", __func__, flags );
|
||||
prog = &gl2wrap.progs[i];
|
||||
prog->flags = flags;
|
||||
|
||||
@@ -354,7 +354,7 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags )
|
||||
pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status );
|
||||
if( status == GL_FALSE )
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_ERROR "GL2_GetProg: Failed linking progs for 0x%04x!\n%s\n", prog->flags, GL_PrintInfoLog( glprog, true ));
|
||||
gEngfuncs.Con_Reportf( S_ERROR "%s: Failed linking progs for 0x%04x!\n%s\n", __func__, prog->flags, GL_PrintInfoLog( glprog, true ));
|
||||
prog->flags = 0;
|
||||
if( pglDeleteProgram )
|
||||
pglDeleteProgram( glprog );
|
||||
@@ -406,7 +406,7 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags )
|
||||
pglUseProgramObjectARB( gl2wrap.cur_prog->glprog );
|
||||
prog->glprog = glprog;
|
||||
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "GL2_GetProg: Generated progs for 0x%04x\n", flags );
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "%s: Generated progs for 0x%04x\n", __func__, flags );
|
||||
|
||||
return prog;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ int GL2_ShimInit( void )
|
||||
pglBindVertexArray( 0 );
|
||||
rpglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
|
||||
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "GL2_ShimInit: %u bytes allocated for vertex buffer\n", total );
|
||||
gEngfuncs.Con_DPrintf( S_NOTE "%s: %u bytes allocated for vertex buffer\n", __func__, total );
|
||||
|
||||
if( !GL2_InitProgs( ))
|
||||
{
|
||||
@@ -660,7 +660,7 @@ int GL2_ShimInit( void )
|
||||
{
|
||||
gl2wrap_config.version = 100;
|
||||
if( !GL2_InitProgs( ))
|
||||
gEngfuncs.Host_Error( "GL2_ShimInit: Failed to compile shaders!\n" );
|
||||
gEngfuncs.Host_Error( "%s: Failed to compile shaders!\n", __func__ );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -863,7 +863,7 @@ static void GL2_FlushPrims( void )
|
||||
prog = GL2_SetProg( flags );
|
||||
if( !prog )
|
||||
{
|
||||
gEngfuncs.Host_Error( "GL2_End: Could not find program for flags 0x%04x!\n", flags );
|
||||
gEngfuncs.Host_Error( "%s: Could not find program for flags 0x%04x!\n", __func__, flags );
|
||||
goto leave_label;
|
||||
}
|
||||
|
||||
|
||||
@@ -557,7 +557,7 @@ static void *Mod_LoadAllSkins( model_t *mod, int numskins, daliasskintype_t *psk
|
||||
int i, size;
|
||||
|
||||
if( numskins < 1 || numskins > MAX_SKINS )
|
||||
gEngfuncs.Host_Error( "Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins );
|
||||
gEngfuncs.Host_Error( "%s: Invalid # of skins: %d\n", __func__, numskins );
|
||||
|
||||
size = m_pAliasHeader->skinwidth * m_pAliasHeader->skinheight;
|
||||
|
||||
@@ -1215,7 +1215,7 @@ static void R_SetupAliasFrame( cl_entity_t *e, aliashdr_t *paliashdr )
|
||||
else if( newframe >= paliashdr->numframes )
|
||||
{
|
||||
if( newframe > paliashdr->numframes )
|
||||
gEngfuncs.Con_Reportf( S_WARN "R_GetAliasFrame: no such frame %d (%s)\n", newframe, e->model->name );
|
||||
gEngfuncs.Con_Reportf( S_WARN "%s: no such frame %d (%s)\n", __func__, newframe, e->model->name );
|
||||
newframe = paliashdr->numframes - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ void GL_SelectTexture( GLint tmu )
|
||||
|
||||
if( tmu >= GL_MaxTextureUnits( ))
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_ERROR "GL_SelectTexture: bad tmu state %i\n", tmu );
|
||||
gEngfuncs.Con_Reportf( S_ERROR "%s: bad tmu state %i\n", __func__, tmu );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ void GL_TextureTarget( uint target )
|
||||
{
|
||||
if( glState.activeTMU < 0 || glState.activeTMU >= GL_MaxTextureUnits( ))
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_ERROR "GL_TextureTarget: bad tmu state %i\n", glState.activeTMU );
|
||||
gEngfuncs.Con_Reportf( S_ERROR "%s: bad tmu state %i\n", __func__, glState.activeTMU );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -859,7 +859,7 @@ static qboolean R_BeamComputePoint( int beamEnt, vec3_t pt )
|
||||
|
||||
if( !ent )
|
||||
{
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "R_BeamComputePoint: invalid entity %i\n", BEAMENT_ENTITY( beamEnt ));
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: invalid entity %i\n", __func__, BEAMENT_ENTITY( beamEnt ));
|
||||
VectorClear( pt );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ static qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte
|
||||
case mod_brush:
|
||||
// Mod_LoadBrushModel( mod, buf, loaded );
|
||||
break;
|
||||
default: gEngfuncs.Host_Error( "Mod_LoadModel: unsupported type %d\n", mod->type );
|
||||
default: gEngfuncs.Host_Error( "%s: unsupported type %d\n", __func__, mod->type );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ static void R_DecalUnlink( decal_t *pdecal )
|
||||
else
|
||||
{
|
||||
tmp = pdecal->psurface->pdecals;
|
||||
if( !tmp ) gEngfuncs.Host_Error( "R_DecalUnlink: bad decal list\n" );
|
||||
if( !tmp ) gEngfuncs.Host_Error( "%s: bad decal list\n", __func__ );
|
||||
|
||||
while( tmp->pnext )
|
||||
{
|
||||
|
||||
@@ -145,9 +145,9 @@ void R_DrawStretchRaw( float x, float y, float w, float h, int cols, int rows, c
|
||||
}
|
||||
|
||||
if( cols > glConfig.max_2d_texture_size )
|
||||
gEngfuncs.Host_Error( "R_DrawStretchRaw: size %i exceeds hardware limits\n", cols );
|
||||
gEngfuncs.Host_Error( "%s: size %i exceeds hardware limits\n", __func__, cols );
|
||||
if( rows > glConfig.max_2d_texture_size )
|
||||
gEngfuncs.Host_Error( "R_DrawStretchRaw: size %i exceeds hardware limits\n", rows );
|
||||
gEngfuncs.Host_Error( "%s: size %i exceeds hardware limits\n", __func__, rows );
|
||||
|
||||
pglDisable( GL_BLEND );
|
||||
pglDisable( GL_ALPHA_TEST );
|
||||
@@ -220,9 +220,9 @@ void R_UploadStretchRaw( int texture, int cols, int rows, int width, int height,
|
||||
}
|
||||
|
||||
if( cols > glConfig.max_2d_texture_size )
|
||||
gEngfuncs.Host_Error( "R_UploadStretchRaw: size %i exceeds hardware limits\n", cols );
|
||||
gEngfuncs.Host_Error( "%s: size %i exceeds hardware limits\n", __func__, cols );
|
||||
if( rows > glConfig.max_2d_texture_size )
|
||||
gEngfuncs.Host_Error( "R_UploadStretchRaw: size %i exceeds hardware limits\n", rows );
|
||||
gEngfuncs.Host_Error( "%s: size %i exceeds hardware limits\n", __func__, rows );
|
||||
|
||||
tex = R_GetTexture( texture );
|
||||
GL_Bind( GL_KEEP_UNIT, texture );
|
||||
|
||||
@@ -91,7 +91,7 @@ void GL_Bind( GLint tmu, GLenum texnum )
|
||||
if( texnum <= 0 || texnum >= MAX_TEXTURES )
|
||||
{
|
||||
if( texnum != 0 )
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "GL_Bind: invalid texturenum %d\n", texnum );
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: invalid texturenum %d\n", __func__, texnum );
|
||||
texnum = tr.defaultTexture;
|
||||
}
|
||||
if( tmu != GL_KEEP_UNIT )
|
||||
@@ -489,7 +489,7 @@ static size_t GL_CalcTextureSize( GLenum format, int width, int height, int dept
|
||||
size = width * height * depth * 4;
|
||||
break;
|
||||
default:
|
||||
gEngfuncs.Host_Error( "GL_CalcTextureSize: bad texture internal format (%u)\n", format );
|
||||
gEngfuncs.Host_Error( "%s: bad texture internal format (%u)\n", __func__, format );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ static qboolean GL_UploadTexture( gl_texture_t *tex, rgbdata_t *pic )
|
||||
// make sure what target is correct
|
||||
if( tex->target == GL_NONE )
|
||||
{
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "GL_UploadTexture: %s is not supported by your hardware\n", tex->name );
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: %s is not supported by your hardware\n", __func__, tex->name );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1173,7 +1173,7 @@ static qboolean GL_UploadTexture( gl_texture_t *tex, rgbdata_t *pic )
|
||||
{
|
||||
if( !GL_Support( GL_ARB_TEXTURE_COMPRESSION_BPTC ))
|
||||
{
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "GL_UploadTexture: BC6H/BC7 compression formats is not supported by your hardware\n" );
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: BC6H/BC7 compression formats is not supported by your hardware\n", __func__ );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1189,7 +1189,7 @@ static qboolean GL_UploadTexture( gl_texture_t *tex, rgbdata_t *pic )
|
||||
if(( pic->width * pic->height ) & 3 )
|
||||
{
|
||||
// will be resampled, just tell me for debug targets
|
||||
gEngfuncs.Con_Reportf( "GL_UploadTexture: %s s&3 [%d x %d]\n", tex->name, pic->width, pic->height );
|
||||
gEngfuncs.Con_Reportf( "%s: %s s&3 [%d x %d]\n", __func__, tex->name, pic->width, pic->height );
|
||||
}
|
||||
|
||||
buf = pic->buffer;
|
||||
@@ -1208,7 +1208,7 @@ static qboolean GL_UploadTexture( gl_texture_t *tex, rgbdata_t *pic )
|
||||
{
|
||||
// track the buffer bounds
|
||||
if( buf != NULL && buf >= bufend )
|
||||
gEngfuncs.Host_Error( "GL_UploadTexture: %s image buffer overflow\n", tex->name );
|
||||
gEngfuncs.Host_Error( "%s: %s image buffer overflow\n", __func__, tex->name );
|
||||
|
||||
if( ImageCompressed( pic->type ))
|
||||
{
|
||||
@@ -1466,7 +1466,7 @@ static void GL_DeleteTexture( gl_texture_t *tex )
|
||||
// debug
|
||||
if( !tex->name[0] )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_DeleteTexture: trying to free unnamed texture with texnum %i\n", tex->texnum );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: trying to free unnamed texture with texnum %i\n", __func__, tex->texnum );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1657,20 +1657,20 @@ int GL_LoadTextureArray( const char **names, int flags )
|
||||
// mixed mode: DXT + RGB
|
||||
if( pic->type != src->type )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_LoadTextureArray: mismatch image format for %s and %s\n", names[0], names[i] );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: mismatch image format for %s and %s\n", __func__, names[0], names[i] );
|
||||
break;
|
||||
}
|
||||
|
||||
// different mipcount
|
||||
if( pic->numMips != src->numMips )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_LoadTextureArray: mismatch mip count for %s and %s\n", names[0], names[i] );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: mismatch mip count for %s and %s\n", __func__, names[0], names[i] );
|
||||
break;
|
||||
}
|
||||
|
||||
if( pic->encode != src->encode )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_LoadTextureArray: mismatch custom encoding for %s and %s\n", names[0], names[i] );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: mismatch custom encoding for %s and %s\n", __func__, names[0], names[i] );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1680,7 +1680,7 @@ int GL_LoadTextureArray( const char **names, int flags )
|
||||
|
||||
if( pic->size != src->size )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_LoadTextureArray: mismatch image size for %s and %s\n", names[0], names[i] );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: mismatch image size for %s and %s\n", __func__, names[0], names[i] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1716,7 +1716,7 @@ int GL_LoadTextureArray( const char **names, int flags )
|
||||
// there were errors
|
||||
if( !pic || ( pic->depth != numLayers ))
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_LoadTextureArray: not all layers were loaded. Texture array is not created\n" );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: not all layers were loaded. Texture array is not created\n", __func__ );
|
||||
if( pic ) gEngfuncs.FS_FreeImage( pic );
|
||||
return 0;
|
||||
}
|
||||
@@ -1765,7 +1765,7 @@ int GL_LoadTextureFromBuffer( const char *name, rgbdata_t *pic, texFlags_t flags
|
||||
if( update )
|
||||
{
|
||||
if( tex == NULL )
|
||||
gEngfuncs.Host_Error( "GL_LoadTextureFromBuffer: couldn't find texture %s for update\n", name );
|
||||
gEngfuncs.Host_Error( "%s: couldn't find texture %s for update\n", __func__, name );
|
||||
SetBits( tex->flags, flags );
|
||||
}
|
||||
else
|
||||
@@ -1935,19 +1935,19 @@ void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
|
||||
}
|
||||
else
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: bad operation for %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: bad operation for %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !image->original )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: no input data for %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: no input data for %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ImageCompressed( image->original->type ))
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: can't process compressed texture %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: can't process compressed texture %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ void GL_SetExtension( int r_ext, int enable )
|
||||
{
|
||||
if( r_ext >= 0 && r_ext < GL_EXTCOUNT )
|
||||
glConfig.extension[r_ext] = enable ? GL_TRUE : GL_FALSE;
|
||||
else gEngfuncs.Con_Printf( S_ERROR "GL_SetExtension: invalid extension %d\n", r_ext );
|
||||
else gEngfuncs.Con_Printf( S_ERROR "%s: invalid extension %d\n", __func__, r_ext );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -492,7 +492,7 @@ qboolean GL_Support( int r_ext )
|
||||
{
|
||||
if( r_ext >= 0 && r_ext < GL_EXTCOUNT )
|
||||
return glConfig.extension[r_ext] ? true : false;
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_Support: invalid extension %d\n", r_ext );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: invalid extension %d\n", __func__, r_ext );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -522,7 +522,7 @@ qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char
|
||||
char desc[MAX_VA_STRING];
|
||||
float glver = (float)glConfig.version_major + glConfig.version_minor / 10.0f;
|
||||
|
||||
gEngfuncs.Con_Reportf( "GL_CheckExtension: %s ", name );
|
||||
gEngfuncs.Con_Reportf( "%s: %s ", __func__, name );
|
||||
GL_SetExtension( r_ext, true );
|
||||
|
||||
if( cvarname )
|
||||
|
||||
@@ -959,7 +959,7 @@ R_SetupRefParams must be called right before
|
||||
void R_RenderScene( void )
|
||||
{
|
||||
if( !WORLDMODEL && RI.drawWorld )
|
||||
gEngfuncs.Host_Error( "R_RenderView: NULL worldmodel\n" );
|
||||
gEngfuncs.Host_Error( "%s: NULL worldmodel\n", __func__ );
|
||||
|
||||
// frametime is valid only for normal pass
|
||||
if( RP_NORMALPASS( ))
|
||||
|
||||
@@ -135,7 +135,7 @@ static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int nu
|
||||
glpoly_t *poly;
|
||||
|
||||
if( numverts > ( SUBDIVIDE_SIZE - 4 ))
|
||||
gEngfuncs.Host_Error( "Mod_SubdividePolygon: too many vertexes on face ( %i )\n", numverts );
|
||||
gEngfuncs.Host_Error( "%s: too many vertexes on face ( %i )\n", __func__, numverts );
|
||||
|
||||
sample_size = gEngfuncs.Mod_SampleSizeForFace( warpface );
|
||||
BoundPoly( numverts, verts, mins, maxs );
|
||||
@@ -691,7 +691,7 @@ static void LM_UploadBlock( qboolean dynamic )
|
||||
tr.lightmapTextures[i] = GL_LoadTextureInternal( lmName, &r_lightmap, TF_NOMIPMAP|TF_ATLAS_PAGE );
|
||||
|
||||
if( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS )
|
||||
gEngfuncs.Host_Error( "AllocBlock: full\n" );
|
||||
gEngfuncs.Host_Error( "%s: full\n", __func__ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1914,7 +1914,7 @@ void R_GenerateVBO( void )
|
||||
vbotex->vboarray = vbo;
|
||||
// generate new array and new vbotexture node
|
||||
vbo->array = Mem_Calloc( vbos.mempool, sizeof( vbovertex_t ) * vbo->array_len );
|
||||
gEngfuncs.Con_Printf( "R_GenerateVBOs: allocated array of %d verts, texture %d, lm %d\n", vbo->array_len, j, k );
|
||||
gEngfuncs.Con_Printf( "%s: allocated array of %d verts, texture %d, lm %d\n", __func__, vbo->array_len, j, k );
|
||||
vbo->next = Mem_Calloc( vbos.mempool, sizeof( vboarray_t ) );
|
||||
vbo = vbo->next;
|
||||
vbotex->next = Mem_Calloc( vbos.mempool, sizeof( vbotexture_t ) );
|
||||
@@ -1942,7 +1942,7 @@ void R_GenerateVBO( void )
|
||||
|
||||
// allocate last array
|
||||
vbo->array = Mem_Calloc( vbos.mempool, sizeof( vbovertex_t ) * vbo->array_len );
|
||||
gEngfuncs.Con_Printf( "R_GenerateVBOs: allocated array of %d verts\n", vbo->array_len );
|
||||
gEngfuncs.Con_Printf( "%s: allocated array of %d verts\n", __func__, vbo->array_len );
|
||||
|
||||
// switch to list begin
|
||||
vbo = vbos.arraylist;
|
||||
@@ -2723,7 +2723,7 @@ static void R_DrawVBODlights( vboarray_t *vbo, vbotexture_t *vbotex, texture_t *
|
||||
|
||||
// try upload the block now
|
||||
if( !LM_AllocBlock( smax, tmax, &info->dlight_s, &info->dlight_t ))
|
||||
gEngfuncs.Host_Error( "AllocBlock: full\n" );
|
||||
gEngfuncs.Host_Error( "%s: full\n", __func__ );
|
||||
|
||||
base = gl_lms.lightmap_buffer;
|
||||
base += ( info->dlight_t * BLOCK_SIZE + info->dlight_s ) * 4;
|
||||
@@ -3738,7 +3738,7 @@ static void GL_CreateSurfaceLightmap( msurface_t *surf, model_t *loadmodel )
|
||||
LM_InitBlock();
|
||||
|
||||
if( !LM_AllocBlock( smax, tmax, &surf->light_s, &surf->light_t ))
|
||||
gEngfuncs.Host_Error( "AllocBlock: full\n" );
|
||||
gEngfuncs.Host_Error( "%s: full\n", __func__ );
|
||||
}
|
||||
|
||||
surf->lightmaptexturenum = gl_lms.current_lightmap_texture;
|
||||
|
||||
@@ -431,7 +431,7 @@ mspriteframe_t *R_GetSpriteFrame( const model_t *pModel, int frame, float yaw )
|
||||
else if( frame >= psprite->numframes )
|
||||
{
|
||||
if( frame > psprite->numframes )
|
||||
gEngfuncs.Con_Printf( S_WARN "R_GetSpriteFrame: no such frame %d (%s)\n", frame, pModel->name );
|
||||
gEngfuncs.Con_Printf( S_WARN "%s: no such frame %d (%s)\n", __func__, frame, pModel->name );
|
||||
frame = psprite->numframes - 1;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ static float R_GetSpriteFrameInterpolant( cl_entity_t *ent, mspriteframe_t **old
|
||||
}
|
||||
else if( frame >= psprite->numframes )
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_WARN "R_GetSpriteFrameInterpolant: no such frame %d (%s)\n", frame, ent->model->name );
|
||||
gEngfuncs.Con_Reportf( S_WARN "%s: no such frame %d (%s)\n", __func__, frame, ent->model->name );
|
||||
frame = psprite->numframes - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ static void ClipSkyPolygon( int nump, vec3_t vecs, int stage )
|
||||
int i, j;
|
||||
|
||||
if( nump > MAX_CLIP_VERTS )
|
||||
gEngfuncs.Host_Error( "ClipSkyPolygon: MAX_CLIP_VERTS\n" );
|
||||
gEngfuncs.Host_Error( "%s: MAX_CLIP_VERTS\n", __func__ );
|
||||
loc1:
|
||||
if( stage == 6 )
|
||||
{
|
||||
|
||||
@@ -872,7 +872,7 @@ static qboolean R_BeamComputePoint( int beamEnt, vec3_t pt )
|
||||
|
||||
if( !ent )
|
||||
{
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "R_BeamComputePoint: invalid entity %i\n", BEAMENT_ENTITY( beamEnt ));
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: invalid entity %i\n", __func__, BEAMENT_ENTITY( beamEnt ));
|
||||
VectorClear( pt );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ static qboolean GAME_EXPORT Mod_ProcessRenderData( model_t *mod, qboolean create
|
||||
// Mod_LoadBrushModel( mod, buf, loaded );
|
||||
break;
|
||||
|
||||
default: gEngfuncs.Host_Error( "Mod_LoadModel: unsupported type %d\n", mod->type );
|
||||
default: gEngfuncs.Host_Error( "%s: unsupported type %d\n", __func__, mod->type );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ void Mod_UnloadTextures( model_t *mod )
|
||||
case mod_sprite:
|
||||
Mod_SpriteUnloadTextures( mod->cache.data );
|
||||
break;
|
||||
default: gEngfuncs.Host_Error( "Mod_UnloadModel: unsupported type %d\n", mod->type );
|
||||
default: gEngfuncs.Host_Error( "%s: unsupported type %d\n", __func__, mod->type );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ static void R_DecalUnlink( decal_t *pdecal )
|
||||
else
|
||||
{
|
||||
tmp = pdecal->psurface->pdecals;
|
||||
if( !tmp ) gEngfuncs.Host_Error( "D_DecalUnlink: bad decal list\n" );
|
||||
if( !tmp ) gEngfuncs.Host_Error( "%s: bad decal list\n", __func__ );
|
||||
|
||||
while( tmp->pnext )
|
||||
{
|
||||
|
||||
@@ -620,7 +620,7 @@ static qboolean GL_UploadTexture( image_t *tex, rgbdata_t *pic )
|
||||
// make sure what target is correct
|
||||
if( tex->target == GL_NONE )
|
||||
{
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "GL_UploadTexture: %s is not supported by your hardware\n", tex->name );
|
||||
gEngfuncs.Con_DPrintf( S_ERROR "%s: %s is not supported by your hardware\n", __func__, tex->name );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ static qboolean GL_UploadTexture( image_t *tex, rgbdata_t *pic )
|
||||
if(( pic->width * pic->height ) & 3 )
|
||||
{
|
||||
// will be resampled, just tell me for debug targets
|
||||
gEngfuncs.Con_Reportf( "GL_UploadTexture: %s s&3 [%d x %d]\n", tex->name, pic->width, pic->height );
|
||||
gEngfuncs.Con_Reportf( "%s: %s s&3 [%d x %d]\n", __func__, tex->name, pic->width, pic->height );
|
||||
}
|
||||
|
||||
buf = pic->buffer;
|
||||
@@ -653,7 +653,7 @@ static qboolean GL_UploadTexture( image_t *tex, rgbdata_t *pic )
|
||||
{
|
||||
// track the buffer bounds
|
||||
if( buf != NULL && buf >= bufend )
|
||||
gEngfuncs.Host_Error( "GL_UploadTexture: %s image buffer overflow\n", tex->name );
|
||||
gEngfuncs.Host_Error( "%s: %s image buffer overflow\n", __func__, tex->name );
|
||||
|
||||
if( ImageCompressed( pic->type ))
|
||||
{
|
||||
@@ -798,7 +798,7 @@ static qboolean GL_CheckTexName( const char *name )
|
||||
// because multi-layered textures can exceed name string
|
||||
if( len >= sizeof( r_images->name ))
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "LoadTexture: too long name %s (%d)\n", name, len);
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: too long name %s (%d)\n", __func__, name, len);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ static image_t *GL_AllocTexture( const char *name, texFlags_t flags )
|
||||
if( i == r_numImages )
|
||||
{
|
||||
if( r_numImages == MAX_TEXTURES )
|
||||
gEngfuncs.Host_Error( "GL_AllocTexture: MAX_TEXTURES limit exceeds\n" );
|
||||
gEngfuncs.Host_Error( "%s: MAX_TEXTURES limit exceeds\n", __func__ );
|
||||
r_numImages++;
|
||||
}
|
||||
|
||||
@@ -883,7 +883,7 @@ static void GL_DeleteTexture( image_t *tex )
|
||||
// debug
|
||||
if( !tex->name[0] )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_DeleteTexture: trying to free unnamed texture\n");
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: trying to free unnamed texture\n", __func__ );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ int GAME_EXPORT GL_LoadTextureFromBuffer( const char *name, rgbdata_t *pic, texF
|
||||
if( update )
|
||||
{
|
||||
if( tex == NULL )
|
||||
gEngfuncs.Host_Error( "GL_LoadTextureFromBuffer: couldn't find texture %s for update\n", name );
|
||||
gEngfuncs.Host_Error( "%s: couldn't find texture %s for update\n", __func__, name );
|
||||
SetBits( tex->flags, flags );
|
||||
}
|
||||
else
|
||||
@@ -1160,19 +1160,19 @@ void GAME_EXPORT GL_ProcessTexture( int texnum, float gamma, int topColor, int b
|
||||
}
|
||||
else
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: bad operation for %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: bad operation for %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !image->original )
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: no input data for %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: no input data for %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ImageCompressed( image->original->type ))
|
||||
{
|
||||
gEngfuncs.Con_Printf( S_ERROR "GL_ProcessTexture: can't process compressed texture %s\n", image->name );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: can't process compressed texture %s\n", __func__, image->name );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1561,7 +1561,7 @@ R_SetupRefParams must be called right before
|
||||
void GAME_EXPORT R_RenderScene( void )
|
||||
{
|
||||
if( !WORLDMODEL && RI.drawWorld )
|
||||
gEngfuncs.Host_Error( "R_RenderView: NULL worldmodel\n" );
|
||||
gEngfuncs.Host_Error( "%s: NULL worldmodel\n", __func__ );
|
||||
|
||||
// frametime is valid only for normal pass
|
||||
if( RP_NORMALPASS( ))
|
||||
|
||||
@@ -363,7 +363,7 @@ static void FloorDivMod (float numer, float denom, int *quotient,
|
||||
{
|
||||
int i;
|
||||
d_pdrawspans = R_PolysetStub;
|
||||
gEngfuncs.Con_Printf( S_ERROR "FloorDivMod: q overflow!\n" );
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: q overflow!\n", __func__ );
|
||||
q = 1;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ static void FloorDivMod (float numer, float denom, int *quotient,
|
||||
{
|
||||
int i;
|
||||
d_pdrawspans = R_PolysetStub;
|
||||
gEngfuncs.Con_Printf( S_ERROR "FloorDivMod: r overflow!\n");
|
||||
gEngfuncs.Con_Printf( S_ERROR "%s: r overflow!\n", __func__ );
|
||||
r = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ mspriteframe_t *R_GetSpriteFrame( const model_t *pModel, int frame, float yaw )
|
||||
else if( frame >= psprite->numframes )
|
||||
{
|
||||
if( frame > psprite->numframes )
|
||||
gEngfuncs.Con_Printf( S_WARN "R_GetSpriteFrame: no such frame %d (%s)\n", frame, pModel->name );
|
||||
gEngfuncs.Con_Printf( S_WARN "%s: no such frame %d (%s)\n", __func__, frame, pModel->name );
|
||||
frame = psprite->numframes - 1;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ static float R_GetSpriteFrameInterpolant( cl_entity_t *ent, mspriteframe_t **old
|
||||
}
|
||||
else if( frame >= psprite->numframes )
|
||||
{
|
||||
gEngfuncs.Con_Reportf( S_WARN "R_GetSpriteFrameInterpolant: no such frame %d (%s)\n", frame, ent->model->name );
|
||||
gEngfuncs.Con_Reportf( S_WARN "%s: no such frame %d (%s)\n", __func__, frame, ent->model->name );
|
||||
frame = psprite->numframes - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1030,15 +1030,15 @@ static surfcache_t *D_SCAlloc (int width, int size)
|
||||
qboolean wrapped_this_time;
|
||||
|
||||
if ((width < 0) )// || (width > 256))
|
||||
gEngfuncs.Host_Error ("D_SCAlloc: bad cache width %d\n", width);
|
||||
gEngfuncs.Host_Error ("%s: bad cache width %d\n", __func__, width);
|
||||
|
||||
if ((size <= 0) || (size > 0x10000000))
|
||||
gEngfuncs.Host_Error ("D_SCAlloc: bad cache size %d\n", size);
|
||||
gEngfuncs.Host_Error ("%s: bad cache size %d\n", __func__, size);
|
||||
|
||||
size = (int)&((surfcache_t *)0)->data[size];
|
||||
size = (size + 3) & ~3;
|
||||
if (size > sc_size)
|
||||
gEngfuncs.Host_Error ("D_SCAlloc: %i > cache size of %i",size, sc_size);
|
||||
gEngfuncs.Host_Error ("%s: %i > cache size of %i", __func__, size, sc_size);
|
||||
|
||||
// if there is not size bytes after the rover, reset to the start
|
||||
wrapped_this_time = false;
|
||||
@@ -1062,7 +1062,7 @@ static surfcache_t *D_SCAlloc (int width, int size)
|
||||
// free another
|
||||
sc_rover = sc_rover->next;
|
||||
if (!sc_rover)
|
||||
gEngfuncs.Host_Error ("D_SCAlloc: hit the end of memory");
|
||||
gEngfuncs.Host_Error ("%s: hit the end of memory", __func__);
|
||||
if (sc_rover->owner)
|
||||
*sc_rover->owner = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user