Changeset 314 for trunk/LocalPlayer


Ignore:
Timestamp:
Mar 18, 2021, 9:46:52 PM (4 years ago)
Author:
chronos
Message:
  • Added: Graphic set can now load dimensions of its graphic set items from a file. This effort should help with elimination of hardcoded graphic items dimensions in graphics sets. Gradually all graphic sets should have description of their items.
Location:
trunk/LocalPlayer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r313 r314  
    66uses
    77  Protocol, ClientTools, ScreenTools, Tribes, {$IFNDEF SCR}Term, {$ENDIF}
    8   LCLIntf, LCLType, SysUtils, Classes, Graphics, UPixelPointer;
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, UPixelPointer, UGraphicSet;
    99
    1010type
     
    5151    procedure FillRect(x, y, Width, Height, Color: integer);
    5252    procedure Textout(x, y, Color: integer; const s: string);
    53     procedure Sprite(HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer);
     53    procedure Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    5454    procedure TSprite(xDst, yDst, grix: integer; PureBlack: boolean = false);
    5555
     
    144144  xSrc: Integer;
    145145  ySrc: Integer;
    146   HGrTerrainNew: TGrExtDescr;
    147   HGrCitiesNew: TGrExtDescr;
     146  HGrTerrainNew: TGraphicSet;
     147  HGrCitiesNew: TGraphicSet;
    148148  Age: Integer;
    149149  Size: Integer;
     
    534534end;
    535535
    536 procedure TIsoMap.Sprite(HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer);
     536procedure TIsoMap.Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    537537begin
    538538  BitBltBitmap(HGr.Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND);
     
    640640var
    641641  age: Integer;
    642   cHGr: TGrExtDescr;
     642  cHGr: TGraphicSet;
    643643  cpix: Integer;
    644644  xGr: Integer;
  • trunk/LocalPlayer/Term.pas

    r313 r314  
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1414  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types,
    15   Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area;
     15  Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area,
     16  UGraphicSet;
    1617
    1718const
     
    445446  SoundPreloadDone: Integer;
    446447  MarkCityLoc: Integer;
    447   HGrTerrain: TGrExtDescr;
    448   HGrCities: TGrExtDescr;
     448  HGrTerrain: TGraphicSet;
     449  HGrCities: TGraphicSet;
    449450  MovieSpeed: Integer;
    450451  CityRepMask: Cardinal;
     
    43144315    Sprite(Panel, HGrSystem, xMini - 2 + (4 * G.lx + 2 * (MarkCityLoc mod G.lx)
    43154316      + (G.lx - MapWidth div (xxt * 2)) - 2 * xwd) mod (2 * G.lx) +
    4316       MarkCityLoc div G.lx and 1, yMini - 3 + MarkCityLoc div G.lx, 10,
    4317       10, 77, 47)
     4317      MarkCityLoc div G.lx and 1, yMini - 3 + MarkCityLoc div G.lx, CityMark2.Width,
     4318      CityMark2.Height, CityMark2.Left, CityMark2.Top)
    43184319  else if ywmax <= 0 then
    43194320    Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2,
  • trunk/LocalPlayer/Tribes.pas

    r313 r314  
    55
    66uses
    7   Protocol, ScreenTools, LazFileUtils, Classes, Graphics, SysUtils, Global;
     7  Protocol, ScreenTools, LazFileUtils, Classes, Graphics, SysUtils, Global,
     8  UGraphicSet;
    89
    910type
     
    1415
    1516  TModelPicture = record
    16     HGr: TGrExtDescr;
     17    HGr: TGraphicSet;
    1718    pix: Integer;
    1819    xShield: Integer;
     
    2930
    3031  TTribe = class
    31     symHGr: TGrExtDescr;
     32    symHGr: TGraphicSet;
    3233    sympix: Integer;
    33     faceHGr: TGrExtDescr;
     34    faceHGr: TGraphicSet;
    3435    facepix: Integer;
    35     cHGr: TGrExtDescr;
     36    cHGr: TGraphicSet;
    3637    cpix: Integer;
    3738    // symbol and city graphics
     
    6263var
    6364  Tribe: array [0 .. nPl - 1] of TTribe;
    64   HGrStdUnits: TGrExtDescr;
     65  HGrStdUnits: TGraphicSet;
    6566
    6667procedure Init;
     
    7071procedure FindStdModelPicture(Code: Integer; var pix: Integer; var Name: string);
    7172function GetTribeInfo(FileName: string; var Name: string; var Color: TColor): Boolean;
    72 procedure FindPosition(HGr: TGrExtDescr; x, y, xmax, ymax: Integer; Mark: TColor;
     73procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;
    7374  var xp, yp: Integer);
    7475
     
    8283  TChosenModelPictureInfo = record
    8384    Hash: Integer;
    84     HGr: TGrExtDescr;
     85    HGr: TGraphicSet;
    8586    pix: Integer;
    8687    ModelName: ShortString;
     
    328329end;
    329330
    330 procedure FindPosition(HGr: TGrExtDescr; x, y, xmax, ymax: Integer; Mark: TColor;
     331procedure FindPosition(HGr: TGraphicSet; x, y, xmax, ymax: Integer; Mark: TColor;
    331332  var xp, yp: Integer);
    332333begin
     
    560561  i: Integer;
    561562  Cnt: Integer;
    562   HGr: TGrExtDescr;
     563  HGr: TGraphicSet;
    563564  Used: Integer;
    564565  LeastUsed: Integer;
Note: See TracChangeset for help on using the changeset viewer.