mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-11-06 05:25:55 +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->m_firstDamaged = damaged;
|
||||||
mi->SetTimes(timeOn, timeOff);
|
mi->SetTimes(timeOn, timeOff);
|
||||||
mi->SetTexDictionary(txd);
|
mi->SetTexDictionary(txd);
|
||||||
other = mi->FindOtherTimeModel();
|
other = mi->FindOtherTimeModel(model);
|
||||||
if(other)
|
if(other)
|
||||||
other->SetOtherTimeModel(id);
|
other->SetOtherTimeModel(id);
|
||||||
MatchModelString(model, id);
|
MatchModelString(model, id);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||||
virtual void RcWriteEmpty(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 Init(void);
|
||||||
void IncreaseAlpha(void);
|
void IncreaseAlpha(void);
|
||||||
|
|
|
@ -3,15 +3,20 @@
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
#include "ModelInfo.h"
|
#include "ModelInfo.h"
|
||||||
#include "General.h"
|
#include "General.h"
|
||||||
|
#include "KeyGen.h"
|
||||||
|
|
||||||
|
base::cRelocatableChunkClassInfo CTimeModelInfo::msClassInfo("CTimeModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
|
||||||
|
CTimeModelInfo CTimeModelInfo::msClassInstance;
|
||||||
|
|
||||||
|
|
||||||
CTimeModelInfo*
|
CTimeModelInfo*
|
||||||
CTimeModelInfo::FindOtherTimeModel(void)
|
CTimeModelInfo::FindOtherTimeModel(const char *modelname)
|
||||||
{
|
{
|
||||||
char name[40];
|
char name[40];
|
||||||
char *p;
|
char *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
strcpy(name, GetModelName());
|
strcpy(name, modelname);
|
||||||
// change _nt to _dy
|
// change _nt to _dy
|
||||||
if(p = strstr(name, "_nt"))
|
if(p = strstr(name, "_nt"))
|
||||||
strncpy(p, "_dy", 4);
|
strncpy(p, "_dy", 4);
|
||||||
|
@ -21,13 +26,29 @@ CTimeModelInfo::FindOtherTimeModel(void)
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
|
uint32 nameKey = CKeyGen::GetUppercaseKey(name);
|
||||||
|
|
||||||
for(i = 0; i < MODELINFOSIZE; i++){
|
for(i = 0; i < MODELINFOSIZE; i++){
|
||||||
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
|
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
|
||||||
if (mi && mi->GetModelType() == MITYPE_TIME &&
|
if (mi && mi->GetModelType() == MITYPE_TIME && nameKey == mi->GetNameHashKey()){
|
||||||
!CGeneral::faststrncmp(name, mi->GetModelName(), MAX_MODEL_NAME)){
|
|
||||||
m_otherTimeModelID = i;
|
m_otherTimeModelID = i;
|
||||||
return (CTimeModelInfo*)mi;
|
return (CTimeModelInfo*)mi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil;
|
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_timeOn;
|
||||||
int32 m_timeOff;
|
int32 m_timeOff;
|
||||||
int32 m_otherTimeModelID;
|
int32 m_otherTimeModelID;
|
||||||
|
|
||||||
|
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||||
|
static CTimeModelInfo msClassInstance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTimeModelInfo(void) : CSimpleModelInfo(MITYPE_TIME) { m_otherTimeModelID = -1; }
|
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 GetTimeOn(void) { return m_timeOn; }
|
||||||
int32 GetTimeOff(void) { return m_timeOff; }
|
int32 GetTimeOff(void) { return m_timeOff; }
|
||||||
void SetTimes(int32 on, int32 off) { m_timeOn = on; m_timeOff = off; }
|
void SetTimes(int32 on, int32 off) { m_timeOn = on; m_timeOff = off; }
|
||||||
int32 GetOtherTimeModel(void) { return m_otherTimeModelID; }
|
int32 GetOtherTimeModel(void) { return m_otherTimeModelID; }
|
||||||
void SetOtherTimeModel(int32 other) { m_otherTimeModelID = other; }
|
void SetOtherTimeModel(int32 other) { m_otherTimeModelID = other; }
|
||||||
CTimeModelInfo *FindOtherTimeModel(void);
|
CTimeModelInfo *FindOtherTimeModel(const char *name);
|
||||||
};
|
};
|
||||||
//static_assert(sizeof(CTimeModelInfo) == 0x58, "CTimeModelInfo: error");
|
//static_assert(sizeof(CTimeModelInfo) == 0x58, "CTimeModelInfo: error");
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
#include "AnimManager.h"
|
#include "AnimManager.h"
|
||||||
#include "VisibilityPlugins.h"
|
#include "VisibilityPlugins.h"
|
||||||
|
|
||||||
|
base::cRelocatableChunkClassInfo CWeaponModelInfo::msClassInfo("CWeaponModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
|
||||||
|
CWeaponModelInfo CWeaponModelInfo::msClassInstance;
|
||||||
|
|
||||||
void
|
void
|
||||||
CWeaponModelInfo::SetAnimFile(const char *file)
|
CWeaponModelInfo::SetAnimFile(const char *file)
|
||||||
{
|
{
|
||||||
|
@ -35,19 +38,34 @@ CWeaponModelInfo::Init(void)
|
||||||
void
|
void
|
||||||
CWeaponModelInfo::SetWeaponInfo(int32 weaponId)
|
CWeaponModelInfo::SetWeaponInfo(int32 weaponId)
|
||||||
{
|
{
|
||||||
m_atomics[2] = (RpAtomic*)weaponId;
|
m_relatedModel = (CSimpleModelInfo*)weaponId;
|
||||||
}
|
}
|
||||||
|
|
||||||
eWeaponType
|
eWeaponType
|
||||||
CWeaponModelInfo::GetWeaponInfo(void)
|
CWeaponModelInfo::GetWeaponInfo(void)
|
||||||
{
|
{
|
||||||
return (eWeaponType)(uintptr)m_atomics[2];
|
return (eWeaponType)(uintptr)m_relatedModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void
|
void
|
||||||
CWeaponModelInfo::SetAtomic(int n, RpAtomic *atomic)
|
CWeaponModelInfo::SetAtomic(int n, RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
CSimpleModelInfo::SetAtomic(n, atomic);
|
CSimpleModelInfo::SetAtomic(n, atomic);
|
||||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, CVisibilityPlugins::RenderWeaponCB);
|
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;
|
int32 m_animFileIndex;
|
||||||
char *m_animFileName;
|
char *m_animFileName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||||
|
static CWeaponModelInfo msClassInstance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CWeaponModelInfo(void) : CSimpleModelInfo(MITYPE_WEAPON) { m_animFileIndex = -1; }
|
CWeaponModelInfo(void) : CSimpleModelInfo(MITYPE_WEAPON) { m_animFileIndex = -1; }
|
||||||
|
|
||||||
virtual void SetAnimFile(const char *file);
|
virtual void SetAnimFile(const char *file);
|
||||||
virtual void ConvertAnimFileIndex(void);
|
virtual void ConvertAnimFileIndex(void);
|
||||||
virtual int GetAnimFileIndex(void) { return m_animFileIndex; }
|
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 Init(void);
|
||||||
void SetWeaponInfo(int32 weaponId);
|
void SetWeaponInfo(int32 weaponId);
|
||||||
|
|
Loading…
Reference in a new issue