DEADSOFTWARE

made some class' properties published for Holmes
[d2df-sdl.git] / src / game / g_playermodel.pas
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;
@@ -78,7 +79,7 @@ type
   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
@@ -95,7 +96,7 @@ type
     FCurrentWeapon:    Byte;
     FDrawWeapon:       Boolean;
     FFlag:             Byte;
-    FFlagPoint:        TPoint;
+    FFlagPoint:        TDFPoint;
     FFlagAngle:        SmallInt;
     FFlagAnim:         TAnimation;
     FFire:             Boolean;
@@ -114,11 +115,14 @@ type
     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;
 
@@ -141,7 +145,7 @@ type
   TPlayerModelInfo = record
     Info:         TModelInfo;
     ModelSpeed:   Array [A_STAND..A_PAIN] of Byte;
-    FlagPoint:    TPoint;
+    FlagPoint:    TDFPoint;
     FlagAngle:    SmallInt;
     WeaponPoints: TWeaponPoints;
     Gibs:         TGibsArray;
@@ -158,10 +162,10 @@ const
   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));
@@ -198,7 +202,7 @@ begin
   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;
@@ -368,6 +372,7 @@ begin
   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),
@@ -801,7 +806,7 @@ procedure TPlayerModel.Draw(X, Y: Integer; Alpha: Byte = 0);
 var
   Mirror: TMirrorType;
   pos, act: Byte;
-  p: TPoint;
+  p: TDFPoint;
 begin
 // Ôëàãè:
   if Direction = D_LEFT then