Changeset 469


Ignore:
Timestamp:
Dec 3, 2023, 8:33:43 PM (5 months ago)
Author:
chronos
Message:
  • Fixed: City screen size sometimes not correctly loaded.
  • Modified: Code cleanup.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpi

    r468 r469  
    402402      <Debugging>
    403403        <DebugInfoType Value="dsDwarf2Set"/>
     404        <UseHeaptrc Value="True"/>
    404405        <UseExternalDbgSyms Value="True"/>
    405406      </Debugging>
  • trunk/LocalPlayer/CityScreen.lfm

    r232 r469  
    11object CityDlg: TCityDlg
    22  Left = 1186
     3  Height = 480
    34  Top = 183
     5  Width = 640
    46  BorderIcons = []
    57  BorderStyle = bsNone
  • trunk/LocalPlayer/CityScreen.pas

    r468 r469  
    88  Protocol, ClientTools, ScreenTools, IsoEngine, BaseWin, LCLIntf, LCLType,
    99  Messages, SysUtils, Classes, ButtonA, ButtonC, Area, GraphType, Texture,
    10   System.UITypes,
    1110  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.ExtCtrls{$ELSE}
    1211  Graphics, Controls, Forms, ExtCtrls{$ENDIF};
     
    195194procedure TCityDlg.FormCreate(Sender: TObject);
    196195begin
    197   inherited;
    198196  RedTex := TTexture.Create;
    199197  BarTex := TTexture.Create;
     
    277275
    278276    UnshareBitmap(Back);
    279     BitBltCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
     277    BitBltCanvas(Back.Canvas, 0, 0, Width, Height,
    280278      MainTexture.Image.Canvas, 0, 0);
    281     ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight);
     279    ImageOp_B(Back, Template, 0, 0, 0, 0, Width, Height);
    282280  end;
    283281end;
     
    364362      end;
    365363    end;
    366     Brush.style := TBrushStyle.bsClear;
     364    Brush.Style := TBrushStyle.bsClear;
    367365  end;
    368366end;
     
    539537    Brush.Color := $FFFFFF;
    540538    FillRect(Rect(8, 7, 36, 32));
    541     Brush.style := TBrushStyle.bsClear;
     539    Brush.Style := TBrushStyle.bsClear;
    542540    Font.Color := $000000;
    543541    S := IntToStr(C.Size);
  • trunk/LocalPlayer/IsoEngine.pas

    r468 r469  
    9797      Status: Integer);
    9898    procedure PaintCity(X, Y: Integer; const CityInfo: TCityInfo;
    99       accessory: Boolean = True);
     99      Accessory: Boolean = True);
    100100    procedure BitBltBitmap(Src: TBitmap; X, Y, Width, Height, xSrc, ySrc,
    101101      Rop: Integer);
     
    715715      if Flags and unFortified <> 0 then
    716716      begin
    717         { DataCanvas:=HGrTerrain.Data.Canvas;
    718           MaskCanvas:=HGrTerrain.Mask.Canvas;
    719           TSprite(X,Y+16,12*9+7); }
     717        { DataCanvas := HGrTerrain.Data.Canvas;
     718          MaskCanvas := HGrTerrain.Mask.Canvas;
     719          TSprite(X, Y + 16, 12 * 9 + 7); }
    720720        Sprite(HGrStdUnits, X, Y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1);
    721721      end;
     
    724724
    725725procedure TIsoMap.PaintCity(X, Y: Integer; const CityInfo: TCityInfo;
    726   accessory: Boolean);
    727 var
    728   age: Integer;
     726  Accessory: Boolean);
     727var
     728  Age: Integer;
    729729  cHGr: TGraphicSet;
    730730  cpix: Integer;
     
    737737  S: string;
    738738begin
    739   age := GetAge(CityInfo.Owner);
     739  Age := GetAge(CityInfo.Owner);
    740740  if CityInfo.size < 5 then
    741741    xGr := 0
     
    746746  else
    747747    xGr := 3;
    748   Tribe[CityInfo.Owner].InitAge(age);
    749   if age < 2 then
     748  Tribe[CityInfo.Owner].InitAge(Age);
     749  if Age < 2 then
    750750  begin
    751751    cHGr := Tribe[CityInfo.Owner].cHGr;
     
    764764    if ciWalled and CityInfo.Flags <> 0 then
    765765      Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt,
    766         (xGr + 4) * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1))
     766        (xGr + 4) * (2 * xxt + 1) + 1, 1 + (Age - 2) * (3 * yyt + 1))
    767767    else
    768768      Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt,
    769         xGr * (2 * xxt + 1) + 1, 1 + (age - 2) * (3 * yyt + 1));
    770   end;
    771 
    772   if not accessory then
     769        xGr * (2 * xxt + 1) + 1, 1 + (Age - 2) * (3 * yyt + 1));
     770  end;
     771
     772  if not Accessory then
    773773    Exit;
    774774
    775   { if ciCapital and CityInfo.Flags<>0 then
    776     Sprite(Tribe[CityInfo.Owner].symHGr,X+cpic.xf,Y-13+cpic.yf,13,14,
    777     1+Tribe[CityInfo.Owner].sympix mod 10 *65,
    778     1+Tribe[CityInfo.Owner].sympix div 10 *49); {capital -- paint flag }
     775  { if ciCapital and CityInfo.Flags <> 0 then
     776    Sprite(Tribe[CityInfo.Owner].symHGr, X + cpic.xf, Y - 13 + cpic.yf, 13, 14,
     777    1 + Tribe[CityInfo.Owner].sympix mod 10 * 65,
     778    1 + Tribe[CityInfo.Owner].sympix div 10 * 49); (*capital -- paint flag *)
     779  }
    779780
    780781  if MyMap[CityInfo.Loc] and fObserved <> 0 then
    781782  begin
    782     if age < 2 then
     783    if Age < 2 then
    783784    begin
    784785      cpic := Tribe[CityInfo.Owner].CityPicture[xGr];
     
    788789    else
    789790    begin
    790       cpic := CitiesPictures.Pictures[age, xGr];
     791      cpic := CitiesPictures.Pictures[Age, xGr];
    791792      xShield := X - xxt + cpic.xShield;
    792793      yShield := Y - 2 * yyt + cpic.yShield;
     
    12401241  else if ShowObjects then
    12411242  begin
    1242     { if (CityLoc<0) and (UnFocus>=0) and (Loc=MyUn[UnFocus].Loc) then
    1243       if BlinkOn then TSprite(X,Y,8+9*0)
    1244       else TSprite(X,Y,8+9*1); }
     1243    { if (CityLoc < 0) and (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then
     1244      if BlinkOn then TSprite(X, Y, 8 + 9 * 0)
     1245      else TSprite(X, Y, 8 + 9 * 1); }
    12451246
    12461247    NameCity;
     
    12791280            PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo,
    12801281              MyUn[uix].Status);
    1281           // if Showuix then Textout(x+16,y+5,$80FF00,IntToStr(uix));
     1282          // if Showuix then Textout(x + 16, y + 5, $80FF00, IntToStr(uix));
    12821283        end
    12831284        else {$ENDIF} PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 0);
     
    13061307procedure TIsoMap.PaintGrid(X, Y, nx, ny: Integer);
    13071308
    1308   procedure ClippedLine(dx0, dy0: Integer; mirror: Boolean);
     1309  procedure ClippedLine(dx0, dy0: Integer; Mirror: Boolean);
    13091310  var
    13101311    x0, x1, dxmin, dymin, dxmax, dymax, N: Integer;
     
    13171318      dymax := (RealBottom - Y - 1) div yyt + 1;
    13181319      N := dymax - dy0;
    1319       if mirror then
     1320      if Mirror then
    13201321      begin
    13211322        if dx0 - dxmin < N then
     
    13251326          N := N - (dx0 - dxmax);
    13261327          dy0 := dy0 + (dx0 - dxmax);
    1327           dx0 := dxmax
     1328          dx0 := dxmax;
    13281329        end;
    13291330        if dy0 < dymin then
     
    13311332          N := N - (dymin - dy0);
    13321333          dx0 := dx0 - (dymin - dy0);
    1333           dy0 := dymin
     1334          dy0 := dymin;
    13341335        end;
    13351336      end
     
    13421343          N := N - (dxmin - dx0);
    13431344          dy0 := dy0 + (dxmin - dx0);
    1344           dx0 := dxmin
     1345          dx0 := dxmin;
    13451346        end;
    13461347        if dy0 < dymin then
     
    13481349          N := N - (dymin - dy0);
    13491350          dx0 := dx0 + (dymin - dy0);
    1350           dy0 := dymin
     1351          dy0 := dymin;
    13511352        end;
    13521353      end;
    13531354      if N <= 0 then
    13541355        Exit;
    1355       if mirror then
     1356      if Mirror then
    13561357      begin
    13571358        x0 := X + dx0 * xxt - 1;
     
    13631364        x1 := X + (dx0 + N) * xxt;
    13641365      end;
    1365       moveto(x0, Y + dy0 * yyt);
    1366       lineto(x1, Y + (dy0 + N) * yyt);
     1366      MoveTo(x0, Y + dy0 * yyt);
     1367      LineTo(x1, Y + (dy0 + N) * yyt);
    13671368    end;
    13681369  end;
     
    14541455  begin
    14551456    if CityAllowClick then
    1456       pen.Color := $FFFFFF
     1457      Pen.Color := $FFFFFF
    14571458    else
    1458       pen.Color := $000000;
    1459     pen.Width := 1;
     1459      Pen.Color := $000000;
     1460    Pen.Width := 1;
    14601461    for I := 0 to 3 do
    14611462    begin
    1462       moveto(xm - xxt * (4 - I), ym + yyt * (1 + I));
    1463       lineto(xm + xxt * (1 + I), ym - yyt * (4 - I));
    1464       moveto(xm - xxt * (4 - I), ym - yyt * (1 + I));
    1465       lineto(xm + xxt * (1 + I), ym + yyt * (4 - I));
     1463      MoveTo(xm - xxt * (4 - I), ym + yyt * (1 + I));
     1464      LineTo(xm + xxt * (1 + I), ym - yyt * (4 - I));
     1465      MoveTo(xm - xxt * (4 - I), ym - yyt * (1 + I));
     1466      LineTo(xm + xxt * (1 + I), ym + yyt * (4 - I));
    14661467    end;
    1467     moveto(xm - xxt * 4, ym + yyt * 1);
    1468     lineto(xm - xxt * 1, ym + yyt * 4);
    1469     moveto(xm + xxt * 1, ym + yyt * 4);
    1470     lineto(xm + xxt * 4, ym + yyt * 1);
    1471     moveto(xm - xxt * 4, ym - yyt * 1);
    1472     lineto(xm - xxt * 1, ym - yyt * 4);
    1473     moveto(xm + xxt * 1, ym - yyt * 4);
    1474     lineto(xm + xxt * 4, ym - yyt * 1);
    1475     pen.Width := 1;
     1468    MoveTo(xm - xxt * 4, ym + yyt * 1);
     1469    LineTo(xm - xxt * 1, ym + yyt * 4);
     1470    MoveTo(xm + xxt * 1, ym + yyt * 4);
     1471    LineTo(xm + xxt * 4, ym + yyt * 1);
     1472    MoveTo(xm - xxt * 4, ym - yyt * 1);
     1473    LineTo(xm - xxt * 1, ym - yyt * 4);
     1474    MoveTo(xm + xxt * 1, ym - yyt * 4);
     1475    LineTo(xm + xxt * 4, ym - yyt * 1);
     1476    Pen.Width := 1;
    14761477  end;
    14771478end;
  • trunk/Packages/DpiControls

    • Property svn:ignore set to
      lib
  • trunk/Start.pas

    r468 r469  
    66uses
    77  GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types,
    8   LCLIntf, LCLType, SysUtils, Classes, System.UITypes,
     8  LCLIntf, LCLType, SysUtils, Classes,
    99  Registry, DrawDlg, Generics.Collections, Protocol, MiniMap, Brain, Translator,
    1010  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls, Dpi.Menus{$ELSE}
     
    229229  end;
    230230  LoadConfig;
    231   LoadAssets;
     231  //LoadAssets;
    232232  LoadLanguages;
    233233
     
    682682            begin
    683683              Canvas.Font.Assign(UniFont[ftCaption]);
    684               // Canvas.Font.Style:=Canvas.Font.Style+[fsUnderline];
     684              // Canvas.Font.Style := Canvas.Font.Style + [fsUnderline];
    685685              RisedTextOut(Canvas, xActionIcon + 99, Y,
    686686                Format(Phrases2.Lookup('ACTIONHEADER_WEB'), [CevoHomepageShort]));
Note: See TracChangeset for help on using the changeset viewer.