From c21a8185eec05fa8e15d243ef475888c8d9cd699 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Tue, 22 Aug 2017 14:16:06 +0300 Subject: [PATCH] no more "correct offsets" in particle engine previous ray tracer was bugged: it could return position inside wall, so particles were trying to "compensate" for that (wrongly). and they were doing it on *each*(!) think step. as particles are pure eye candy (and i rewrote ray tracer), i removed that "compensator" altogether. --- src/game/g_gfx.pas | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index 4be9437..7afc4ee 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -316,7 +316,8 @@ begin end; -procedure CorrectOffsets(id: Integer); +{ +procedure CorrectOffsets(id: Integer); inline; var part: PParticle; begin @@ -328,6 +329,7 @@ begin // check for left wall if isBlockedAt(part.X-1, part.Y) then part.offsetX := 1; end; +} procedure g_GFX_SparkVel (fX, fY: Integer; Count: Word; VX, VY: Integer; DevX, DevY: Byte); @@ -375,7 +377,7 @@ begin LiveTime := 30+Random(60); ParticleType := PARTICLE_SPARK; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle+2 > MaxParticles then @@ -472,7 +474,7 @@ begin LiveTime := 120+Random(40); ParticleType := PARTICLE_BLOOD; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle >= MaxParticles-1 then @@ -534,7 +536,7 @@ begin LiveTime := 30+Random(60); ParticleType := PARTICLE_SPARK; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle+2 > MaxParticles then @@ -616,7 +618,7 @@ begin LiveTime := 60+Random(60); ParticleType := PARTICLE_WATER; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle+2 > MaxParticles then @@ -701,7 +703,7 @@ begin LiveTime := 60+Random(60); ParticleType := PARTICLE_WATER; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle+2 > MaxParticles then @@ -758,7 +760,7 @@ begin LiveTime := 65535; ParticleType := PARTICLE_BUBBLES; - CorrectOffsets(CurrentParticle); + {CorrectOffsets(CurrentParticle);} end; if CurrentParticle+2 > MaxParticles then @@ -1306,7 +1308,7 @@ begin end; end; // case - CorrectOffsets(a); + {CorrectOffsets(a);} end; // with end; // if end; // for -- 2.29.2