mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 05:40:00 +00:00
CTimeModelInfo and CWeaponModelInfo
This commit is contained in:
parent
8cbae5d62a
commit
9361aeb8eb
|
@ -809,7 +809,7 @@ CFileLoader::LoadTimeObject(const char *line)
|
|||
mi->m_firstDamaged = damaged;
|
||||
mi->SetTimes(timeOn, timeOff);
|
||||
mi->SetTexDictionary(txd);
|
||||
other = mi->FindOtherTimeModel();
|
||||
other = mi->FindOtherTimeModel(model);
|
||||
if(other)
|
||||
other->SetOtherTimeModel(id);
|
||||
MatchModelString(model, id);
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||
virtual void RcWriteEmpty(base::cRelocatableChunkWriter &writer);
|
||||
|
||||
virtual void SetAtomic(int n, RpAtomic *atomic); // TODO: remove this
|
||||
/*virtual*/ void SetAtomic(int n, RpAtomic *atomic);
|
||||
|
||||
void Init(void);
|
||||
void IncreaseAlpha(void);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -7,14 +7,21 @@ class CTimeModelInfo : public CSimpleModelInfo
|
|||
int32 m_timeOn;
|
||||
int32 m_timeOff;
|
||||
int32 m_otherTimeModelID;
|
||||
|
||||
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||
static CTimeModelInfo msClassInstance;
|
||||
|
||||
public:
|
||||
CTimeModelInfo(void) : CSimpleModelInfo(MITYPE_TIME) { m_otherTimeModelID = -1; }
|
||||
|
||||
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||
virtual void RcWriteEmpty(base::cRelocatableChunkWriter &writer);
|
||||
|
||||
int32 GetTimeOn(void) { return m_timeOn; }
|
||||
int32 GetTimeOff(void) { return m_timeOff; }
|
||||
void SetTimes(int32 on, int32 off) { m_timeOn = on; m_timeOff = off; }
|
||||
int32 GetOtherTimeModel(void) { return m_otherTimeModelID; }
|
||||
void SetOtherTimeModel(int32 other) { m_otherTimeModelID = other; }
|
||||
CTimeModelInfo *FindOtherTimeModel(void);
|
||||
CTimeModelInfo *FindOtherTimeModel(const char *name);
|
||||
};
|
||||
//static_assert(sizeof(CTimeModelInfo) == 0x58, "CTimeModelInfo: error");
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
#include "AnimManager.h"
|
||||
#include "VisibilityPlugins.h"
|
||||
|
||||
base::cRelocatableChunkClassInfo CWeaponModelInfo::msClassInfo("CWeaponModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
|
||||
CWeaponModelInfo CWeaponModelInfo::msClassInstance;
|
||||
|
||||
void
|
||||
CWeaponModelInfo::SetAnimFile(const char *file)
|
||||
{
|
||||
|
@ -35,19 +38,34 @@ CWeaponModelInfo::Init(void)
|
|||
void
|
||||
CWeaponModelInfo::SetWeaponInfo(int32 weaponId)
|
||||
{
|
||||
m_atomics[2] = (RpAtomic*)weaponId;
|
||||
m_relatedModel = (CSimpleModelInfo*)weaponId;
|
||||
}
|
||||
|
||||
eWeaponType
|
||||
CWeaponModelInfo::GetWeaponInfo(void)
|
||||
{
|
||||
return (eWeaponType)(uintptr)m_atomics[2];
|
||||
return (eWeaponType)(uintptr)m_relatedModel;
|
||||
}
|
||||
|
||||
/*
|
||||
void
|
||||
CWeaponModelInfo::SetAtomic(int n, RpAtomic *atomic)
|
||||
{
|
||||
CSimpleModelInfo::SetAtomic(n, atomic);
|
||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderWeaponCB);
|
||||
}
|
||||
*/
|
||||
|
||||
void
|
||||
CWeaponModelInfo::RcWriteThis(base::cRelocatableChunkWriter &writer)
|
||||
{
|
||||
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||
}
|
||||
|
||||
void
|
||||
CWeaponModelInfo::RcWriteEmpty(base::cRelocatableChunkWriter &writer)
|
||||
{
|
||||
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||
}
|
||||
|
|
|
@ -9,13 +9,21 @@ class CWeaponModelInfo : public CSimpleModelInfo
|
|||
int32 m_animFileIndex;
|
||||
char *m_animFileName;
|
||||
};
|
||||
|
||||
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||
static CWeaponModelInfo msClassInstance;
|
||||
|
||||
public:
|
||||
CWeaponModelInfo(void) : CSimpleModelInfo(MITYPE_WEAPON) { m_animFileIndex = -1; }
|
||||
|
||||
virtual void SetAnimFile(const char *file);
|
||||
virtual void ConvertAnimFileIndex(void);
|
||||
virtual int GetAnimFileIndex(void) { return m_animFileIndex; }
|
||||
virtual void SetAtomic(int n, RpAtomic *atomic);
|
||||
|
||||
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||
virtual void RcWriteEmpty(base::cRelocatableChunkWriter &writer);
|
||||
|
||||
//virtual void SetAtomic(int n, RpAtomic *atomic);
|
||||
|
||||
void Init(void);
|
||||
void SetWeaponInfo(int32 weaponId);
|
||||
|
|
Loading…
Reference in a new issue