mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-22 10:11:05 +00:00
Hijack the TEXTURES parser for UDMF usage. :)
This commit is contained in:
parent
47f6949464
commit
da6dde1a5f
2 changed files with 18 additions and 0 deletions
|
@ -460,6 +460,8 @@ extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
|
|||
char *va(const char *format, ...) FUNCPRINTF;
|
||||
char *M_GetToken(const char *inputString);
|
||||
void M_UnGetToken(void);
|
||||
UINT32 M_GetTokenPos(void);
|
||||
void M_SetTokenPos(UINT32 newPos);
|
||||
char *sizeu1(size_t num);
|
||||
char *sizeu2(size_t num);
|
||||
char *sizeu3(size_t num);
|
||||
|
|
16
src/m_misc.c
16
src/m_misc.c
|
@ -1784,6 +1784,7 @@ char *M_GetToken(const char *inputString)
|
|||
|| stringToUse[startPos] == '\n'
|
||||
|| stringToUse[startPos] == '\0'
|
||||
|| stringToUse[startPos] == '"' // we're treating this as whitespace because SLADE likes adding it for no good reason
|
||||
|| stringToUse[startPos] == '=' || stringToUse[startPos] == ';' // UDMF TEXTMAP.
|
||||
|| inComment != 0)
|
||||
&& startPos < stringLength)
|
||||
{
|
||||
|
@ -1852,6 +1853,7 @@ char *M_GetToken(const char *inputString)
|
|||
&& stringToUse[endPos] != '{'
|
||||
&& stringToUse[endPos] != '}'
|
||||
&& stringToUse[endPos] != '"' // see above
|
||||
&& stringToUse[startPos] != '=' && stringToUse[startPos] != ';' // UDMF TEXTMAP.
|
||||
&& inComment == 0)
|
||||
&& endPos < stringLength)
|
||||
{
|
||||
|
@ -1895,6 +1897,20 @@ void M_UnGetToken(void)
|
|||
endPos = oldendPos;
|
||||
}
|
||||
|
||||
/** Returns the current token's position.
|
||||
*/
|
||||
UINT32 M_GetTokenPos(void)
|
||||
{
|
||||
return endPos;
|
||||
}
|
||||
|
||||
/** Sets the current token's position.
|
||||
*/
|
||||
void M_SetTokenPos(UINT32 newPos)
|
||||
{
|
||||
endPos = newPos;
|
||||
}
|
||||
|
||||
/** Count bits in a number.
|
||||
*/
|
||||
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
||||
|
|
Loading…
Reference in a new issue