shaderlists

This commit is contained in:
Thomas Debesse 2018-01-07 20:39:43 +01:00
parent 94849adc93
commit ec946f83d6

View file

@ -469,7 +469,7 @@ void DumpUnreferencedShaders(){
==================
*/
void BuildShaderList(){
int count;
int count, i;
char filename[1024];
char *pBuff;
char dirstring[NAME_MAX];
@ -486,15 +486,18 @@ void BuildShaderList(){
Sys_FPrintf( SYS_ERR, "Couldn't find '%s'\n", g_pGameDescription->mShaderlist.GetBuffer() );
return;
}
for ( i = 0; i < count; i++ )
{
// NOTE TTimo we use vfsGetFullPath solely to get the full path of the shader list we are gonna load
// but we actually send the relative path to vfsLoadFile
// so let's hope there is no disparity between the two functions
if ( !vfsGetFullPath( filename, 0, 0 ) ) {
if ( !vfsGetFullPath( filename, i, 0 ) ) {
Sys_FPrintf( SYS_ERR, "Couldn't find full path for '%s'\n", g_pGameDescription->mShaderlist.GetBuffer() );
return;
}
Sys_Printf( "Parsing shader files from %s\n", vfsGetFullPath( filename, 0, 0 ) );
nLen = vfsLoadFile( filename, reinterpret_cast<void**>( &pBuff ), 0 );
Sys_Printf( "Parsing shader files from %s\n", vfsGetFullPath( filename, i, 0 ) );
nLen = vfsLoadFile( filename, reinterpret_cast<void**>( &pBuff ), i );
if ( nLen > 0 ) {
StartTokenParsing( pBuff );
nLen = 0;
@ -523,6 +526,7 @@ void BuildShaderList(){
g_free( pBuff );
}
}
}
}
/*
@ -1088,7 +1092,7 @@ void Texture_ShowStartupShaders(){
}
if ( g_PrefsDlg.m_nShader == PrefsDlg::SHADER_ALL ) {
int count;
int count, i;
char filename[1024];
char *pBuff;
char dirstring[NAME_MAX];
@ -1107,8 +1111,10 @@ void Texture_ShowStartupShaders(){
return;
}
Sys_Printf( "Parsing shader files from %s\n", vfsGetFullPath( filename, 0, 0 ) );
nLen = vfsLoadFile( filename, reinterpret_cast<void**>( &pBuff ), 0 );
for ( i = 0; i < count; i++ )
{
Sys_Printf( "Parsing shader files from %s\n", vfsGetFullPath( filename, i, 0 ) );
nLen = vfsLoadFile( filename, reinterpret_cast<void**>( &pBuff ), i );
if ( nLen > 0 ) {
StartTokenParsing( pBuff );
nLen = 0;
@ -1139,6 +1145,7 @@ void Texture_ShowStartupShaders(){
g_free( pBuff );
}
}
}
}
/*