summaryrefslogtreecommitdiffstats
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2020-11-12 15:37:04 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2020-11-12 15:37:04 +0100
commit4f8029ad7c76d53f08d9f922d59db32ee27be3f2 (patch)
treed5a34f1f072e70671b33ebbff9b9d875053c6380 /src/rw/VisibilityPlugins.cpp
parentPeds: Remove redundant lines (diff)
parentfixed zone bug (diff)
downloadre3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar.gz
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar.bz2
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar.lz
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar.xz
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.tar.zst
re3-4f8029ad7c76d53f08d9f922d59db32ee27be3f2.zip
Diffstat (limited to 'src/rw/VisibilityPlugins.cpp')
-rw-r--r--src/rw/VisibilityPlugins.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 36a60117..c79cb52b 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -1,6 +1,7 @@
#include "common.h"
#include "templates.h"
+#include "main.h"
#include "Entity.h"
#include "ModelInfo.h"
#include "Lights.h"
@@ -19,6 +20,9 @@ CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBoatAtomicList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaUnderwaterEntityList;
+#ifdef NEW_RENDERER
+CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBuildingList;
+#endif
int32 CVisibilityPlugins::ms_atomicPluginOffset = -1;
int32 CVisibilityPlugins::ms_framePluginOffset = -1;
@@ -59,6 +63,11 @@ CVisibilityPlugins::Initialise(void)
m_alphaUnderwaterEntityList.head.item.sort = 0.0f;
m_alphaUnderwaterEntityList.tail.item.sort = 100000000.0f;
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Init(NUMALPHAENTITYLIST);
+ m_alphaBuildingList.head.item.sort = 0.0f;
+ m_alphaBuildingList.tail.item.sort = 100000000.0f;
+#endif
}
void
@@ -68,6 +77,9 @@ CVisibilityPlugins::Shutdown(void)
m_alphaBoatAtomicList.Shutdown();
m_alphaEntityList.Shutdown();
m_alphaUnderwaterEntityList.Shutdown();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Shutdown();
+#endif
}
void
@@ -76,6 +88,9 @@ CVisibilityPlugins::InitAlphaEntityList(void)
m_alphaEntityList.Clear();
m_alphaBoatAtomicList.Clear();
m_alphaUnderwaterEntityList.Clear();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Clear();
+#endif
}
bool
@@ -84,6 +99,10 @@ CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
AlphaObjectInfo item;
item.entity = e;
item.sort = dist;
+#ifdef NEW_RENDERER
+ if(gbNewRenderer && e->IsBuilding())
+ return !!m_alphaBuildingList.InsertSorted(item);
+#endif
if(e->bUnderwater && m_alphaUnderwaterEntityList.InsertSorted(item))
return true;
return !!m_alphaEntityList.InsertSorted(item);
@@ -308,7 +327,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
mi = GetAtomicModelInfo(atomic);
lodatm = mi->GetAtomicFromDistance(camdist - FADE_DISTANCE);
if(mi->m_additive)
- AtomicDefaultRenderCallBack(atomic);
+ RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
fadefactor = (mi->GetLargestLodDistance() - (camdist - FADE_DISTANCE))/FADE_DISTANCE;
if(fadefactor > 1.0f)