OpenGL2: Fix parsing q3gl2_sun without two additional tokens
If mapLightScale and shadowScale weren't included at the end of q3gl2_sun, the next shader line was skipped by SkipRestOfLine(). COM_ParseExt() with allowLineBreaks=qfalse, returns "" once and then goes to the next line anyway. (Doesn't work well multiple "optional" tokens. It looks like a vanilla bug.)
This commit is contained in:
1 parent
ae0878ca61
commit
b07ff2a3ca
1 file changed
+9
-4
@@ -1841,12 +1841,17 @@ static qboolean ParseShader( char **text )
|
||||
tr.sunShadowScale = atof(token);
|
||||
|
||||
// parse twice, since older shaders may include mapLightScale before sunShadowScale
|
||||
token = COM_ParseExt( text, qfalse );
|
||||
if (token[0])
|
||||
tr.sunShadowScale = atof(token);
|
||||
if (token[0]) {
|
||||
token = COM_ParseExt( text, qfalse );
|
||||
if (token[0]) {
|
||||
tr.sunShadowScale = atof(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SkipRestOfLine( text );
|
||||
if (token[0]) {
|
||||
SkipRestOfLine( text );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// tonemap parms
|
||||
|
||||
Reference in new issue
Block a user