summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelinfo')
-rw-r--r--src/modelinfo/BaseModelInfo.cpp4
-rw-r--r--src/modelinfo/BaseModelInfo.h8
-rw-r--r--src/modelinfo/ClumpModelInfo.cpp4
-rw-r--r--src/modelinfo/ModelInfo.cpp2
-rw-r--r--src/modelinfo/ModelInfo.h1
-rw-r--r--src/modelinfo/PedModelInfo.cpp6
-rw-r--r--src/modelinfo/PedModelInfo.h1
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp5
-rw-r--r--src/modelinfo/TimeModelInfo.cpp4
-rw-r--r--src/modelinfo/VehicleModelInfo.cpp6
10 files changed, 21 insertions, 20 deletions
diff --git a/src/modelinfo/BaseModelInfo.cpp b/src/modelinfo/BaseModelInfo.cpp
index a2779107..7137c604 100644
--- a/src/modelinfo/BaseModelInfo.cpp
+++ b/src/modelinfo/BaseModelInfo.cpp
@@ -4,7 +4,7 @@
#include "TxdStore.h"
#include "2dEffect.h"
#include "BaseModelInfo.h"
-
+#include "ColModel.h"
CBaseModelInfo::CBaseModelInfo(ModelInfoType type)
{
@@ -56,7 +56,7 @@ void
CBaseModelInfo::SetTexDictionary(const char *name)
{
int slot = CTxdStore::FindTxdSlot(name);
- if(slot < 0)
+ if(slot == -1)
slot = CTxdStore::AddTxdSlot(name);
m_txdSlot = slot;
}
diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h
index ae2b6668..f46cea84 100644
--- a/src/modelinfo/BaseModelInfo.h
+++ b/src/modelinfo/BaseModelInfo.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Collision.h"
+struct CColModel;
#define MAX_MODEL_NAME (24)
@@ -44,8 +44,8 @@ public:
virtual ~CBaseModelInfo() {}
virtual void Shutdown(void);
virtual void DeleteRwObject(void) = 0;
- virtual RwObject *CreateInstance(RwMatrix *) = 0;
virtual RwObject *CreateInstance(void) = 0;
+ virtual RwObject *CreateInstance(RwMatrix *) = 0;
virtual RwObject *GetRwObject(void) = 0;
// one day it becomes virtual
@@ -54,8 +54,8 @@ public:
bool IsClump(void) { return m_type == MITYPE_CLUMP || m_type == MITYPE_PED || m_type == MITYPE_VEHICLE ||
m_type == MITYPE_MLO || m_type == MITYPE_XTRACOMPS; // unused but what the heck
}
- char *GetName(void) { return m_name; }
- void SetName(const char *name) { strncpy(m_name, name, MAX_MODEL_NAME); }
+ char *GetModelName(void) { return m_name; }
+ void SetModelName(const char *name) { strncpy(m_name, name, MAX_MODEL_NAME); }
void SetColModel(CColModel *col, bool owns = false){
m_colModel = col; m_bOwnsColModel = owns; }
CColModel *GetColModel(void) { return m_colModel; }
diff --git a/src/modelinfo/ClumpModelInfo.cpp b/src/modelinfo/ClumpModelInfo.cpp
index 64bb5ed5..44a62afb 100644
--- a/src/modelinfo/ClumpModelInfo.cpp
+++ b/src/modelinfo/ClumpModelInfo.cpp
@@ -112,7 +112,7 @@ CClumpModelInfo::SetClump(RpClump *clump)
}
RpHAnimHierarchySetFlags(hier, (RpHAnimHierarchyFlag)(rpHANIMHIERARCHYUPDATEMODELLINGMATRICES|rpHANIMHIERARCHYUPDATELTMS));
}
- if(strcmp(GetName(), "playerh") == 0){
+ if(strcmp(GetModelName(), "playerh") == 0){
// playerh is incompatible with the xbox player skin
// so check if player model is skinned and only apply skin to head if it isn't
CPedModelInfo *body = (CPedModelInfo*)CModelInfo::GetModelInfo(MI_PLAYER);
@@ -120,7 +120,7 @@ CClumpModelInfo::SetClump(RpClump *clump)
RpClumpForAllAtomics(clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
}
#else
- if(strcmp(GetName(), "playerh") == 0){
+ if(strcmp(GetModelName(), "playerh") == 0)
RpClumpForAllAtomics(clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
#endif
}
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index dcde0df3..7aa5fc8b 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -192,7 +192,7 @@ CModelInfo::GetModelInfo(const char *name, int *id)
CBaseModelInfo *modelinfo;
for(int i = 0; i < MODELINFOSIZE; i++){
modelinfo = CModelInfo::ms_modelInfoPtrs[i];
- if(modelinfo && !CGeneral::faststricmp(modelinfo->GetName(), name)){
+ if(modelinfo && !CGeneral::faststricmp(modelinfo->GetModelName(), name)){
if(id)
*id = i;
return modelinfo;
diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h
index 65cfa4e7..4fe1ebb0 100644
--- a/src/modelinfo/ModelInfo.h
+++ b/src/modelinfo/ModelInfo.h
@@ -10,6 +10,7 @@
#include "VehicleModelInfo.h"
#include "XtraCompsModelInfo.h"
#include "Instance.h"
+#include "Game.h"
class CModelInfo
{
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 38ce6d38..d0816467 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -97,7 +97,7 @@ CPedModelInfo::SetClump(RpClump *clump)
#endif
#ifdef PED_SKIN
// CB has to be set here before atomics are detached from clump
- if(strcmp(GetName(), "player") == 0)
+ if(strcmp(GetModelName(), "player") == 0)
RpClumpForAllAtomics(clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
if(IsClumpSkinned(clump)){
LimbCBarg limbs = { this, clump, { 0, 0, 0 } };
@@ -108,7 +108,7 @@ CPedModelInfo::SetClump(RpClump *clump)
if(m_hitColModel == nil && !IsClumpSkinned(clump))
CreateHitColModel();
// And again because CClumpModelInfo resets it
- if(strcmp(GetName(), "player") == 0)
+ if(strcmp(GetModelName(), "player") == 0)
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
else if(IsClumpSkinned(clump))
// skinned peds have no low detail version, so they don't have the right render Cb
@@ -118,7 +118,7 @@ CPedModelInfo::SetClump(RpClump *clump)
SetFrameIds(m_pPedIds);
if(m_hitColModel == nil)
CreateHitColModel();
- if(strcmp(GetName(), "player") == 0)
+ if(strcmp(GetModelName(), "player") == 0)
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
#endif
}
diff --git a/src/modelinfo/PedModelInfo.h b/src/modelinfo/PedModelInfo.h
index f467fe8a..26ab3c3f 100644
--- a/src/modelinfo/PedModelInfo.h
+++ b/src/modelinfo/PedModelInfo.h
@@ -1,6 +1,7 @@
#pragma once
#include "ClumpModelInfo.h"
+#include "ColModel.h"
#include "PedType.h"
enum PedNode {
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index 416bdad5..9fc0dd6e 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -2,11 +2,10 @@
#include "General.h"
#include "Camera.h"
+#include "Renderer.h"
#include "ModelInfo.h"
#include "custompipes.h"
-#define LOD_DISTANCE (300.0f)
-
void
CSimpleModelInfo::DeleteRwObject(void)
{
@@ -143,7 +142,7 @@ CSimpleModelInfo::FindRelatedModel(void)
for(i = 0; i < MODELINFOSIZE; i++){
mi = CModelInfo::GetModelInfo(i);
if(mi && mi != this &&
- !CGeneral::faststrcmp(GetName()+3, mi->GetName()+3)){
+ !CGeneral::faststrcmp(GetModelName()+3, mi->GetModelName()+3)){
assert(mi->IsSimple());
this->SetRelatedModel((CSimpleModelInfo*)mi);
return;
diff --git a/src/modelinfo/TimeModelInfo.cpp b/src/modelinfo/TimeModelInfo.cpp
index c1c18dac..0db5fb78 100644
--- a/src/modelinfo/TimeModelInfo.cpp
+++ b/src/modelinfo/TimeModelInfo.cpp
@@ -11,7 +11,7 @@ CTimeModelInfo::FindOtherTimeModel(void)
char *p;
int i;
- strcpy(name, GetName());
+ strcpy(name, GetModelName());
// change _nt to _dy
if(p = strstr(name, "_nt"))
strncpy(p, "_dy", 4);
@@ -24,7 +24,7 @@ CTimeModelInfo::FindOtherTimeModel(void)
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
if (mi && mi->GetModelType() == MITYPE_TIME &&
- !CGeneral::faststrncmp(name, mi->GetName(), MAX_MODEL_NAME)){
+ !CGeneral::faststrncmp(name, mi->GetModelName(), MAX_MODEL_NAME)){
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp
index c0daaead..685b6ef6 100644
--- a/src/modelinfo/VehicleModelInfo.cpp
+++ b/src/modelinfo/VehicleModelInfo.cpp
@@ -553,9 +553,9 @@ CVehicleModelInfo::SetVehicleComponentFlags(RwFrame *frame, uint32 flags)
SETFLAGS(ATOMIC_FLAG_FRONT);
else if(flags & VEHICLE_FLAG_REAR && (handling->Flags & HANDLING_IS_VAN || (flags & (VEHICLE_FLAG_LEFT|VEHICLE_FLAG_RIGHT)) == 0))
SETFLAGS(ATOMIC_FLAG_REAR);
- if(flags & VEHICLE_FLAG_LEFT)
+ else if(flags & VEHICLE_FLAG_LEFT)
SETFLAGS(ATOMIC_FLAG_LEFT);
- if(flags & VEHICLE_FLAG_RIGHT)
+ else if(flags & VEHICLE_FLAG_RIGHT)
SETFLAGS(ATOMIC_FLAG_RIGHT);
if(flags & VEHICLE_FLAG_REARDOOR)
@@ -709,7 +709,7 @@ struct editableMatCBData
RpMaterial*
CVehicleModelInfo::GetEditableMaterialListCB(RpMaterial *material, void *data)
{
- static RwRGBA white = { 255, 255, 255, 255 };
+ RwRGBA white = { 255, 255, 255, 255 };
const RwRGBA *col;
editableMatCBData *cbdata;