Browse Source

Some fixes for PM_InitTextureTypes() from ReGameDLL_CS

caseclosed
Alibek Omarov 7 years ago
parent
commit
d17387c61f
  1. 13
      pm_shared/pm_shared.c

13
pm_shared/pm_shared.c

@ -168,24 +168,23 @@ void PM_InitTextureTypes()
char buffer[512]; char buffer[512];
int i, j; int i, j;
byte *pMemFile; byte *pMemFile;
int fileSize, filePos; int fileSize, filePos = 0;
static qboolean bTextureTypeInit = false; static qboolean bTextureTypeInit = false;
if( bTextureTypeInit ) if( bTextureTypeInit )
return; return;
memset(&( grgszTextureName[0][0] ), 0, CTEXTURESMAX * CBTEXTURENAMEMAX ); memset(&( grgszTextureName[0][0] ), 0, sizeof( grgszTextureName ) );
memset( grgchTextureType, 0, CTEXTURESMAX ); memset( grgchTextureType, 0, sizeof( grgchTextureType ) );
gcTextures = 0; gcTextures = 0;
fileSize = pmove->COM_FileSize( "sound/materials.txt" ); pMemFile = pmove->COM_LoadFile( "sound/materials.txt", 5, &fileSize );
pMemFile = pmove->COM_LoadFile( "sound/materials.txt", 5, NULL );
if( !pMemFile ) if( !pMemFile )
return; return;
memset( buffer, 0, 512 ); memset( buffer, 0, sizeof( buffer ) );
filePos = 0;
// for each line in the file... // for each line in the file...
while( pmove->memfgets( pMemFile, fileSize, &filePos, buffer, 511 ) != NULL && (gcTextures < CTEXTURESMAX ) ) while( pmove->memfgets( pMemFile, fileSize, &filePos, buffer, 511 ) != NULL && (gcTextures < CTEXTURESMAX ) )
{ {

Loading…
Cancel
Save