summaryrefslogtreecommitdiffstats
path: root/src/extras
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-02-28 19:07:32 +0100
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:43 +0200
commitc58d98a39ea3fa5e1f515fbac96eb58350a6de3e (patch)
tree2f62df6b06c64af88786e6f2329a1f6d0adb613c /src/extras
parentfix postfx fix (diff)
downloadre3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar.gz
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar.bz2
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar.lz
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar.xz
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.tar.zst
re3-c58d98a39ea3fa5e1f515fbac96eb58350a6de3e.zip
Diffstat (limited to 'src/extras')
-rw-r--r--src/extras/custompipes_d3d9.cpp5
-rw-r--r--src/extras/custompipes_gl.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp
index dad42b33..8b984448 100644
--- a/src/extras/custompipes_d3d9.cpp
+++ b/src/extras/custompipes_d3d9.cpp
@@ -568,6 +568,7 @@ struct BuildingInst
{
rw::RawMatrix combinedMat;
rw::d3d9::InstanceDataHeader *instHeader;
+ uint32 cullMode;
uint8 fadeAlpha;
bool lighting;
};
@@ -612,6 +613,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
assert(building->instHeader->platform == PLATFORM_D3D9);
building->fadeAlpha = 255;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ building->cullMode = rw::GetRenderState(rw::CULLMODE);
rw::uint32 flags = atomic->geometry->flags;
bool setupDone = false;
@@ -630,6 +632,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
// alright we're rendering this atomic
if(!setupDone){
+ rw::SetRenderState(rw::CULLMODE, building->cullMode);
setStreamSource(0, building->instHeader->vertexStream[0].vertexBuffer, 0, building->instHeader->vertexStream[0].stride);
setIndices(building->instHeader->indexBuffer);
setVertexDeclaration(building->instHeader->vertexDeclaration);
@@ -671,6 +674,7 @@ AtomicFullyTransparent(RpAtomic *atomic, int pass, int fadeAlpha)
assert(building->instHeader->platform == PLATFORM_D3D9);
building->fadeAlpha = fadeAlpha;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ building->cullMode = rw::GetRenderState(rw::CULLMODE);
SetMatrix(building, atomic->getFrame()->getLTM());
numBlendInsts[pass]++;
}
@@ -688,6 +692,7 @@ RenderBlendPass(int pass)
for(i = 0; i < numBlendInsts[pass]; i++){
BuildingInst *building = &blendInsts[pass][i];
+ rw::SetRenderState(rw::CULLMODE, building->cullMode);
setStreamSource(0, building->instHeader->vertexStream[0].vertexBuffer, 0, building->instHeader->vertexStream[0].stride);
setIndices(building->instHeader->indexBuffer);
setVertexDeclaration(building->instHeader->vertexDeclaration);
diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp
index 040bf686..23a2a931 100644
--- a/src/extras/custompipes_gl.cpp
+++ b/src/extras/custompipes_gl.cpp
@@ -595,6 +595,7 @@ struct BuildingInst
{
rw::Matrix matrix;
rw::gl3::InstanceDataHeader *instHeader;
+ uint32 cullMode;
uint8 fadeAlpha;
bool lighting;
};
@@ -627,6 +628,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
assert(building->instHeader->platform == PLATFORM_GL3);
building->fadeAlpha = 255;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ building->cullMode = rw::GetRenderState(rw::CULLMODE);
rw::uint32 flags = atomic->geometry->flags;
WorldLights lights;
@@ -654,6 +656,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
// alright we're rendering this atomic
if(!setupDone){
+ rw::SetRenderState(rw::CULLMODE, building->cullMode);
defaultShader->use();
setWorldMatrix(&building->matrix);
setupVertexInput(building->instHeader);
@@ -686,6 +689,7 @@ AtomicFullyTransparent(RpAtomic *atomic, int pass, int fadeAlpha)
assert(building->instHeader->platform == PLATFORM_GL3);
building->fadeAlpha = fadeAlpha;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ building->cullMode = rw::GetRenderState(rw::CULLMODE);
building->matrix = *atomic->getFrame()->getLTM();
numBlendInsts[pass]++;
}
@@ -706,6 +710,7 @@ RenderBlendPass(int pass)
for(i = 0; i < numBlendInsts[pass]; i++){
BuildingInst *building = &blendInsts[pass][i];
+ rw::SetRenderState(rw::CULLMODE, building->cullMode);
setupVertexInput(building->instHeader);
setWorldMatrix(&building->matrix);
if(building->lighting)