|
|
@ -108,11 +108,9 @@ public: |
|
|
|
void plStateVarNotificationInfo::Read(hsStream* s, uint32_t readOptions) |
|
|
|
void plStateVarNotificationInfo::Read(hsStream* s, uint32_t readOptions) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t saveFlags=s->ReadByte(); // unused
|
|
|
|
uint8_t saveFlags=s->ReadByte(); // unused
|
|
|
|
char* hint=s->ReadSafeString(); |
|
|
|
plString hint=s->ReadSafeString_TEMP(); |
|
|
|
if (hint && !(readOptions & plSDL::kSkipNotificationInfo)) |
|
|
|
if (!hint.IsNull() && !(readOptions & plSDL::kSkipNotificationInfo)) |
|
|
|
fHintString = (const char*)hint; |
|
|
|
fHintString = hint; |
|
|
|
// we're done with it...
|
|
|
|
|
|
|
|
delete[] hint; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plStateVarNotificationInfo::Write(hsStream* s, uint32_t writeOptions) const |
|
|
|
void plStateVarNotificationInfo::Write(hsStream* s, uint32_t writeOptions) const |
|
|
@ -212,8 +210,8 @@ void plSimpleStateVariable::IDeAlloc() |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
hsAssert(false, xtl::format("undefined atomic type:%d var:%s cnt:%d",
|
|
|
|
hsAssert(false, plString::Format("undefined atomic type:%d var:%s cnt:%d", |
|
|
|
type, GetName() ? GetName() : "?", GetCount()).c_str()); |
|
|
|
type, GetName().c_str("?"), GetCount()).c_str()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -328,12 +326,11 @@ void plSimpleStateVariable::TimeStamp( const plUnifiedTime & ut/*=plUnifiedTime: |
|
|
|
//
|
|
|
|
//
|
|
|
|
// Set value from string. Used to set default values which are specified as strings.
|
|
|
|
// Set value from string. Used to set default values which are specified as strings.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
bool plSimpleStateVariable::SetFromString(const char* valueConst, int idx, bool timeStampNow) |
|
|
|
bool plSimpleStateVariable::SetFromString(const plString& value, int idx, bool timeStampNow) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!valueConst) |
|
|
|
if (value.IsNull()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
std::string value = valueConst; |
|
|
|
|
|
|
|
plVarDescriptor::Type type=fVar.GetAtomicType(); |
|
|
|
plVarDescriptor::Type type=fVar.GetAtomicType(); |
|
|
|
switch(type) |
|
|
|
switch(type) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -346,54 +343,47 @@ bool plSimpleStateVariable::SetFromString(const char* valueConst, int idx, bool |
|
|
|
case plVarDescriptor::kByte: |
|
|
|
case plVarDescriptor::kByte: |
|
|
|
{
|
|
|
|
{
|
|
|
|
// handles value in the form "(i,j,k)" for vectors
|
|
|
|
// handles value in the form "(i,j,k)" for vectors
|
|
|
|
static char seps[] = "( ,)"; |
|
|
|
std::vector<plString> bits = value.Tokenize("( ,)"); |
|
|
|
char* ptr = strtok( (char*)value.c_str(), seps ); |
|
|
|
|
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
while (ptr) |
|
|
|
for (std::vector<plString>::iterator ptr = bits.begin(); ptr != bits.end(); ++ptr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ((type==plVarDescriptor::kInt) && fI) |
|
|
|
if ((type==plVarDescriptor::kInt) && fI) |
|
|
|
fI[i++] = atoi(ptr); |
|
|
|
fI[i++] = ptr->ToInt(); |
|
|
|
else if (type==plVarDescriptor::kShort && fS) |
|
|
|
else if (type==plVarDescriptor::kShort && fS) |
|
|
|
fS[i++] = (short)atoi(ptr); |
|
|
|
fS[i++] = static_cast<short>(ptr->ToInt()); |
|
|
|
else if (type==plVarDescriptor::kByte && fBy) |
|
|
|
else if (type==plVarDescriptor::kByte && fBy) |
|
|
|
fBy[i++] = (uint8_t)atoi(ptr); |
|
|
|
fBy[i++] = static_cast<uint8_t>(ptr->ToInt()); |
|
|
|
else if ( (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) && fF) |
|
|
|
else if ( (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) && fF) |
|
|
|
fF[i++] = (float)atof(ptr); |
|
|
|
fF[i++] = static_cast<float>(ptr->ToFloat()); |
|
|
|
else if ( (type==plVarDescriptor::kDouble || type==plVarDescriptor::kTime) && fD) |
|
|
|
else if ( (type==plVarDescriptor::kDouble || type==plVarDescriptor::kTime) && fD) |
|
|
|
fD[i++] = atof(ptr); |
|
|
|
fD[i++] = ptr->ToDouble(); |
|
|
|
ptr = strtok(nil, seps); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case plVarDescriptor::kBool: |
|
|
|
case plVarDescriptor::kBool: |
|
|
|
{
|
|
|
|
{
|
|
|
|
// handles value in the form "(i,j,k)" for things like vectors
|
|
|
|
// handles value in the form "(i,j,k)" for things like vectors
|
|
|
|
static char seps[] = "( ,)"; |
|
|
|
std::vector<plString> bits = value.Tokenize("( ,)"); |
|
|
|
char* ptr = strtok( (char*)value.c_str(), seps ); |
|
|
|
|
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
while (ptr) |
|
|
|
for (std::vector<plString>::iterator ptr = bits.begin(); ptr != bits.end(); ++ptr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!stricmp(ptr, "true")) |
|
|
|
if (!ptr->CompareI("true")) |
|
|
|
fB[i++]=true; |
|
|
|
fB[i++]=true; |
|
|
|
else |
|
|
|
else if (!ptr->CompareI("false")) |
|
|
|
if (!stricmp(ptr, "false")) |
|
|
|
|
|
|
|
fB[i++]=false; |
|
|
|
fB[i++]=false; |
|
|
|
else |
|
|
|
else |
|
|
|
fB[i++] = (atoi(ptr) != 0); |
|
|
|
fB[i++] = (ptr->ToInt() != 0); |
|
|
|
ptr = strtok(nil, seps); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case plVarDescriptor::kString32: |
|
|
|
case plVarDescriptor::kString32: |
|
|
|
{
|
|
|
|
{
|
|
|
|
// handles value in the form "(i,j,k)" for things like vectors
|
|
|
|
// handles value in the form "(i,j,k)" for things like vectors
|
|
|
|
static char seps[] = "( ,)"; |
|
|
|
std::vector<plString> bits = value.Tokenize("( ,)"); |
|
|
|
char* ptr = strtok( (char*)value.c_str(), seps ); |
|
|
|
|
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
while (ptr) |
|
|
|
for (std::vector<plString>::iterator ptr = bits.begin(); ptr != bits.end(); ++ptr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
hsStrncpy(fS32[i++], ptr, 32); |
|
|
|
hsStrncpy(fS32[i++], ptr->c_str(), 32); |
|
|
|
ptr = strtok(nil, seps); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
@ -419,12 +409,12 @@ void plSimpleStateVariable::IVarSet(bool timeStampNow/*=true*/) |
|
|
|
//
|
|
|
|
//
|
|
|
|
// Get value as string.
|
|
|
|
// Get value as string.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
plString plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
int j; |
|
|
|
int j; |
|
|
|
std::string str; |
|
|
|
plString str; |
|
|
|
if (fVar.GetAtomicCount()>1) |
|
|
|
if (fVar.GetAtomicCount()>1) |
|
|
|
str = str + "("; |
|
|
|
str += "("; |
|
|
|
|
|
|
|
|
|
|
|
plVarDescriptor::Type type=fVar.GetAtomicType(); |
|
|
|
plVarDescriptor::Type type=fVar.GetAtomicType(); |
|
|
|
switch(type) |
|
|
|
switch(type) |
|
|
@ -442,20 +432,20 @@ char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (type==plVarDescriptor::kInt) |
|
|
|
if (type==plVarDescriptor::kInt) |
|
|
|
str.append( xtl::format( "%d", fI[i++]) ); |
|
|
|
str += plString::Format( "%d", fI[i++]); |
|
|
|
else if (type==plVarDescriptor::kShort) |
|
|
|
else if (type==plVarDescriptor::kShort) |
|
|
|
str.append( xtl::format( "%d", fS[i++]) ); |
|
|
|
str += plString::Format( "%d", fS[i++]); |
|
|
|
else if (type==plVarDescriptor::kByte) |
|
|
|
else if (type==plVarDescriptor::kByte) |
|
|
|
str.append( xtl::format( "%d", fBy[i++]) ); |
|
|
|
str += plString::Format( "%d", fBy[i++]); |
|
|
|
else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) |
|
|
|
else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) |
|
|
|
str.append( xtl::format( "%.3f", fF[i++]) ); |
|
|
|
str += plString::Format( "%.3f", fF[i++]); |
|
|
|
else if (type==plVarDescriptor::kDouble) |
|
|
|
else if (type==plVarDescriptor::kDouble) |
|
|
|
str.append( xtl::format( "%.3f", fD[i++]) ); |
|
|
|
str += plString::Format( "%.3f", fD[i++]); |
|
|
|
else if (type==plVarDescriptor::kTime) |
|
|
|
else if (type==plVarDescriptor::kTime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
double tmp; |
|
|
|
double tmp; |
|
|
|
Get(&tmp, i++); |
|
|
|
Get(&tmp, i++); |
|
|
|
str.append( xtl::format( "%.3f", tmp) ); |
|
|
|
str += plString::Format( "%.3f", tmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
@ -474,7 +464,7 @@ char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
str.append( xtl::format( "%s", fB[i++] ? "true" : "false") ); |
|
|
|
str += plString::Format( "%s", fB[i++] ? "true" : "false"); |
|
|
|
|
|
|
|
|
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -492,7 +482,7 @@ char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
str.append( xtl::format( "%s", fS32[i++]) ); |
|
|
|
str += plString::Format( "%s", fS32[i++]); |
|
|
|
|
|
|
|
|
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -510,7 +500,7 @@ char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
int i=idx*fVar.GetAtomicCount(); |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
for(j=0;j<fVar.GetAtomicCount();j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
str.append( xtl::format( "%s", "other") ); |
|
|
|
str += "other"; |
|
|
|
|
|
|
|
|
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
if (j==fVar.GetAtomicCount()-1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -524,7 +514,7 @@ char* plSimpleStateVariable::GetAsString(int idx) const |
|
|
|
break; |
|
|
|
break; |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return hsStrcpy(str.c_str()); |
|
|
|
return str; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -2131,7 +2121,7 @@ case type: \ |
|
|
|
} \
|
|
|
|
} \
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other, const char* sdlName) |
|
|
|
void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other, const plString& sdlName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fChangeNotifiers.size()==0) |
|
|
|
if (fChangeNotifiers.size()==0) |
|
|
|
return; |
|
|
|
return; |
|
|
@ -2174,8 +2164,8 @@ void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other |
|
|
|
if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging()) |
|
|
|
if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
plNetObjectDebuggerBase::GetInstance()->LogMsg( |
|
|
|
plNetObjectDebuggerBase::GetInstance()->LogMsg( |
|
|
|
xtl::format("Var %s did %s send notification difference. Has %d notifiers with %d recipients.",
|
|
|
|
plString::Format("Var %s did %s send notification difference. Has %d notifiers with %d recipients.", |
|
|
|
GetName(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str()); |
|
|
|
GetName().c_str(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -2290,12 +2280,12 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons |
|
|
|
if (!dbg) |
|
|
|
if (!dbg) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
std::string pad; |
|
|
|
plString pad; |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
for(i=0;i<level; i++) |
|
|
|
for(i=0;i<level; i++) |
|
|
|
pad += " "; |
|
|
|
pad += " "; |
|
|
|
|
|
|
|
|
|
|
|
std::string logMsg = xtl::format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName(), GetCount()); |
|
|
|
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount()); |
|
|
|
if (GetCount()>1) |
|
|
|
if (GetCount()>1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
dbg->LogMsg(logMsg.c_str()); // it's going to be a long msg, so print it on its own line
|
|
|
|
dbg->LogMsg(logMsg.c_str()); // it's going to be a long msg, so print it on its own line
|
|
|
@ -2305,22 +2295,21 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons |
|
|
|
pad += "\t"; |
|
|
|
pad += "\t"; |
|
|
|
for(i=0;i<GetCount(); i++) |
|
|
|
for(i=0;i<GetCount(); i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char* s=GetAsString(i); |
|
|
|
plString s=GetAsString(i); |
|
|
|
if (fVar.GetAtomicType() == plVarDescriptor::kTime) |
|
|
|
if (fVar.GetAtomicType() == plVarDescriptor::kTime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char* p=fT[i].PrintWMillis(); |
|
|
|
const char* p=fT[i].PrintWMillis(); |
|
|
|
logMsg += xtl::format( "%sVar:%d gameTime:%s pst:%s ts:%s",
|
|
|
|
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", |
|
|
|
pad.c_str(), i, s ? s : "?", p, fTimeStamp.Format("%c").c_str() ); |
|
|
|
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
logMsg +=xtl::format( "%sVar:%d value:%s ts:%s",
|
|
|
|
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", |
|
|
|
pad.c_str(), i, s ? s : "?", fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); |
|
|
|
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); |
|
|
|
} |
|
|
|
} |
|
|
|
delete [] s; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !dirtyOnly ) |
|
|
|
if ( !dirtyOnly ) |
|
|
|
logMsg += xtl::format( " dirty:%d", IsDirty() ); |
|
|
|
logMsg += plString::Format( " dirty:%d", IsDirty() ); |
|
|
|
|
|
|
|
|
|
|
|
dbg->LogMsg(logMsg.c_str()); |
|
|
|
dbg->LogMsg(logMsg.c_str()); |
|
|
|
logMsg = ""; |
|
|
|
logMsg = ""; |
|
|
@ -2329,12 +2318,12 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons |
|
|
|
|
|
|
|
|
|
|
|
void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level) const |
|
|
|
void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string pad; |
|
|
|
plString pad; |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
for(i=0;i<level; i++) |
|
|
|
for(i=0;i<level; i++) |
|
|
|
pad += " "; |
|
|
|
pad += " "; |
|
|
|
|
|
|
|
|
|
|
|
std::string logMsg = xtl::format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName(), GetCount()); |
|
|
|
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount()); |
|
|
|
if (GetCount()>1) |
|
|
|
if (GetCount()>1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
stream->WriteString(logMsg.c_str()); // it's going to be a long msg, so print it on its own line
|
|
|
|
stream->WriteString(logMsg.c_str()); // it's going to be a long msg, so print it on its own line
|
|
|
@ -2344,22 +2333,21 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l |
|
|
|
pad += "\t"; |
|
|
|
pad += "\t"; |
|
|
|
for(i=0;i<GetCount(); i++) |
|
|
|
for(i=0;i<GetCount(); i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char* s=GetAsString(i); |
|
|
|
plString s=GetAsString(i); |
|
|
|
if (fVar.GetAtomicType() == plVarDescriptor::kTime) |
|
|
|
if (fVar.GetAtomicType() == plVarDescriptor::kTime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char* p=fT[i].PrintWMillis(); |
|
|
|
const char* p=fT[i].PrintWMillis(); |
|
|
|
logMsg += xtl::format( "%sVar:%d gameTime:%s pst:%s ts:%s",
|
|
|
|
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", |
|
|
|
pad.c_str(), i, s ? s : "?", p, fTimeStamp.Format("%c").c_str() ); |
|
|
|
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
logMsg +=xtl::format( "%sVar:%d value:%s ts:%s",
|
|
|
|
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", |
|
|
|
pad.c_str(), i, s ? s : "?", fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); |
|
|
|
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); |
|
|
|
} |
|
|
|
} |
|
|
|
delete [] s; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !dirtyOnly ) |
|
|
|
if ( !dirtyOnly ) |
|
|
|
logMsg += xtl::format( " dirty:%d", IsDirty() ); |
|
|
|
logMsg += plString::Format( " dirty:%d", IsDirty() ); |
|
|
|
|
|
|
|
|
|
|
|
stream->WriteString(logMsg.c_str()); |
|
|
|
stream->WriteString(logMsg.c_str()); |
|
|
|
logMsg = ""; |
|
|
|
logMsg = ""; |
|
|
@ -2497,9 +2485,9 @@ void plSDStateVariable::CopyFrom(plSDStateVariable* other, uint32_t writeOptions |
|
|
|
//
|
|
|
|
//
|
|
|
|
void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/) |
|
|
|
void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/) |
|
|
|
{ |
|
|
|
{ |
|
|
|
hsAssert(!stricmp(other->GetSDVarDescriptor()->GetName(), fVarDescriptor->GetName()),
|
|
|
|
hsAssert(!other->GetSDVarDescriptor()->GetName().CompareI(fVarDescriptor->GetName()), |
|
|
|
xtl::format("var descriptor mismatch in UpdateFrom, name %s,%s ver %d,%d", |
|
|
|
plString::Format("var descriptor mismatch in UpdateFrom, name %s,%s ver %d,%d", |
|
|
|
GetName(), other->GetName()).c_str()); |
|
|
|
GetName().c_str(), other->GetName().c_str()).c_str()); |
|
|
|
Resize(other->GetCount()); // make sure sizes match
|
|
|
|
Resize(other->GetCount()); // make sure sizes match
|
|
|
|
|
|
|
|
|
|
|
|
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); |
|
|
|
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); |
|
|
@ -2521,8 +2509,8 @@ void plSDStateVariable::ConvertTo(plSDStateVariable* otherSDVar, bool force ) |
|
|
|
plStateDescriptor* otherSD=otherSDVar->GetSDVarDescriptor()->GetStateDescriptor(); |
|
|
|
plStateDescriptor* otherSD=otherSDVar->GetSDVarDescriptor()->GetStateDescriptor(); |
|
|
|
|
|
|
|
|
|
|
|
hsLogEntry( plNetApp::StaticDebugMsg( "SDSV(%p) converting %s from %s to %s (force:%d)", |
|
|
|
hsLogEntry( plNetApp::StaticDebugMsg( "SDSV(%p) converting %s from %s to %s (force:%d)", |
|
|
|
this, fVarDescriptor->GetName(), fVarDescriptor->GetTypeString(), |
|
|
|
this, fVarDescriptor->GetName().c_str(), fVarDescriptor->GetTypeString().c_str(), |
|
|
|
otherSDVar->GetSDVarDescriptor()->GetTypeString(), force ) ); |
|
|
|
otherSDVar->GetSDVarDescriptor()->GetTypeString().c_str(), force ) ); |
|
|
|
|
|
|
|
|
|
|
|
int j; |
|
|
|
int j; |
|
|
|
for(j=0;j<GetCount(); j++) |
|
|
|
for(j=0;j<GetCount(); j++) |
|
|
|