Merge branch 'SLADE_textures' into 'next'

Treating " as whitespace in TEXTURES (and animdefs too i guess)

SLADE adds this character in its TEXTURES editor and makes SRB2 cry unless the lump is manually edited; this just treats it as whitespace so we don't have to think too hard about it.

Also, two I_Errors now refer to the correct lump name.

See merge request !122
This commit is contained in:
Monster Iestyn 2016-10-09 11:23:01 -04:00
commit 405237d364
2 changed files with 4 additions and 2 deletions

View File

@ -1675,6 +1675,7 @@ char *M_GetToken(const char *inputString)
|| stringToUse[startPos] == '\r'
|| stringToUse[startPos] == '\n'
|| stringToUse[startPos] == '\0'
|| stringToUse[startPos] == '"' // we're treating this as whitespace because SLADE likes adding it for no good reason
|| inComment != 0)
&& startPos < stringLength)
{
@ -1742,6 +1743,7 @@ char *M_GetToken(const char *inputString)
&& stringToUse[endPos] != ','
&& stringToUse[endPos] != '{'
&& stringToUse[endPos] != '}'
&& stringToUse[endPos] != '"' // see above
&& inComment == 0)
&& endPos < stringLength)
{

View File

@ -509,7 +509,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i)
animdefsToken = M_GetToken(NULL);
if (animdefsToken == NULL)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname);
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname);
}
endPos = NULL;
#ifndef AVOID_ERRNO
@ -523,7 +523,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i)
#endif
|| animSpeed < 0) // Number is not positive
{
I_Error("Error parsing TEXTURES lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken);
I_Error("Error parsing ANIMDEFS lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken);
}
animdefs[*i].speed = animSpeed;
Z_Free(animdefsToken);