index fe68b2b6411242ba2a8fe90ec7a500b637bfb1fa..9e42436ec5a4440f619ec289298c2cf20444f451 100644 (file)
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*)
{$INCLUDE ../shared/a_modes.inc}
+{$M+}
unit g_playermodel;
interface
uses
- g_textures, g_basic, g_weapons, e_graphics, wadreader;
+ MAPDEF, g_textures, g_basic, g_weapons, e_graphics, wadreader;
const
A_STAND = 0;
TGibsArray = Array of TGibSprite;
TWeaponPoints = Array [WP_FIRST + 1..WP_LAST] of
Array [A_STAND..A_LAST] of
- Array [D_LEFT..D_RIGHT] of Array of TPoint;
+ Array [D_LEFT..D_RIGHT] of Array of TDFPoint;
TPlayerModel = class (TObject)
private
FCurrentWeapon: Byte;
FDrawWeapon: Boolean;
FFlag: Byte;
- FFlagPoint: TPoint;
+ FFlagPoint: TDFPoint;
FFlagAngle: SmallInt;
FFlagAnim: TAnimation;
FFire: Boolean;
procedure Update();
procedure Draw(X, Y: Integer; Alpha: Byte = 0);
+ published
property Fire: Boolean read FFire;
property Direction: TDirection read FDirection write FDirection;
property Animation: Byte read FCurrentAnimation;
property Weapon: Byte read FCurrentWeapon;
property Name: String read FName;
+
+ public
property Color: TRGB read FColor write FColor;
end;
TPlayerModelInfo = record
Info: TModelInfo;
ModelSpeed: Array [A_STAND..A_PAIN] of Byte;
- FlagPoint: TPoint;
+ FlagPoint: TDFPoint;
FlagAngle: SmallInt;
WeaponPoints: TWeaponPoints;
Gibs: TGibsArray;
W_ACT_NORMAL = 0;
W_ACT_FIRE = 1;
- FLAG_BASEPOINT: TPoint = (X:16; Y:43);
- FLAG_DEFPOINT: TPoint = (X:32; Y:16);
+ FLAG_BASEPOINT: TDFPoint = (X:16; Y:43);
+ FLAG_DEFPOINT: TDFPoint = (X:32; Y:16);
FLAG_DEFANGLE = -20;
- WEAPONBASE: Array [WP_FIRST + 1..WP_LAST] of TPoint =
+ WEAPONBASE: Array [WP_FIRST + 1..WP_LAST] of TDFPoint =
((X:8; Y:4), (X:8; Y:8), (X:16; Y:16), (X:16; Y:24),
(X:16; Y:16), (X:24; Y:24), (X:16; Y:16), (X:24; Y:24),
(X:16; Y:16), (X:8; Y:8));
end;
end;
-function GetPoint(var str: String; var point: TPoint): Boolean;
+function GetPoint(var str: String; var point: TDFPoint): Boolean;
var
a, x, y: Integer;
s: String;
for b := A_STAND to A_LAST do
begin
aname := s+'_RIGHTANIM'+IntToStr(b);
+ //e_LogWritefln('### MODEL FILE: [%s]', [prefix+config.ReadStr(AnimNames[b], 'resource', '')]);
if not (g_Frames_CreateWAD(nil, aname,
prefix+config.ReadStr(AnimNames[b], 'resource', ''),
64, 64, config.ReadInt(AnimNames[b], 'frames', 1),
var
Mirror: TMirrorType;
pos, act: Byte;
- p: TPoint;
+ p: TDFPoint;
begin
// Ôëàãè:
if Direction = D_LEFT then