summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/TimeModelInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelinfo/TimeModelInfo.cpp')
-rw-r--r--src/modelinfo/TimeModelInfo.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/modelinfo/TimeModelInfo.cpp b/src/modelinfo/TimeModelInfo.cpp
index 0db5fb78..85b59e43 100644
--- a/src/modelinfo/TimeModelInfo.cpp
+++ b/src/modelinfo/TimeModelInfo.cpp
@@ -3,15 +3,20 @@
#include "Camera.h"
#include "ModelInfo.h"
#include "General.h"
+#include "KeyGen.h"
+
+base::cRelocatableChunkClassInfo CTimeModelInfo::msClassInfo("CTimeModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
+CTimeModelInfo CTimeModelInfo::msClassInstance;
+
CTimeModelInfo*
-CTimeModelInfo::FindOtherTimeModel(void)
+CTimeModelInfo::FindOtherTimeModel(const char *modelname)
{
char name[40];
char *p;
int i;
- strcpy(name, GetModelName());
+ strcpy(name, modelname);
// change _nt to _dy
if(p = strstr(name, "_nt"))
strncpy(p, "_dy", 4);
@@ -21,13 +26,29 @@ CTimeModelInfo::FindOtherTimeModel(void)
else
return nil;
+ uint32 nameKey = CKeyGen::GetUppercaseKey(name);
+
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
- if (mi && mi->GetModelType() == MITYPE_TIME &&
- !CGeneral::faststrncmp(name, mi->GetModelName(), MAX_MODEL_NAME)){
+ if (mi && mi->GetModelType() == MITYPE_TIME && nameKey == mi->GetNameHashKey()){
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
}
return nil;
}
+
+
+void
+CTimeModelInfo::RcWriteThis(base::cRelocatableChunkWriter &writer)
+{
+ writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
+ writer.Class(VTABLE_ADDR(this), msClassInfo);
+}
+
+void
+CTimeModelInfo::RcWriteEmpty(base::cRelocatableChunkWriter &writer)
+{
+ writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
+ writer.Class(VTABLE_ADDR(this), msClassInfo);
+}