summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-07-31 19:08:01 +0200
committerGitHub <noreply@github.com>2021-07-31 19:08:01 +0200
commitbf035b8167fae156dc28b2952044b29e6f601600 (patch)
treea4947f5af100448121be2131fd4f561362ecda58 /src/entities
parentPossible crashfix with wanted level (diff)
parentCVisibilityPlugins, CRenderer, some fixes (diff)
downloadre3-bf035b8167fae156dc28b2952044b29e6f601600.tar
re3-bf035b8167fae156dc28b2952044b29e6f601600.tar.gz
re3-bf035b8167fae156dc28b2952044b29e6f601600.tar.bz2
re3-bf035b8167fae156dc28b2952044b29e6f601600.tar.lz
re3-bf035b8167fae156dc28b2952044b29e6f601600.tar.xz
re3-bf035b8167fae156dc28b2952044b29e6f601600.tar.zst
re3-bf035b8167fae156dc28b2952044b29e6f601600.zip
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/Entity.cpp21
-rw-r--r--src/entities/Entity.h8
2 files changed, 17 insertions, 12 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index cd50923a..ed432e77 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -86,9 +86,9 @@ CEntity::CEntity(void)
bHasPreRenderEffects = false;
bIsTreeModel = false;
- m_flagG2 = false;
- m_flagG4 = false;
- m_flagG8 = false;
+ bIsVehicle = false;
+ bIsPed = false;
+ bMakeVisible = false;
m_scanCode = 0;
m_modelIndex = -1;
@@ -444,8 +444,11 @@ void
CEntity::Render(void)
{
if(m_rwObject){
- if(CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject) != 0){
- // NB: LCS does not use bImBeingRendered here,
+#ifdef VIS_DISTANCE_ALPHA
+ if(CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject) != 0)
+#endif
+ {
+ // TODO(LCS): LCS does not use bImBeingRendered here,
// but that may be due to the streamed world. better keep it for safety
bImBeingRendered = true;
if(RwObjectGetType(m_rwObject) == rpATOMIC)
@@ -457,13 +460,12 @@ CEntity::Render(void)
}
}
+#ifdef VIS_DISTANCE_ALPHA
void
CEntity::UpdateDistanceFade(void)
{
-// TODO(LCS):
-// increasing and decreasing alpha depending on bDistanceFade doesn't make any sense
-// so disable this whole thing until it does.
-return;
+ // bDistanceFade is only valid when entity is in alpha list
+ // but we're always checking it here, see fix in CRenderer
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject);
if(CCutsceneMgr::IsRunning() || TheCamera.WorldViewerBeingUsed)
alpha = 255;
@@ -473,6 +475,7 @@ return;
alpha = Min(alpha+32, 255);
CVisibilityPlugins::SetObjectDistanceAlpha(m_rwObject, alpha);
}
+#endif
void
CEntity::UpdateAnim(void)
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index 239292c5..dbe8c6e2 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -100,9 +100,9 @@ public:
// LCS flagsG
uint32 bIsTreeModel : 1;
- uint32 m_flagG2 : 1;
- uint32 m_flagG4 : 1;
- uint32 m_flagG8 : 1;
+ uint32 bIsVehicle : 1; // not sure what exactly these two are for
+ uint32 bIsPed : 1;
+ uint32 bMakeVisible : 1;
uint16 m_scanCode;
uint16 m_randomSeed;
@@ -163,7 +163,9 @@ public:
return (RpClump*)m_rwObject;
}
+#ifdef VIS_DISTANCE_ALPHA
void UpdateDistanceFade(void);
+#endif
void GetBoundCentre(CVUVECTOR &out);
CVector GetBoundCentre(void);
float GetBoundRadius(void);