diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index 44a9db46fc7adcc63d9c3b734a55f55bbab9d275..c84ba47eda80a1e2c6097a134a78d5ba0929a212 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
procedure g_GFX_OnceAnim(X, Y: Integer; Anim: TAnimation; AnimType: Byte = 0);
-//procedure g_Mark(x, y, Width, Height: Integer; t: Byte; st: Boolean);
+procedure g_Mark(x, y, Width, Height: Integer; t: Byte; st: Boolean);
procedure g_GFX_Update();
procedure g_GFX_Draw();
+var
+ gpart_dbg_enabled: Boolean = true;
+ gpart_dbg_phys_enabled: Boolean = true;
+
+
implementation
uses
State: Byte;
ParticleType: Byte;
offsetX, offsetY: ShortInt;
+ // for bubbles
+ liquidTopY: Integer; // don't float higher than this
end;
TOnceAnim = record
function isBlockedAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, (PANEL_WALL or PANEL_CLOSEDOOR or PANEL_STEP));
end;
-
// ???
function isWallAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, (PANEL_WALL or PANEL_STEP));
end;
-
function isLiftUpAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, PANEL_LIFTUP);
end;
function isLiftDownAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, PANEL_LIFTDOWN);
end;
function isLiftLeftAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, PANEL_LIFTLEFT);
end;
function isLiftRightAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, PANEL_LIFTRIGHT);
end;
-
function isLiquidAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, (PANEL_WATER or PANEL_ACID1 or PANEL_ACID2));
end;
-
function isAnythingAt (x, y: Integer): Boolean; inline;
begin
+ if not gpart_dbg_phys_enabled then begin result := false; exit; end;
result := g_Map_HasAnyPanelAtPoint(x, y, (PANEL_WALL or PANEL_CLOSEDOOR or PANEL_OPENDOOR or PANEL_WATER or PANEL_ACID1 or PANEL_ACID2 or PANEL_STEP or PANEL_LIFTUP or PANEL_LIFTDOWN or PANEL_LIFTLEFT or PANEL_LIFTRIGHT));
end;
-{$IF DEFINED(HAS_COLLIDE_BITMAP)}
procedure g_Mark(x, y, Width, Height: Integer; t: Byte; st: Boolean);
+{$IF not DEFINED(HAS_COLLIDE_BITMAP)}
+begin
+end;
+{$ELSE}
var
yy, y2, xx, x2: Integer;
begin
end;
-procedure CorrectOffsets(id: Integer);
+{
+procedure CorrectOffsets(id: Integer); inline;
var
part: PParticle;
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);
LiveTime := 30+Random(60);
ParticleType := PARTICLE_SPARK;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle+2 > MaxParticles then
LiveTime := 120+Random(40);
ParticleType := PARTICLE_BLOOD;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle >= MaxParticles-1 then
LiveTime := 30+Random(60);
ParticleType := PARTICLE_SPARK;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle+2 > MaxParticles then
LiveTime := 60+Random(60);
ParticleType := PARTICLE_WATER;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle+2 > MaxParticles then
LiveTime := 60+Random(60);
ParticleType := PARTICLE_WATER;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle+2 > MaxParticles then
end;
end;
+
procedure g_GFX_Bubbles(fX, fY: Integer; Count: Word; DevX, DevY: Byte);
var
a: Integer;
DevX1, DevX2,
DevY1, DevY2: Byte;
- l: Integer;
+ l, liquidx: Integer;
begin
l := Length(Particles);
if l = 0 then
(Y >= gMapInfo.Height) or (Y <= 0) then
Continue;
+ (*
+ // don't spawn bubbles outside of the liquid
if not isLiquidAt(X, Y) {ByteBool(gCollideMap[Y, X] and MARK_LIQUID)} then
Continue;
+ *)
+
+ // trace liquid, so we'll know where it ends; do it in 8px steps for speed
+ // tracer will return `false` if we started outside of the liquid
+ if not g_Map_TraceLiquid(X, Y, 0, -8, liquidx, liquidTopY) then continue;
VelX := 0;
VelY := -1-Random;
LiveTime := 65535;
ParticleType := PARTICLE_BUBBLES;
- CorrectOffsets(CurrentParticle);
+ {CorrectOffsets(CurrentParticle);}
end;
if CurrentParticle+2 > MaxParticles then
s: ShortInt;
//c: Byte;
begin
+ if not gpart_dbg_enabled then exit;
if Particles <> nil then
begin
w := gMapInfo.Width;
end;
end; // case
- CorrectOffsets(a);
+ {CorrectOffsets(a);}
end; // with
end; // if
end; // for