summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-05 23:27:43 +0200
committeraap <aap@papnet.eu>2020-05-05 23:27:43 +0200
commit68d3ea9c42f985077d34174f937dbf520d9493e8 (patch)
tree8ab10b1aacea87ed8dde3b172e4a00fae51eb4a3 /src/modelinfo
parentFix appveyour (diff)
downloadre3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.gz
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.bz2
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.lz
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.xz
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.zst
re3-68d3ea9c42f985077d34174f937dbf520d9493e8.zip
Diffstat (limited to '')
-rw-r--r--src/modelinfo/ModelIndices.h12
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp18
-rw-r--r--src/modelinfo/SimpleModelInfo.h9
3 files changed, 26 insertions, 13 deletions
diff --git a/src/modelinfo/ModelIndices.h b/src/modelinfo/ModelIndices.h
index 8e117882..5c8d4858 100644
--- a/src/modelinfo/ModelIndices.h
+++ b/src/modelinfo/ModelIndices.h
@@ -1,5 +1,7 @@
#pragma once
+#include "ModelInfo.h"
+
#define MODELINDICES \
X("fire_hydrant", MI_FIRE_HYDRANT, 0x5F5A00) \
X("bagelstnd02", MI_BAGELSTAND2, 0x5F59FC) \
@@ -370,14 +372,8 @@ void TestModelIndices(void);
inline bool
IsGlass(int16 id)
{
- return id == MI_GLASS1 ||
- id == MI_GLASS2 ||
- id == MI_GLASS3 ||
- id == MI_GLASS4 ||
- id == MI_GLASS5 ||
- id == MI_GLASS6 ||
- id == MI_GLASS7 ||
- id == MI_GLASS8;
+ CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(id);
+ return mi->IsSimple() && (mi->m_isCodeGlass || mi->m_isArtistGlass);
}
inline bool
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index 424fb0e5..22024a54 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -55,7 +55,7 @@ CSimpleModelInfo::Init(void)
m_atomics[2] = nil;
m_numAtomics = 0;
m_firstDamaged = 0;
- m_normalCull = 0;
+ m_wetRoadReflection = 0;
m_isDamaged = 0;
m_isBigBuilding = 0;
m_noFade = 0;
@@ -64,6 +64,10 @@ CSimpleModelInfo::Init(void)
m_isSubway = 0;
m_ignoreLight = 0;
m_noZwrite = 0;
+ m_noShadows = 0;
+ m_ignoreDrawDist = 0;
+ m_isCodeGlass = 0;
+ m_isArtistGlass = 0;
}
void
@@ -154,6 +158,8 @@ CSimpleModelInfo::FindRelatedModel(void)
}
}
+#define NEAR_DRAW_DIST 0.0f // 100.0f in liberty city
+
void
CSimpleModelInfo::SetupBigBuilding(void)
{
@@ -162,9 +168,13 @@ CSimpleModelInfo::SetupBigBuilding(void)
m_isBigBuilding = 1;
FindRelatedModel();
related = GetRelatedModel();
- if(related)
+ if(related){
m_lodDistances[2] = related->GetLargestLodDistance()/TheCamera.LODDistMultiplier;
- else
- m_lodDistances[2] = 100.0f;
+ if(m_drawLast){
+ m_drawLast = false;
+ debug("%s was draw last\n", GetName());
+ }
+ }else
+ m_lodDistances[2] = NEAR_DRAW_DIST;
}
}
diff --git a/src/modelinfo/SimpleModelInfo.h b/src/modelinfo/SimpleModelInfo.h
index 403e2969..b2e59bb2 100644
--- a/src/modelinfo/SimpleModelInfo.h
+++ b/src/modelinfo/SimpleModelInfo.h
@@ -14,15 +14,22 @@ public:
uint16 m_firstDamaged : 2; // 0: no damage model
// 1: 1 and 2 are damage models
// 2: 2 is damage model
- uint16 m_normalCull : 1;
+ uint16 m_wetRoadReflection : 1;
uint16 m_isDamaged : 1;
+
uint16 m_isBigBuilding : 1;
uint16 m_noFade : 1;
uint16 m_drawLast : 1;
uint16 m_additive : 1;
+
uint16 m_isSubway : 1;
uint16 m_ignoreLight : 1;
uint16 m_noZwrite : 1;
+ uint16 m_noShadows : 1;
+
+ uint16 m_ignoreDrawDist : 1;
+ uint16 m_isCodeGlass : 1;
+ uint16 m_isArtistGlass : 1;
CSimpleModelInfo(void) : CBaseModelInfo(MITYPE_SIMPLE) {}
CSimpleModelInfo(ModelInfoType id) : CBaseModelInfo(id) {}