summaryrefslogtreecommitdiffstats
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-03 20:33:07 +0100
committeraap <aap@papnet.eu>2020-11-03 20:33:07 +0100
commit3c5bb4e8f34bebd14447a4166a24264a56e7ff3a (patch)
tree6d841c850a4c286d89612c232a4c82f5651b5200 /src/rw/VisibilityPlugins.cpp
parentMerge branch 'miami' of github.com:GTAmodding/re3 into miami (diff)
downloadre3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar.gz
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar.bz2
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar.lz
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar.xz
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.tar.zst
re3-3c5bb4e8f34bebd14447a4166a24264a56e7ff3a.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)