X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_phys.pas;h=2695eb7e67d9452212b2420da3d65b22177d6ebd;hb=02521d15eb6020ddac536714d2eefedd69fd0f6e;hp=81bdb78d6b095492405bb06c4afaf4d9601749d4;hpb=fdec2c22a805354084c745fd93a535b66d8e3475;p=d2df-sdl.git diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas index 81bdb78..2695eb7 100644 --- a/src/game/g_phys.pas +++ b/src/game/g_phys.pas @@ -17,8 +17,7 @@ unit g_phys; interface -uses - r_graphics; + uses g_base; type PObj = ^TObj; @@ -33,7 +32,6 @@ type slopeFramesLeft: Integer; // frames left to go // for frame interpolation oldX, oldY: Integer; - procedure lerp(t: Single; out fX, fY: Integer); end; const @@ -77,20 +75,18 @@ var implementation -uses - g_map, g_basic, Math, g_player, g_console, SysUtils, - g_sound, g_gfx, MAPDEF, g_monsters, g_game, utils; + uses + {$IFDEF ENABLE_GFX} + g_gfx, + {$ENDIF} + g_map, g_basic, Math, g_player, g_console, SysUtils, + g_sound, MAPDEF, g_monsters, g_game, utils + ; const SmoothSlopeFrames = 4; -procedure TObj.lerp(t: Single; out fX, fY: Integer); -begin - fX := nlerp(oldX, X, t); - fY := nlerp(oldY, Y, t); -end; - function g_Obj_StayOnStep(Obj: PObj): Boolean; inline; begin Result := not g_Map_CollidePanel(Obj^.X+Obj^.Rect.X, Obj^.Y+Obj^.Rect.Y+Obj^.Rect.Height-1, @@ -226,11 +222,13 @@ begin g_Sound_PlayExAt('SOUND_GAME_BULK2', Obj^.X, Obj^.Y); end; - g_GFX_Water(Obj^.X+Obj^.Rect.X+(Obj^.Rect.Width div 2), - Obj^.Y+Obj^.Rect.Y+(Obj^.Rect.Height div 2), - Min(5*(abs(Obj^.Vel.X)+abs(Obj^.Vel.Y)), 50), - -Obj^.Vel.X, -Obj^.Vel.Y, - Obj^.Rect.Width, 16, Color); + {$IFDEF ENABLE_GFX} + g_GFX_Water(Obj^.X+Obj^.Rect.X+(Obj^.Rect.Width div 2), + Obj^.Y+Obj^.Rect.Y+(Obj^.Rect.Height div 2), + Min(5*(abs(Obj^.Vel.X)+abs(Obj^.Vel.Y)), 50), + -Obj^.Vel.X, -Obj^.Vel.Y, + Obj^.Rect.Width, 16, Color); + {$ENDIF} end;