mirror of
https://github.com/ioquake/ioq3.git
synced 2025-02-21 11:11:20 +00:00
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:
parent
ae0878ca61
commit
b07ff2a3ca
1 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue