Ignore:
Timestamp:
Jan 10, 2026, 12:15:35 PM (4 weeks ago)
Author:
chronos
Message:

Merged revision(s) 705-716 from trunk:

  • Fixed: Subversion properties.
  • Fixed: Better start screen location calculation for lower than 800x600 resolutions to make visible entire window.
  • Fixed: Memory overflow in minimap drawing with some higher DPI settings.
  • Fixed: Crashes with mini map drawing in Start screen with some DPI resolutions.
  • Added: Enter key confirms battle dialog window.
  • Fixed: Potential battle dialog drawing issue.
  • Modified: Code cleanup.
  • Fixed: Disable auto selection of input text in message dialog.
  • Fixed: Edit boxes to have black background and blue selection.
  • Fixed: Automatically create Saved and Maps user data directories if they don't exist yet.
  • Modified: Code cleanup.
  • Fixed: Wrong unit models opened after click on Military report foreign units.
  • Modified: Do not store .png file extension in graphics names in book files. This is for compatibility with older C-evo versions.
  • Fixed: Support both books with graphics name with and without .png file extensions.
Location:
branches/zoom
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/zoom

  • branches/zoom/LocalPlayer/Battle.lfm

    • Property svn:mime-type deleted
  • branches/zoom/LocalPlayer/Battle.pas

    r622 r717  
    6666  MaxBar := 65;
    6767
    68   // TerrType:=MyMap[ToLoc] and fTerrain;
     68  // TerrType := MyMap[ToLoc] and fTerrain;
    6969  GetUnitInfo(ToLoc, euix, UnitInfo);
    7070
     
    171171  UnshareBitmap(Buffer);
    172172  BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, ym - 8 - 12 - 48);
    173   { if TerrType<fForest then
    174     Sprite(Buffer,HGrTerrain,0,16,66,32,1+TerrType*(xxt*2+1),1+yyt)
     173  { if TerrType < fForest then
     174    Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + TerrType * (xxt * 2 + 1), 1 + yyt)
    175175    else
    176176    begin
    177     Sprite(Buffer,HGrTerrain,0,16,66,32,1+2*(xxt*2+1),1+yyt+2*(yyt*3+1));
    178     if (TerrType=fForest) and IsJungle(ToLoc div G.lx) then
    179     Sprite(Buffer,HGrTerrain,0,16,66,32,1+7*(xxt*2+1),1+yyt+19*(yyt*3+1))
    180     else Sprite(Buffer,HGrTerrain,0,16,66,32,1+7*(xxt*2+1),1+yyt+2*(2+TerrType-fForest)*(yyt*3+1));
     177      Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 2 * (xxt * 2 + 1), 1 + yyt + 2 * (yyt * 3 + 1));
     178      if (TerrType = fForest) and IsJungle(ToLoc div G.lx) then
     179      Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 7 * (xxt * 2 + 1), 1+ yyt + 19 * (yyt * 3 + 1))
     180      else Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 7 * (xxt * 2 + 1), 1 + yyt + 2 * (2 + TerrType - fForest) * (yyt * 3 + 1));
    181181    end; }
    182182  IsoMap.PaintUnit(1, 0, UnitInfo, 0);
     
    201201procedure TBattleDlg.FormShow(Sender: TObject);
    202202begin
    203   if IsSuicideQuery then
    204   begin
    205     ClientWidth := 300;
    206     ClientHeight := 288;
     203  if IsSuicideQuery then begin
     204    BoundsRect := Bounds(0, 0, 300, 288);
    207205    OKBtn.Visible := True;
    208206    CancelBtn.Visible := True;
    209207    CenterToScreen;
    210   end
    211   else
    212   begin
    213     ClientWidth := 178;
    214     ClientHeight := 178;
     208  end else begin
     209    BoundsRect := Bounds(0, 0, 178, 178);
    215210    OKBtn.Visible := False;
    216211    CancelBtn.Visible := False;
     
    226221  begin
    227222    Brush.Color := 0;
    228     FillRect(Rect(0, 0, ClientWidth, ClientHeight));
     223    FillRect(Rect(0, 0, Width, Height));
    229224    Brush.Style := TBrushStyle.bsClear;
    230225    PaintBackground(Canvas, 3 + Border, 3 + Border,
    231       ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border),
    232       ClientWidth, ClientHeight);
    233   end;
    234   Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
    235     ClientHeight - (2 + Border), MainTexture.ColorBevelLight,
     226      Width - (6 + 2 * Border), Height - (6 + 2 * Border),
     227      Width, Height);
     228  end;
     229  Frame(Canvas, Border + 1, Border + 1, Width - (2 + Border),
     230    Height - (2 + Border), MainTexture.ColorBevelLight,
    236231    MainTexture.ColorBevelShade);
    237   Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),
    238     ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
     232  Frame(Canvas, 2 + Border, 2 + Border, Width - (3 + Border),
     233    Height - (3 + Border), MainTexture.ColorBevelLight,
    239234    MainTexture.ColorBevelShade);
    240235
     
    243238    Canvas.Font.Assign(UniFont[ftCaption]);
    244239    S := Phrases.Lookup('TITLE_SUICIDE');
    245     RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) div 2,
     240    RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, S)) div 2,
    246241      7 + Border, S);
    247242    Canvas.Font.Assign(UniFont[ftNormal]);
     
    249244    P := Pos('\', S);
    250245    if P = 0 then
    251       RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S))
    252         div 2, 205, S)
     246      RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, S)) div 2, 205, S)
    253247    else
    254248    begin
    255249      s1 := Copy(S, 1, P - 1);
    256       RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,
     250      RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, s1)) div 2,
    257251        205 - MessageLineSpacing div 2, s1);
    258252      s1 := Copy(S, P + 1, 255);
    259       RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,
     253      RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, s1)) div 2,
    260254        205 + (MessageLineSpacing - MessageLineSpacing div 2), s1);
    261255    end;
     
    263257  end
    264258  else
    265     ym := ClientHeight div 2;
     259    ym := Height div 2;
    266260  Canvas.Font.Assign(UniFont[ftSmall]);
    267   PaintBattleOutcome(Canvas, ClientWidth div 2, ym, uix, ToLoc, Forecast);
     261  PaintBattleOutcome(Canvas, Width div 2, ym, uix, ToLoc, Forecast);
    268262
    269263  for cix := 0 to ControlCount - 1 do
     
    293287  Shift: TShiftState);
    294288begin
     289  if Key = VK_RETURN then OKBtnClick(Self)
     290  else
    295291  if not IsSuicideQuery and (Key <> VK_SHIFT) then
    296292  begin
  • branches/zoom/LocalPlayer/CityScreen.pas

    r662 r717  
    231231  Template := TBitmap.Create;
    232232  Template.PixelFormat := TPixelFormat.pf24bit;
    233   LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City.png',
     233  LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City' + PngExt,
    234234    [gfNoGamma]);
    235235  CityMapTemplate := TBitmap.Create;
    236236  CityMapTemplate.PixelFormat := TPixelFormat.pf24bit;
    237   LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap.png',
     237  LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap' + PngExt,
    238238    [gfNoGamma]);
    239239  SmallCityMapTemplate := TBitmap.Create;
    240240  SmallCityMapTemplate.PixelFormat := TPixelFormat.pf24bit;
    241   LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap.png',
     241  LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap' + PngExt,
    242242    [gfNoGamma]);
    243243  SmallCityMap := TBitmap.Create;
  • branches/zoom/LocalPlayer/Draft.pas

    r684 r717  
    9595  Template := TBitmap.Create;
    9696  Template.PixelFormat := TPixelFormat.pf24bit;
    97   LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'MiliRes.png',
     97  LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'MiliRes' + PngExt,
    9898    [gfNoGamma]);
    9999end;
     
    415415procedure TDraftDlg.SetDomain(D: Integer);
    416416
    417   function Prio(fix: Integer): Integer;
     417  function Prio(Fix: Integer): Integer;
    418418  var
    419419    FeaturePreq: Integer;
    420420  begin
    421     FeaturePreq := Feature[fix].Preq;
     421    FeaturePreq := Feature[Fix].Preq;
    422422    Assert(FeaturePreq <> preNA);
    423     if fix < mcFirstNonCap then
    424       Result := 10000 + fix
     423    if Fix < mcFirstNonCap then
     424      Result := 10000 + Fix
    425425    else if FeaturePreq = preNone then
    426426      Result := 20000
     
    429429    else
    430430      Result := 30000 + AdvValue[FeaturePreq];
    431     if not (fix in AutoFeature) then
     431    if not (Fix in AutoFeature) then
    432432      Inc(Result, 90000);
    433433  end;
     
    471471begin
    472472  Domain := dGround;
    473   while (Domain < dAir) and (upgrade[Domain, 0].Preq <> preNone) and
    474     (MyRO.Tech[upgrade[Domain, 0].Preq] < tsApplicable) do
     473  while (Domain < dAir) and (Upgrade[Domain, 0].Preq <> preNone) and
     474    (MyRO.Tech[Upgrade[Domain, 0].Preq] < tsApplicable) do
    475475    Inc(Domain);
    476476
     
    478478  MaxLines := 0;
    479479  for D := 0 to nDomains - 1 do
    480     if (upgrade[D, 0].Preq = preNone) or
    481       (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable) then
     480    if (Upgrade[D, 0].Preq = preNone) or
     481      (MyRO.Tech[Upgrade[D, 0].Preq] >= tsApplicable) then
    482482    begin
    483483      Count := 0;
     
    519519  begin
    520520    for D := 0 to nDomains - 1 do
    521       if (D <> Domain) and ((upgrade[D, 0].Preq = preNone) or
    522         (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable)) and
     521      if (D <> Domain) and ((Upgrade[D, 0].Preq = preNone) or
     522        (MyRO.Tech[Upgrade[D, 0].Preq] >= tsApplicable)) and
    523523        (X >= xDomain + D * DomainPitch) and
    524524        (X < xDomain + D * DomainPitch + 36) and (Y >= yDomain) and
  • branches/zoom/LocalPlayer/Help.pas

    r684 r717  
    10711071          until (P > Length(S)) or (S[P] = '\');
    10721072          if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' +
    1073             DirectorySeparator + Copy(S, 2, P - 2) + '.png')) then
     1073            DirectorySeparator + Copy(S, 2, P - 2) + PngExt)) then
    10741074          begin
    10751075            MainText.AddLine('', pkExternal);
  • branches/zoom/LocalPlayer/IsoEngine.pas

    r608 r717  
    337337  IsoMapCache[ATileSize] := TIsoMapCache.Create;
    338338
    339   FileName := Format('Terrain%dx%d.png', [xxt * 2, yyt * 2]);
     339  FileName := Format('Terrain%dx%d' + PngExt, [xxt * 2, yyt * 2]);
    340340  IsoMapCache[ATileSize].HGrTerrain := LoadGraphicSet(FileName);
    341341  if not Assigned(IsoMapCache[ATileSize].HGrTerrain) then
     
    343343
    344344
    345   FileName := Format('Cities%dx%d.png', [xxt * 2, yyt * 2]);
     345  FileName := Format('Cities%dx%d' + PngExt, [xxt * 2, yyt * 2]);
    346346  IsoMapCache[ATileSize].HGrCities := LoadGraphicSet(FileName);
    347347  if not Assigned(IsoMapCache[ATileSize].HGrCities) then
  • branches/zoom/LocalPlayer/MessgEx.pas

    r622 r717  
    7777  CenterTo := 0;
    7878  OpenSound := '';
     79  EInput.AutoSelect := False;
    7980end;
    8081
  • branches/zoom/LocalPlayer/NatStat.pas

    r549 r717  
    9393  Template := TBitmap.Create;
    9494  Template.PixelFormat := TPixelFormat.pf24bit;
    95   LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Nation.png',
     95  LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Nation' + PngExt,
    9696    [gfNoGamma]);
    9797end;
  • branches/zoom/LocalPlayer/Nego.lfm

    • Property svn:mime-type deleted
  • branches/zoom/LocalPlayer/Select.pas

    r693 r717  
    10551055        kEnemyModels:
    10561056          MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
    1057             Layers[laImprovements].Lines[ScrollBar.Position + Selected].Code);
     1057            Layers[laImprovements].Lines[ScrollBar.Position + Selected].Model);
    10581058        kAllEnemyModels, kChooseEnemyModel:
    10591059          if lix <> mixAll then
  • branches/zoom/LocalPlayer/TechTree.pas

    r684 r717  
    178178    Image := TBitmap.Create;
    179179    Image.PixelFormat := TPixelFormat.pf24bit;
    180     LoadGraphicFile(Image, GetAppSharePath('Help' + DirectorySeparator + 'AdvTree.png'),
     180    LoadGraphicFile(Image, GetAppSharePath('Help' + DirectorySeparator + 'AdvTree' + PngExt),
    181181      [gfNoGamma]);
    182182
  • branches/zoom/LocalPlayer/Term.pas

    r704 r717  
    803803      Picture.pix := pixNoSlaves;
    804804    Picture.Hash := 0;
    805     Picture.GrName := 'StdUnits.png';
     805    Picture.GrName := 'StdUnits';
    806806    IsNew := True;
    807807  end
     
    14071407    if AILogo[P] = nil then
    14081408      AILogo[P] := TBitmap.Create;
    1409     if not LoadGraphicFile(AILogo[P], GetAppSharePath(Name + '.png'), [gfNoError]) then
     1409    if not LoadGraphicFile(AILogo[P], GetAppSharePath(Name + PngExt), [gfNoError]) then
    14101410    begin
    14111411      FreeAndNil(AILogo[P]);
     
    17661766  MainMap.SetOutput(Offscreen);
    17671767
    1768   HGrStdUnits := LoadGraphicSet('StdUnits.png');
     1768  HGrStdUnits := LoadGraphicSet('StdUnits' + PngExt);
    17691769  SmallImp := TBitmap.Create;
    17701770  SmallImp.PixelFormat := TPixelFormat.pf24bit;
     
    19191919            pix := pixNoSlaves;
    19201920          Hash := 0;
    1921           GrName := 'StdUnits.png';
     1921          GrName := 'StdUnits';
    19221922          Tribe[p1].SetModelPicture(Picture, True);
    19231923        end;
     
    29282928          InitTurn(NewPlayer);
    29292929          DipMem[Me].pContact := -1;
    2930           (* if (Me=0) and (MyRO.Alive and (1 shl Me)=0)} then
     2930          (* if (Me = 0) and (MyRO.Alive and (1 shl Me) = 0)} then
    29312931            begin
    2932             if SimpleQuery(Phrases.Lookup('RESIGN'))=mrIgnore then
    2933             Server(sResign,Me,0,nil^)
    2934             else Server(sBreak,Me,0,nil^)
     2932            if SimpleQuery(Phrases.Lookup('RESIGN')) = mrIgnore then
     2933            Server(sResign, Me, 0, nil^)
     2934            else Server(sBreak, Me, 0, nil^)
    29352935            end
    29362936            else Play('TURNSTART'); *)
  • branches/zoom/LocalPlayer/Tribes.pas

    r661 r717  
    322322      Item := Get;
    323323      sympix := GetNum;
    324       symHGr := LoadGraphicSet(Item + '.png');
     324      symHGr := LoadGraphicSet(Item + PngExt);
    325325    end;
    326326  end;
     
    442442            end;
    443443          end;
    444         cHGr := LoadGraphicSet(Item + '.png');
     444        cHGr := LoadGraphicSet(Item + PngExt);
    445445        for X := 0 to 3 do
    446446          with CityPicture[X] do begin
     
    461461      else
    462462      begin
    463         faceHGr := LoadGraphicSet(Item + '.png');
     463        faceHGr := LoadGraphicSet(Item + PngExt);
    464464        facepix := GetNum;
    465465        if faceHGr.Data.Canvas.Pixels[facepix mod 10 * 65,
     
    610610  LeastUsed := MaxInt;
    611611
    612   TestPic.GrName := 'StdUnits.png';
     612  TestPic.GrName := 'StdUnits';
    613613  HGr := HGrStdUnits;
    614614  for I := 0 to StdUnitScript.Count - 1 do
     
    625625    begin
    626626      Ok := True;
    627       TestPic.GrName := Copy(Input, 8, 255) + '.png';
     627      TestPic.GrName := Copy(Input, 8, 255);
    628628      HGr := GrExt.SearchByName(TestPic.GrName);
    629629    end
  • branches/zoom/LocalPlayer/UnitStat.pas

    r622 r717  
    8686  Template := TBitmap.Create;
    8787  Template.PixelFormat := TPixelFormat.pf24bit;
    88   LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Unit.png',
     88  LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Unit' + PngExt,
    8989    [gfNoGamma]);
    9090end;
Note: See TracChangeset for help on using the changeset viewer.