forked from teamnwah/openmw-tes3coop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
554 B
C++
33 lines
554 B
C++
#ifndef _ESM_GLOB_H
|
|
#define _ESM_GLOB_H
|
|
|
|
#include "esm_reader.hpp"
|
|
|
|
namespace ESM {
|
|
|
|
/*
|
|
* Global script variables
|
|
*/
|
|
|
|
struct Global
|
|
{
|
|
unsigned value;
|
|
VarType type;
|
|
|
|
void load(ESMReader &esm)
|
|
{
|
|
VarType t;
|
|
std::string tmp = esm.getHNString("FNAM");
|
|
if(tmp == "s") t = VT_Short;
|
|
else if(tmp == "l") t = VT_Int;
|
|
else if(tmp == "f") t = VT_Float;
|
|
else esm.fail("Illegal global variable type " + tmp);
|
|
type = t;
|
|
|
|
// Note: Both floats and longs are represented as floats.
|
|
esm.getHNT(value, "FLTV");
|
|
}
|
|
};
|
|
}
|
|
#endif
|