mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
Small optimization to ESM::Variant
This commit is contained in:
parent
d7f3cd75ac
commit
ce14a6413b
1 changed files with 17 additions and 6 deletions
|
@ -6,6 +6,15 @@
|
|||
#include "esmreader.hpp"
|
||||
#include "variantimp.hpp"
|
||||
|
||||
#include "defs.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
const uint32_t STRV = ESM::FourCC<'S','T','R','V'>::value;
|
||||
const uint32_t INTV = ESM::FourCC<'I','N','T','V'>::value;
|
||||
const uint32_t FLTV = ESM::FourCC<'F','L','T','V'>::value;
|
||||
}
|
||||
|
||||
ESM::Variant::Variant() : mType (VT_None), mData (0) {}
|
||||
|
||||
ESM::Variant::~Variant()
|
||||
|
@ -90,15 +99,17 @@ void ESM::Variant::read (ESMReader& esm, Format format)
|
|||
esm.getSubName();
|
||||
NAME name = esm.retSubName();
|
||||
|
||||
if (name=="STRV")
|
||||
|
||||
|
||||
if (name==STRV)
|
||||
{
|
||||
type = VT_String;
|
||||
}
|
||||
else if (name=="INTV")
|
||||
else if (name==INTV)
|
||||
{
|
||||
type = VT_Int;
|
||||
}
|
||||
else if (name=="FLTV")
|
||||
else if (name==FLTV)
|
||||
{
|
||||
type = VT_Float;
|
||||
}
|
||||
|
@ -111,11 +122,11 @@ void ESM::Variant::read (ESMReader& esm, Format format)
|
|||
esm.getSubName();
|
||||
NAME name = esm.retSubName();
|
||||
|
||||
if (name=="INTV")
|
||||
if (name==INTV)
|
||||
{
|
||||
type = VT_Int;
|
||||
}
|
||||
else if (name=="FLTV")
|
||||
else if (name==FLTV)
|
||||
{
|
||||
type = VT_Float;
|
||||
}
|
||||
|
@ -279,4 +290,4 @@ bool ESM::operator== (const Variant& left, const Variant& right)
|
|||
bool ESM::operator!= (const Variant& left, const Variant& right)
|
||||
{
|
||||
return !(left==right);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue