Ignore:
Timestamp:
Apr 6, 2021, 10:16:55 PM (3 years ago)
Author:
chronos
Message:
  • Modified: TTexture changed from record to class.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r350 r352  
    8282    ProdHint: Boolean;
    8383    AllowChange: Boolean;
     84    RedTex: TTexture;
     85    BarTex: TTexture;
    8486    procedure InitSmallCityMap;
    8587    procedure InitZoomCityMap;
     
    197199begin
    198200  inherited;
     201  RedTex := TTexture.Create;
     202  BarTex := TTexture.Create;
    199203  AreaMap := TIsoMap.Create;
    200204  AreaMap.SetOutput(offscreen);
     
    259263  FreeAndNil(Template);
    260264  FreeAndNil(Back);
     265  FreeAndNil(RedTex);
     266  FreeAndNil(BarTex);
    261267end;
    262268
     
    269275procedure TCityDlg.CheckAge;
    270276begin
    271   if MainTextureAge <> AgePrepared then
    272   begin
    273     AgePrepared := MainTextureAge;
     277  if MainTexture.Age <> AgePrepared then begin
     278    AgePrepared := MainTexture.Age;
    274279
    275280    UnshareBitmap(Back);
     
    388393  procedure FillBar(x, y, pos, Growth, max, Kind: integer;
    389394    IndicateComplete: boolean);
    390   var
    391     Tex: TTexture;
    392   begin
    393     Tex := MainTexture;
    394     if Kind = 3 then
    395     begin
    396       Tex.clBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36];
    397       Tex.clBevelShade := Tex.clBevelLight;
     395  begin
     396    BarTex.Assign(MainTexture);
     397    if Kind = 3 then begin
     398      BarTex.ColorBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36];
     399      BarTex.ColorBevelShade := BarTex.ColorBevelLight;
    398400    end;
    399401    PaintRelativeProgressBar(offscreen.Canvas, Kind, x - 3, y, wBar - 4, pos,
    400       Growth, max, IndicateComplete, Tex);
     402      Growth, max, IndicateComplete, BarTex);
    401403  end;
    402404
     
    492494  UnitInfo: TUnitInfo;
    493495  UnitReport: TUnitReport;
    494   RedTex: TTexture;
    495496  IsCityAlive, CanGrow: boolean;
    496497begin
     
    524525    Report.Working := c.Size;
    525526
    526   RedTex := MainTexture;
    527   RedTex.clBevelLight := $0000FF;
    528   RedTex.clBevelShade := $000000;
    529   RedTex.clTextLight := $000000;
    530   RedTex.clTextShade := $0000FF;
     527  RedTex.Assign(MainTexture);
     528  RedTex.ColorBevelLight := $0000FF;
     529  RedTex.ColorBevelShade := $000000;
     530  RedTex.ColorTextLight := $000000;
     531  RedTex.ColorTextShade := $0000FF;
    531532
    532533  BitBltCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);
     
    797798    Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
    798799      ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49,
    799       ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.clMark,
    800       MainTexture.clMark);
     800      ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.ColorMark,
     801      MainTexture.ColorMark);
    801802  Frame(offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap,
    802803    ySmallMap + hSmallMap, $B0B0B0, $FFFFFF);
     
    812813  if Mode = mSupp then
    813814  begin
    814     offscreen.Canvas.brush.Color := MainTexture.clMark;
     815    offscreen.Canvas.brush.Color := MainTexture.ColorMark;
    815816    offscreen.Canvas.FillRect(Rect(x - 27, y - 6, x + 27, y + 6));
    816817    offscreen.Canvas.brush.style := bsClear;
Note: See TracChangeset for help on using the changeset viewer.