Changeset 380 for trunk


Ignore:
Timestamp:
Apr 25, 2021, 10:39:00 AM (4 years ago)
Author:
chronos
Message:
  • Modified: TTexture class moved to seprate unit.
Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r374 r380  
    88  Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
    99  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    10   ButtonA, ButtonC, Area, GraphType;
     10  ButtonA, ButtonC, Area, GraphType, UTexture;
    1111
    1212const
  • trunk/LocalPlayer/UnitStat.pas

    r362 r380  
    5252
    5353uses
    54   Tribes, Help, Directories;
     54  Tribes, Help, Directories, UTexture;
    5555
    5656{$R *.lfm}
  • trunk/Packages/CevoComponents/CevoComponents.lpk

    r314 r380  
    3737    <Description Value="C-evo components"/>
    3838    <Version Major="1" Minor="2"/>
    39     <Files Count="17">
     39    <Files Count="18">
    4040      <Item1>
    4141        <Filename Value="Area.pas"/>
     
    114114        <UnitName Value="UXMLUtils"/>
    115115      </Item17>
     116      <Item18>
     117        <Filename Value="UTexture.pas"/>
     118        <UnitName Value="UTexture"/>
     119      </Item18>
    116120    </Files>
    117121    <RequiredPkgs Count="2">
  • trunk/Packages/CevoComponents/CevoComponents.pas

    r314 r380  
    1111  Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg,
    1212  Sound, BaseWin, UPixelPointer, AsyncProcess2, UGraphicSet, UXMLUtils,
    13   LazarusPackageIntf;
     13  UTexture, LazarusPackageIntf;
    1414
    1515implementation
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r375 r380  
    88  {$ENDIF}
    99  StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math,
    10   Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils;
     10  Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils, UTexture;
    1111
    1212type
    13 
    14   { TTexture }
    15 
    16   TTexture = class
    17   private
    18     FAge: Integer;
    19     function GetHeight: Integer;
    20     function GetWidth: Integer;
    21     procedure SetAge(AValue: Integer);
    22   public
    23     Image: TBitmap;
    24     ColorBevelLight: TColor;
    25     ColorBevelShade: TColor;
    26     ColorTextLight: TColor;
    27     ColorTextShade: TColor;
    28     ColorLitText: TColor;
    29     ColorMark: TColor;
    30     ColorPage: TColor;
    31     ColorCover: TColor;
    32     constructor Create;
    33     destructor Destroy; override;
    34     procedure Assign(Source: TTexture);
    35     property Age: Integer read FAge write SetAge;
    36     property Width: Integer read GetWidth;
    37     property Height: Integer read GetHeight;
    38   end;
    39 
    4013  TLoadGraphicFileOption = (gfNoError, gfNoGamma);
    4114  TLoadGraphicFileOptions = set of TLoadGraphicFileOption;
     
    18441817end;
    18451818
    1846 { TTexture }
    1847 
    1848 procedure TTexture.SetAge(AValue: Integer);
    1849 begin
    1850   if FAge = AValue then Exit;
    1851   FAge := AValue;
    1852   LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +
    1853     'Texture' + IntToStr(Age + 1) + '.jpg');
    1854   ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];
    1855   ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
    1856   ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];
    1857   ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];
    1858   ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];
    1859   ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];
    1860   ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];
    1861   ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];
    1862 end;
    1863 
    1864 function TTexture.GetHeight: Integer;
    1865 begin
    1866   Result := Image.Height;
    1867 end;
    1868 
    1869 function TTexture.GetWidth: Integer;
    1870 begin
    1871   Result := Image.Width;
    1872 end;
    1873 
    1874 constructor TTexture.Create;
    1875 begin
    1876   Image := TBitmap.Create;
    1877   FAge := -2;
    1878 end;
    1879 
    1880 destructor TTexture.Destroy;
    1881 begin
    1882   FreeAndNil(Image);
    1883   inherited;
    1884 end;
    1885 
    1886 procedure TTexture.Assign(Source: TTexture);
    1887 begin
    1888   FAge := Source.FAge;
    1889   Image.Assign(Image);
    1890   ColorBevelLight := Source.ColorBevelLight;
    1891   ColorBevelShade := Source.ColorBevelShade;
    1892   ColorTextLight := Source.ColorTextLight;
    1893   ColorTextShade := Source.ColorTextShade;
    1894   ColorLitText := Source.ColorLitText;
    1895   ColorMark := Source.ColorMark;
    1896   ColorPage := Source.ColorPage;
    1897   ColorCover := Source.ColorCover;
    1898 end;
    1899 
    19001819end.
Note: See TracChangeset for help on using the changeset viewer.