Ignore:
Timestamp:
Mar 19, 2021, 12:32:32 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Defined and used more Templates graphic set items.
  • Fixed: Incorrect evaluation of nil graphic set references.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r317 r318  
    102102  Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean;
    103103  const T: TTexture);
    104 procedure PaintLogo(ca: TCanvas; x, y, clLight, clShade: integer);
     104procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: integer);
    105105function SetMainTextureByAge(Age: integer): boolean;
    106106procedure LoadPhrases;
     
    164164  HGrSystem: TGraphicSet;
    165165  HGrSystem2: TGraphicSet;
    166   CityMark1: TGraphicSetItem;
    167   CityMark2: TGraphicSetItem;
    168   Ornament: TGraphicSetItem;
    169   Logo: TGraphicSetItem;
    170   BigBook: TGraphicSetItem;
    171   SmallBook: TGraphicSetItem;
    172   MenuLogo: TGraphicSetItem;
    173166  ClickFrameColor: Integer;
    174167  MainTextureAge: Integer;
     
    183176  InitOrnamentDone: Boolean;
    184177  Phrases2FallenBackToEnglish: Boolean;
     178
     179  // Graphic set items
     180  CityMark1: TGraphicSetItem;
     181  CityMark2: TGraphicSetItem;
     182  Ornament: TGraphicSetItem;
     183  Logo: TGraphicSetItem;
     184  BigBook: TGraphicSetItem;
     185  SmallBook: TGraphicSetItem;
     186  MenuLogo: TGraphicSetItem;
     187  LinkArrows: TGraphicSetItem;
     188  ScienceNationDot: TGraphicSetItem;
     189  ResearchIcon: TGraphicSetItem;
     190  ChangeIcon: TGraphicSetItem;
     191  TreasuryIcon: TGraphicSetItem;
     192  StarshipDeparted: TGraphicSetItem;
     193  WeightOn: TGraphicSetItem;
     194  WeightOff: TGraphicSetItem;
    185195
    186196  UniFont: array [TFontType] of TFont;
     
    15021512end;
    15031513
    1504 procedure PaintLogo(ca: TCanvas; x, y, clLight, clShade: Integer);
     1514procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer);
    15051515begin
    15061516  // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    15071517  LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    1508   BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, ca, x, y);
     1518  BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y);
    15091519  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect,
    1510     clLight, clShade);
    1511   BitBltCanvas(ca, x, y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
     1520    LightColor, ShadeColor);
     1521  BitBltCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
    15121522end;
    15131523
     
    16901700  LoadFonts;
    16911701  Templates := LoadGraphicSet2('Templates.png');
    1692   Logo := Templates.GetItem('Logo');
    1693   BigBook := Templates.GetItem('BigBook');
    1694   SmallBook := Templates.GetItem('SmallBook');
    1695   MenuLogo := Templates.GetItem('MenuLogo');
     1702  with Templates do begin
     1703    Logo := GetItem('Logo');
     1704    BigBook := GetItem('BigBook');
     1705    SmallBook := GetItem('SmallBook');
     1706    MenuLogo := GetItem('MenuLogo');
     1707    LinkArrows := GetItem('LinkArrows');
     1708    ScienceNationDot := GetItem('ScienceNationDot');
     1709    ResearchIcon := GetItem('Research');
     1710    ChangeIcon := GetItem('Change');
     1711    TreasuryIcon := GetItem('Treasury');
     1712    StarshipDeparted := GetItem('StarshipDeparted');
     1713    WeightOn := GetItem('WeightOn');
     1714    WeightOff := GetItem('WeightOff');
     1715  end;
     1716
    16961717  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    16971718  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
Note: See TracChangeset for help on using the changeset viewer.