|
|
@ -18,20 +18,6 @@
|
|
|
|
// inlines CPersistentDataRecord
|
|
|
|
// inlines CPersistentDataRecord
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
union C64BitParts
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
struct
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32 i32_1;
|
|
|
|
|
|
|
|
uint32 i32_2;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sint64 s64;
|
|
|
|
|
|
|
|
uint64 u64;
|
|
|
|
|
|
|
|
double d;
|
|
|
|
|
|
|
|
float f;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void CPersistentDataRecord::addString(const std::string& name,uint16 &result)
|
|
|
|
inline void CPersistentDataRecord::addString(const std::string& name,uint16 &result)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// check whether the value of 'result' is already correct
|
|
|
|
// check whether the value of 'result' is already correct
|
|
|
@ -110,8 +96,8 @@ inline void CPersistentDataRecord::push(TToken token,sint32 val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,sint64 val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,sint64 val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
C64BitParts valueInBits;
|
|
|
|
NLMISC::C64BitsParts valueInBits;
|
|
|
|
valueInBits.s64 = val;
|
|
|
|
valueInBits.i64[0] = val;
|
|
|
|
|
|
|
|
|
|
|
|
// make sure the token is valid
|
|
|
|
// make sure the token is valid
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
#ifdef NL_DEBUG
|
|
|
@ -120,9 +106,9 @@ inline void CPersistentDataRecord::push(TToken token,sint64 val)
|
|
|
|
|
|
|
|
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_1);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[0]);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::SINT_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::SINT_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_2);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,uint8 val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,uint8 val)
|
|
|
@ -164,8 +150,8 @@ inline void CPersistentDataRecord::push(TToken token,uint32 val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,uint64 val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,uint64 val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
C64BitParts valueInBits;
|
|
|
|
NLMISC::C64BitsParts valueInBits;
|
|
|
|
valueInBits.u64 = val;
|
|
|
|
valueInBits.u64[0] = val;
|
|
|
|
|
|
|
|
|
|
|
|
// make sure the token is valid
|
|
|
|
// make sure the token is valid
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
#ifdef NL_DEBUG
|
|
|
@ -174,15 +160,15 @@ inline void CPersistentDataRecord::push(TToken token,uint64 val)
|
|
|
|
|
|
|
|
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_1);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[0]);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::UINT_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::UINT_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_2);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,float val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,float val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
C64BitParts valueInBits;
|
|
|
|
NLMISC::C64BitsParts valueInBits;
|
|
|
|
valueInBits.f = val;
|
|
|
|
valueInBits.f[0] = val;
|
|
|
|
|
|
|
|
|
|
|
|
// make sure the token is valid
|
|
|
|
// make sure the token is valid
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
#ifdef NL_DEBUG
|
|
|
@ -191,14 +177,14 @@ inline void CPersistentDataRecord::push(TToken token,float val)
|
|
|
|
|
|
|
|
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::FLOAT_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::FLOAT_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_1);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,double val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,double val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
// create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value
|
|
|
|
C64BitParts valueInBits;
|
|
|
|
NLMISC::C64BitsParts valueInBits;
|
|
|
|
valueInBits.d = val;
|
|
|
|
valueInBits.d[0] = val;
|
|
|
|
|
|
|
|
|
|
|
|
// make sure the token is valid
|
|
|
|
// make sure the token is valid
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
#ifdef NL_DEBUG
|
|
|
@ -207,9 +193,9 @@ inline void CPersistentDataRecord::push(TToken token,double val)
|
|
|
|
|
|
|
|
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
// store the token and value to the relavent data buffers
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::EXTEND_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_1);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[0]);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::FLOAT_TOKEN);
|
|
|
|
_TokenTable.push_back((token<<3)+CArg::FLOAT_TOKEN);
|
|
|
|
_ArgTable.push_back(valueInBits.i32_2);
|
|
|
|
_ArgTable.push_back(valueInBits.u32[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,const std::string& val)
|
|
|
|
inline void CPersistentDataRecord::push(TToken token,const std::string& val)
|
|
|
|