Re3/src/modelinfo/TimeModelInfo.cpp

33 lines
624 B
C++
Raw Normal View History

2019-05-15 10:52:37 -04:00
#include "common.h"
2020-04-17 09:31:11 -04:00
2019-05-15 10:52:37 -04:00
#include "Camera.h"
#include "ModelInfo.h"
CTimeModelInfo*
CTimeModelInfo::FindOtherTimeModel(void)
{
char name[40];
char *p;
int i;
strcpy(name, GetName());
// 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;
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
2020-05-05 08:06:55 -04:00
if (mi && mi->GetModelType() == MITYPE_TIME &&
2019-05-15 10:52:37 -04:00
strncmp(name, mi->GetName(), 24) == 0){
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
}
return nil;
}