X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_phys.pas;h=81bdb78d6b095492405bb06c4afaf4d9601749d4;hb=5c816a8e702fd39c65d0928a3315d81e979f30fb;hp=a2a94cea42376c58a14dccfd0eb57cf9e0f10205;hpb=d9d3a0c332180fea8e937779788bca39fa500025;p=d2df-sdl.git diff --git a/src/game/g_phys.pas b/src/game/g_phys.pas index a2a94ce..81bdb78 100644 --- a/src/game/g_phys.pas +++ b/src/game/g_phys.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,7 +18,7 @@ unit g_phys; interface uses - e_graphics; + r_graphics; type PObj = ^TObj; @@ -32,6 +31,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 @@ -83,6 +85,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