From: Ketmar Dark Date: Sat, 2 Sep 2017 17:48:38 +0000 (+0300) Subject: particles: removed unused water code X-Git-Url: https://deadsoftware.ru/gitweb?a=commitdiff_plain;h=8994fa828e5b4b0c144bd982014d9e1337deef3f;p=d2df-sdl.git particles: removed unused water code --- diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index 4ea5772..824cfce 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -1086,162 +1086,6 @@ begin end; -// ////////////////////////////////////////////////////////////////////////// // -(* -procedure TParticle.thinkerWater (); -var - dX, dY: SmallInt; - pan: TPanel; - ex, ey: Integer; -begin - //TODO: trace wall end when water becomes stick - if (state = TPartState.Stuck) and (Random(30) = 15) then - begin // Ñòåêàåò/îòëèïàåò - velY := 0.5; - accelY := 0.15; - if (stickDX = 0) then - begin - // no walls around, drop - state := TPartState.Normal; - end - else - begin - if justSticked then - begin - if not mapGrid.traceOrthoRayWhileIn(ex, ey, x+stickDX, y, x+stickDX, mapGrid.gridY0+mapGrid.gridHeight, GridTagWall or GridTagDoor or GridTagStep) then - begin - // îòëèïëà - state := TPartState.Normal; - //e_LogWritefln('juststicked unsticked: X=%s; X+stickDX=%s; stickDX=%s; Y=%s', [X, X+stickDX, stickDX, Y]); - end - else - begin - stickEY := ey+1; - justSticked := false; - if (nil <> g_Map_traceToNearest(x, y, x, stickEY, (GridTagWall or GridTagDoor or GridTagStep or GridTagAcid1 or GridTagAcid2 or GridTagWater), @ex, @ey)) then - begin - if (ey > stickEY) then stickEY := ey-1; - end; - //e_LogWritefln('juststicked: X=%s; X+stickDX=%s; stickDX=%s; Y=%s; stickEY=%s', [X, X+stickDX, stickDX, Y, stickEY]); - end; - end - else - begin - if (y >= stickEY) then state := TPartState.Normal; - end; - //if not g_Map_CollidePanel(X-1, Y-1, 3, 3, (PANEL_STEP or PANEL_WALL or PANEL_OPENDOOR or PANEL_CLOSEDOOR)) - end; - exit; - end; - - pan := g_Map_PanelAtPoint(x, y, (GridTagAcid1 or GridTagAcid2 or GridTagWater or GridTagLift)); - if (pan <> nil) then - begin - if ((pan.tag and (GridTagAcid1 or GridTagAcid2 or GridTagWater)) <> 0) then begin die(); exit; end; - if ((pan.PanelType and PANEL_LIFTUP) <> 0) then - begin - if (velY > -4-Random(3)) then velY -= 0.8; - if (Abs(velX) > 0.1) then velX -= velX/10.0; - velX += (Random-Random)*0.2; - accelY := 0.15; - end; - if ((pan.PanelType and PANEL_LIFTLEFT) <> 0) then - begin - if (velX > -8-Random(3)) then velX -= 0.8; - accelY := 0.15; - end; - if ((pan.PanelType and PANEL_LIFTRIGHT) <> 0) then - begin - if (velX < 8+Random(3)) then velX += 0.8; - accelY := 0.15; - end; - end; - - dX := Round(velX); - dY := Round(velY); - - if (state <> TPartState.Stuck) and (Abs(velX) < 0.1) and (Abs(velY) < 0.1) then - begin - // Âèñèò â âîçäóõå - êàïàåò - if (nil = g_Map_traceToNearest(x, y-1, x, y+1, (GridTagWall or GridTagDoor or GridTagStep or GridTagAcid1 or GridTagAcid2 or GridTagWater), @ex, @ey)) then - begin - velY := 0.8; - accelY := 0.5; - state := TPartState.Normal; - end; - end; - - // horizontal - if (dX <> 0) then - begin - pan := g_Map_traceToNearest(x, y, x+dX, y, (GridTagWall or GridTagDoor or GridTagStep or GridTagAcid1 or GridTagAcid2 or GridTagWater), @ex, @ey); - if (x <> ex) then onGround := false; - x := ex; - // free to ride? - if (pan <> nil) then - begin - // nope - if (dY > 0) and ((pan.tag and (GridTagAcid1 or GridTagAcid2 or GridTagWater)) <> 0) then begin die(); exit; end; - // Ñòåíà/äâåðü? - if ((pan.tag and (GridTagWall or GridTagDoor or GridTagStep)) <> 0) then - begin - velX := 0; - velY := 0; - accelX := 0; - accelY := 0; - state := TPartState.Stuck; - justSticked := true; - if (dX > 0) then stickDX := 1 else stickDX := -1; - end; - end; - if (x < 0) or (x >= gMapInfo.Width) then begin die(); exit; end; - end; - // vertical - if (dY <> 0) then - begin - if (dY < 0) or not onGround then - begin - pan := g_Map_traceToNearest(x, y, x, y+dY, (GridTagWall or GridTagDoor or GridTagStep or GridTagAcid1 or GridTagAcid2 or GridTagWater), @ex, @ey); - y := ey; - // free to ride? - if (pan <> nil) then - begin - // nope - if (dY > 0) and ((pan.tag and (GridTagAcid1 or GridTagAcid2 or GridTagWater)) <> 0) then begin die(); exit; end; - // Ñòåíà/äâåðü? - if ((pan.tag and (GridTagWall or GridTagDoor or GridTagStep)) <> 0) then - begin - velX := 0; - velY := 0; - accelX := 0; - accelY := 0; - if (dY > 0) and (state <> TPartState.Stuck) then - begin - state := TPartState.Normal; - end - else - begin - state := TPartState.Stuck; - if (g_Map_PanelAtPoint(x-1, y, (GridTagWall or GridTagDoor or GridTagStep)) <> nil) then stickDX := -1 - else if (g_Map_PanelAtPoint(x+1, y, (GridTagWall or GridTagDoor or GridTagStep)) <> nil) then stickDX := 1 - else stickDX := 0; - justSticked := true; - end; - end; - end; - onGround := (velY >= 0) and g_Map_HasAnyPanelAtPoint(x, y+1, (PANEL_WALL or PANEL_CLOSEDOOR or PANEL_STEP)); - end; - if (y < 0) or (y >= gMapInfo.Height) then begin die(); exit; end; - end; - - velX += accelX; - velY += accelY; - - time += 1; -end; -*) - - // ////////////////////////////////////////////////////////////////////////// // procedure TParticle.thinkerSpark (); var