1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-06-29 08:57:06 +00:00
re3/src/modelinfo/TimeModelInfo.cpp

55 lines
1.3 KiB
C++
Raw Normal View History

2019-05-15 14:52:37 +00:00
#include "common.h"
2020-04-17 13:31:11 +00:00
2019-05-15 14:52:37 +00:00
#include "Camera.h"
#include "ModelInfo.h"
2020-12-25 13:18:48 +00:00
#include "General.h"
2021-01-24 13:06:16 +00:00
#include "KeyGen.h"
base::cRelocatableChunkClassInfo CTimeModelInfo::msClassInfo("CTimeModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
CTimeModelInfo CTimeModelInfo::msClassInstance;
2019-05-15 14:52:37 +00:00
CTimeModelInfo*
2021-01-24 13:06:16 +00:00
CTimeModelInfo::FindOtherTimeModel(const char *modelname)
2019-05-15 14:52:37 +00:00
{
char name[40];
char *p;
int i;
2021-01-24 13:06:16 +00:00
strcpy(name, modelname);
2019-05-15 14:52:37 +00:00
// change _nt to _dy
if(p = strstr(name, "_nt"))
strncpy(p, "_dy", 4);
// change _dy to _nt
else if(p = strstr(name, "_dy"))
strncpy(p, "_nt", 4);
else
return nil;
2021-01-24 13:06:16 +00:00
uint32 nameKey = CKeyGen::GetUppercaseKey(name);
2019-05-15 14:52:37 +00:00
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
2021-01-24 13:06:16 +00:00
if (mi && mi->GetModelType() == MITYPE_TIME && nameKey == mi->GetNameHashKey()){
2019-05-15 14:52:37 +00:00
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
}
return nil;
}
2021-01-24 13:06:16 +00:00
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);
}