re3/src/modelinfo/TimeModelInfo.cpp

34 lines
677 B
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:13 +00:00
#include "General.h"
2019-05-15 14:52:37 +00:00
CTimeModelInfo*
CTimeModelInfo::FindOtherTimeModel(void)
{
char name[40];
char *p;
int i;
2021-01-08 19:50:59 +00:00
strcpy(name, GetModelName());
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;
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
2020-05-05 12:06:55 +00:00
if (mi && mi->GetModelType() == MITYPE_TIME &&
2021-01-08 19:50:59 +00:00
!CGeneral::faststrncmp(name, mi->GetModelName(), MAX_MODEL_NAME)){
2019-05-15 14:52:37 +00:00
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
}
return nil;
}