X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_phys.pas;h=69199797b06237a4ac9023f44ced5fc1868a4ad2;hb=c5684c0c980bb96fd4fd0efae4d48cdeb469c8ff;hp=9d93a5b560ec059d0dc6e5d984103f66acf88d57;hpb=987c4a835a103345b59937e8e1be8524a6228712;p=d2df-sdl.git diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas index 9d93a5b..6919979 100644 --- a/src/game/g_phys.pas +++ b/src/game/g_phys.pas @@ -17,8 +17,7 @@ unit g_phys; interface -uses - e_graphics; + uses g_base; type PObj = ^TObj; @@ -31,6 +30,9 @@ type // this is purely visual change, it won't affect anything else slopeUpLeft: Integer; // left to go slopeFramesLeft: Integer; // frames left to go + // for frame interpolation + oldX, oldY: Integer; + procedure lerp(t: Single; out fX, fY: Integer); end; const @@ -82,6 +84,11 @@ uses 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