gzdoom-gles/src/maploader/udmf.h

44 lines
771 B
C
Raw Normal View History

2016-03-01 15:47:10 +00:00
#ifndef __P_UDMF_H
#define __P_UDMF_H
#include "sc_man.h"
#include "m_fixed.h"
class UDMFParserBase
{
protected:
FScanner sc;
FName namespc = NAME_None;
2016-03-01 15:47:10 +00:00
int namespace_bits;
FString parsedString;
bool BadCoordinates = false;
2016-03-01 15:47:10 +00:00
void Skip();
FName ParseKey(bool checkblock = false, bool *isblock = NULL);
int CheckInt(const char *key);
double CheckFloat(const char *key);
double CheckCoordinate(const char *key);
DAngle CheckAngle(const char *key);
2016-03-01 15:47:10 +00:00
bool CheckBool(const char *key);
const char *CheckString(const char *key);
template<typename T>
bool Flag(T &value, int mask, const char *key)
2016-03-01 15:47:10 +00:00
{
if (CheckBool(key))
{
2016-03-01 15:47:10 +00:00
value |= mask;
return true;
}
2016-03-01 15:47:10 +00:00
else
{
2016-03-01 15:47:10 +00:00
value &= ~mask;
return false;
}
2016-03-01 15:47:10 +00:00
}
};
#define BLOCK_ID (ENamedName)-1
#endif