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/Term.pas

    r346 r352  
    16911691        Controls[i].Visible := false;
    16921692    me := -1;
    1693     SetMainTextureByAge(-1);
     1693    MainTexture.Age := -1;
    16941694    with Panel.Canvas do
    16951695    begin
     
    17281728    { if MyRO.Happened and phGameEnd<>0 then
    17291729      begin
    1730       Age:=3;
    1731       SetMainTextureByAge(-1);
     1730      Age := 3;
     1731      MainTexture.Age := -1;
    17321732      end
    17331733      else }
    17341734    begin
    17351735      Age := GetAge(me);
    1736       if SetMainTextureByAge(Age) then
     1736      if MainTexture.Age <> Age then begin
     1737        MainTexture.Age := Age;
    17371738        EOT.Invalidate; // has visible background parts in its bounds
     1739      end;
    17381740    end;
    17391741    // age:=MyRO.Turn mod 4; //!!!
     
    17481750  begin
    17491751    Age := 0;
    1750     SetMainTextureByAge(-1);
     1752    MainTexture.Age := -1;
    17511753    if ClientMode = cMovieTurn then
    17521754      EOT.ButtonIndex := eotCancel
     
    25382540        Age := 0;
    25392541        if Command = cHelpOnly then
    2540           SetMainTextureByAge(-1);
     2542          MainTexture.Age := -1;
    25412543        Tribes.Init;
    25422544        HelpDlg.UserLeft := (Screen.width - HelpDlg.width) div 2;
     
    42654267        xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2,
    42664268        xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + 2 + G.ly - 1,
    4267         MainTexture.clMark, MainTexture.clMark)
     4269        MainTexture.ColorMark, MainTexture.ColorMark)
    42684270    else
    42694271      Frame(Panel.Canvas,
    42704272        xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2 + yw,
    42714273        xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + yw + MapHeight div yyt,
    4272         MainTexture.clMark, MainTexture.clMark);
     4274        MainTexture.ColorMark, MainTexture.ColorMark);
    42734275  end;
    42744276end;
     
    43014303  begin
    43024304    Fill(Panel.Canvas, 0, 3, xMidPanel + 7 - 10, PanelHeight - 3,
    4303       wMainTexture - (xMidPanel + 7 - 10), hMainTexture - PanelHeight);
     4305      MainTexture.Width - (xMidPanel + 7 - 10), MainTexture.Height - PanelHeight);
    43044306    Fill(Panel.Canvas, xRightPanel + 10 - 7, 3, Panel.width - xRightPanel - 10 +
    4305       7, PanelHeight - 3, -(xRightPanel + 10 - 7), hMainTexture - PanelHeight);
     4307      7, PanelHeight - 3, -(xRightPanel + 10 - 7), MainTexture.Height - PanelHeight);
    43064308    FillLarge(Panel.Canvas, xMidPanel - 2, PanelHeight - MidPanelHeight,
    43074309      xRightPanel + 2, PanelHeight, ClientWidth div 2);
     
    43154317    LineTo(xRightPanel, 0);
    43164318    LineTo(ClientWidth, 0);
    4317     Pen.Color := MainTexture.clBevelLight;
     4319    Pen.Color := MainTexture.ColorBevelLight;
    43184320    MoveTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 2);
    43194321    LineTo(xRightPanel + 10 - 8, PanelHeight - MidPanelHeight + 2);
    4320     Pen.Color := MainTexture.clBevelLight;
     4322    Pen.Color := MainTexture.ColorBevelLight;
    43214323    MoveTo(0, 1);
    43224324    LineTo(xMidPanel + 7 - 9, 1);
    4323     Pen.Color := MainTexture.clBevelShade;
     4325    Pen.Color := MainTexture.ColorBevelShade;
    43244326    LineTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 1);
    4325     Pen.Color := MainTexture.clBevelLight;
     4327    Pen.Color := MainTexture.ColorBevelLight;
    43264328    LineTo(xRightPanel + 10 - 9, PanelHeight - MidPanelHeight + 1);
    4327     Pen.Color := MainTexture.clBevelLight;
     4329    Pen.Color := MainTexture.ColorBevelLight;
    43284330    LineTo(xRightPanel + 10 - 9, 1);
    43294331    LineTo(ClientWidth, 1);
     
    43334335    MoveTo(0, 2);
    43344336    LineTo(xMidPanel + 7 - 10, 2);
    4335     Pen.Color := MainTexture.clBevelShade;
     4337    Pen.Color := MainTexture.ColorBevelShade;
    43364338    LineTo(xMidPanel + 7 - 10, PanelHeight);
    43374339    Corner(Panel.Canvas, xMidPanel + 7 - 16, 1, 1, MainTexture);
     
    44724474              ScreenTools.Frame(Panel.Canvas, xTroop + 1 + x,
    44734475                yTroop + 6 - yyt div 2, xTroop + 2 * xxt - 1 + x,
    4474                 yTroop + 2 * yyt + 10, MainTexture.clMark, MainTexture.clMark);
     4476                yTroop + 2 * yyt + 10, MainTexture.ColorMark, MainTexture.ColorMark);
    44754477            end;
    44764478          end;
     
    45904592        else
    45914593          x := xTroop - 152;
    4592         Pen.Color := MainTexture.clBevelShade;
     4594        Pen.Color := MainTexture.ColorBevelShade;
    45934595        MoveTo(x - 1, PanelHeight - MidPanelHeight + 2);
    45944596        LineTo(x - 1, PanelHeight);
    4595         Pen.Color := MainTexture.clBevelLight;
     4597        Pen.Color := MainTexture.ColorBevelLight;
    45964598        MoveTo(x, PanelHeight - MidPanelHeight + 2);
    45974599        LineTo(x, PanelHeight);
     
    46314633                        ScreenTools.Frame(Panel.Canvas, xTroop + 3 + x,
    46324634                          yTroop + 2, xTroop + 63 + x, yTroop + 46,
    4633                           MainTexture.clMark, MainTexture.clMark);
     4635                          MainTexture.ColorMark, MainTexture.ColorMark);
    46344636                      end
    46354637                      else if (unx.Master >= 0) and (unx.Master = UnFocus) then
     
    46384640                          xTroop + 64 + x, yTroop + 47, 8, $000000);
    46394641                        CFrame(Panel.Canvas, xTroop + 3 + x, yTroop + 2,
    4640                           xTroop + 63 + x, yTroop + 46, 8, MainTexture.clMark);
     4642                          xTroop + 63 + x, yTroop + 46, 8, MainTexture.ColorMark);
    46414643                      end;
    46424644                      NoMapPanel.SetOutput(Panel);
     
    47334735          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47344736            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4735             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight)
     4737            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight)
    47364738    end; { if TroopLoc>=0 }
    47374739  end;
     
    47494751          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47504752            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4751             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4753            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47524754        end;
    47534755      end;
     
    47634765          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47644766            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4765             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4767            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47664768        end;
    47674769  end;
     
    47804782    MoveTo(0, TopBarHeight - 1);
    47814783    LineTo(ClientWidth, TopBarHeight - 1);
    4782     Pen.Color := MainTexture.clBevelShade;
     4784    Pen.Color := MainTexture.ColorBevelShade;
    47834785    MoveTo(0, TopBarHeight - 2);
    47844786    LineTo(ClientWidth, TopBarHeight - 2);
    47854787    MoveTo(0, TopBarHeight - 3);
    47864788    LineTo(ClientWidth, TopBarHeight - 3);
    4787     Pen.Color := MainTexture.clBevelLight;
     4789    Pen.Color := MainTexture.ColorBevelLight;
    47884790    ScreenTools.Frame(TopBar.Canvas, 40, -1, xTreasurySection - 1,
    4789       TopBarHeight - 7, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4791      TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47904792    ScreenTools.Frame(TopBar.Canvas, xResearchSection + 332, -1, ClientWidth,
    4791       TopBarHeight - 7, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4793      TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47924794  end;
    47934795  if GameMode <> cMovie then
     
    52245226          Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt),
    52255227            yMini + 2, xMini + 1 + G.lx + MapWidth div (2 * xxt),
    5226             yMini + 2 + G.ly - 1, MainTexture.clMark, MainTexture.clMark)
     5228            yMini + 2 + G.ly - 1, MainTexture.ColorMark, MainTexture.ColorMark)
    52275229        else
    52285230          Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt),
    52295231            yMini + 2 + yw, xMini + 2 + G.lx + MapWidth div (2 * xxt) - 1,
    5230             yMini + 2 + yw + MapHeight div yyt - 2, MainTexture.clMark,
    5231             MainTexture.clMark);
     5232            yMini + 2 + yw + MapHeight div yyt - 2, MainTexture.ColorMark,
     5233            MainTexture.ColorMark);
    52325234      end;
    52335235      RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
     
    74927494        Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), 0,
    74937495          x - xMini - 2 + MapWidth div (xxt * 2) - 1, G.ly - 1,
    7494           MainTexture.clMark, MainTexture.clMark)
     7496          MainTexture.ColorMark, MainTexture.ColorMark)
    74957497      else
    74967498        Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), yw,
    74977499          x - xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt -
    7498           2, MainTexture.clMark, MainTexture.clMark);
     7500          2, MainTexture.ColorMark, MainTexture.ColorMark);
    74997501      BitBltCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    75007502        Buffer.Canvas, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.