Permalink
Browse files

Re-enable depth test after drawing particles

While the depth-test was already re-enabled in most cases, sometimes it
was not. This could cause some (spell) effects to shine through walls
while the player was casting.

Fixes bug #278
  • Loading branch information...
1 parent 2251770 commit 2102e19936901ad71400f8b0d435de739949251b @dscharrer dscharrer committed Jun 19, 2012
Showing with 9 additions and 7 deletions.
  1. +1 −1 src/core/ArxGame.cpp
  2. +1 −1 src/core/Core.cpp
  3. +7 −5 src/graphics/particle/ParticleEffects.cpp
@@ -1825,7 +1825,7 @@ void ArxGame::Render() {
)
{
ARX_MAGICAL_FLARES_Draw(FRAMETICKS);
- FRAMETICKS = (unsigned long)(arxtime);
+ FRAMETICKS = (unsigned long)(arxtime);
}
}
#ifdef BUILD_EDITOR
View
@@ -3274,7 +3274,7 @@ void DrawMagicSightInterface()
if (Flying_Eye)
{
- GRenderer->SetBlendFunc(Renderer::BlendZero, Renderer::BlendInvSrcColor);
+ GRenderer->SetBlendFunc(Renderer::BlendZero, Renderer::BlendInvSrcColor);
float col=(0.75f+PULSATE*( 1.0f / 20 ));
if (col>1.f) col=1.f;
@@ -918,19 +918,20 @@ void ManageTorch()
//-----------------------------------------------------------------------------
void ARX_MAGICAL_FLARES_Draw(long FRAMETICKS)
{
- /////////FLARE
- GRenderer->SetRenderState(Renderer::DepthWrite, false);
- GRenderer->SetBlendFunc(Renderer::BlendOne, Renderer::BlendOne);
- GRenderer->SetRenderState(Renderer::AlphaBlending, true);
shinum++;
if (shinum>=10) shinum=1;
long TICKS = long(arxtime) - FRAMETICKS;
- if (TICKS<0)
+ if (TICKS<0)
return;
+
+ /////////FLARE
+ GRenderer->SetRenderState(Renderer::DepthWrite, false);
+ GRenderer->SetBlendFunc(Renderer::BlendOne, Renderer::BlendOne);
+ GRenderer->SetRenderState(Renderer::AlphaBlending, true);
float z,s,r,g,b;
@@ -2311,6 +2312,7 @@ void ARX_PARTICLES_Render(EERIE_CAMERA * cam)
if (pcc<=0)
{
GRenderer->SetFogColor(ulBKGColor);
+ GRenderer->SetRenderState(Renderer::DepthTest, true);
return;
}
}

0 comments on commit 2102e19

Please sign in to comment.