Browse Source

ref: add size argument to COM_FileBase calls

pull/2/head
Alibek Omarov 2 years ago
parent
commit
8b96e7ca87
  1. 2
      ref/gl/gl_alias.c
  2. 2
      ref/gl/gl_backend.c
  3. 2
      ref/gl/gl_decals.c
  4. 4
      ref/gl/gl_image.c
  5. 2
      ref/gl/gl_studio.c
  6. 2
      ref/soft/r_decals.c
  7. 2
      ref/soft/r_studio.c

2
ref/gl/gl_alias.c

@ -443,7 +443,7 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height ) @@ -443,7 +443,7 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
}
}
COM_FileBase( loadmodel->name, name );
COM_FileBase( loadmodel->name, name, sizeof( name ));
// for alias models only player can have remap textures
if( mod != NULL && !Q_stricmp( name, "player" ))

2
ref/gl/gl_backend.c

@ -689,7 +689,7 @@ rebuild_page: @@ -689,7 +689,7 @@ rebuild_page:
if( FBitSet( image->flags, TF_DEPTHMAP ) && !FBitSet( image->flags, TF_NOCOMPARE ))
pglTexParameteri( image->target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB );
COM_FileBase( image->name, shortname );
COM_FileBase( image->name, shortname, sizeof( shortname ));
if( Q_strlen( shortname ) > 18 )
{
// cutoff too long names, it looks ugly

2
ref/gl/gl_decals.c

@ -1188,7 +1188,7 @@ int R_CreateDecalList( decallist_t *pList ) @@ -1188,7 +1188,7 @@ int R_CreateDecalList( decallist_t *pList )
pList[total].scale = decal->scale;
R_DecalUnProject( decal, &pList[total] );
COM_FileBase( R_GetTexture( decal->texture )->name, pList[total].name );
COM_FileBase( R_GetTexture( decal->texture )->name, pList[total].name, sizeof( pList[total].name ));
// check to see if the decal should be added
total = DecalListAdd( pList, total );

4
ref/gl/gl_image.c

@ -1587,7 +1587,7 @@ int GL_LoadTextureArray( const char **names, int flags ) @@ -1587,7 +1587,7 @@ int GL_LoadTextureArray( const char **names, int flags )
// create complexname from layer names
for( i = 0; i < numLayers - 1; i++ )
{
COM_FileBase( names[i], basename );
COM_FileBase( names[i], basename, sizeof( basename ));
ret = Q_snprintf( &name[len], sizeof( name ) - len, "%s|", basename );
if( ret == -1 )
@ -1596,7 +1596,7 @@ int GL_LoadTextureArray( const char **names, int flags ) @@ -1596,7 +1596,7 @@ int GL_LoadTextureArray( const char **names, int flags )
len += ret;
}
COM_FileBase( names[i], basename );
COM_FileBase( names[i], basename, sizeof( basename ));
ret = Q_snprintf( &name[len], sizeof( name ) - len, "%s[%i]", basename, numLayers );
if( ret == -1 )

2
ref/gl/gl_studio.c

@ -3757,7 +3757,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture @@ -3757,7 +3757,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture
}
Q_strncpy( mdlname, mod->name, sizeof( mdlname ));
COM_FileBase( ptexture->name, name );
COM_FileBase( ptexture->name, name, sizeof( name ));
COM_StripExtension( mdlname );
if( FBitSet( ptexture->flags, STUDIO_NF_NOMIPS ))

2
ref/soft/r_decals.c

@ -1200,7 +1200,7 @@ int GAME_EXPORT R_CreateDecalList( decallist_t *pList ) @@ -1200,7 +1200,7 @@ int GAME_EXPORT R_CreateDecalList( decallist_t *pList )
pList[total].scale = decal->scale;
R_DecalUnProject( decal, &pList[total] );
COM_FileBase( R_GetTexture( decal->texture )->name, pList[total].name );
COM_FileBase( R_GetTexture( decal->texture )->name, pList[total].name, sizeof( pList[total].name ));
// check to see if the decal should be added
total = DecalListAdd( pList, total );

2
ref/soft/r_studio.c

@ -3537,7 +3537,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture @@ -3537,7 +3537,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture
}
Q_strncpy( mdlname, mod->name, sizeof( mdlname ));
COM_FileBase( ptexture->name, name );
COM_FileBase( ptexture->name, name, sizeof( name ));
COM_StripExtension( mdlname );
if( FBitSet( ptexture->flags, STUDIO_NF_NOMIPS ))

Loading…
Cancel
Save