Changeset 715


Ignore:
Timestamp:
Jan 4, 2026, 6:07:38 PM (21 hours ago)
Author:
chronos
Message:
  • Modified: Do not store .png file extension in graphics names in book files. This is for compatibility with older C-evo versions.
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Back.pas

    r623 r715  
    6666    WindowState := TWindowState.wsFullScreen;
    6767    if not Assigned(Img) then begin
    68       FileName := GetGraphicsDir + DirectorySeparator + 'Background.png';
     68      FileName := GetGraphicsDir + DirectorySeparator + 'Background' + PngExt;
    6969      if FileExists(FileName) then begin
    7070        Img := TBitmap.Create;
  • trunk/Brain.pas

    r679 r715  
    8080  TextSize: TSize;
    8181begin
    82   if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + FileName + DirectorySeparator + FileName + '.png', [gfNoError]) then begin
     82  if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + FileName + DirectorySeparator + FileName + PngExt, [gfNoError]) then begin
    8383    with Picture.Canvas do begin
    8484      Brush.Color := $904830;
  • trunk/LocalPlayer/CityScreen.pas

    r662 r715  
    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;
  • trunk/LocalPlayer/Draft.pas

    r709 r715  
    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;
  • trunk/LocalPlayer/Help.pas

    r684 r715  
    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);
  • trunk/LocalPlayer/IsoEngine.pas

    r608 r715  
    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
  • trunk/LocalPlayer/NatStat.pas

    r549 r715  
    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;
  • trunk/LocalPlayer/TechTree.pas

    r684 r715  
    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
  • trunk/LocalPlayer/Term.pas

    r709 r715  
    803803      Picture.pix := pixNoSlaves;
    804804    Picture.Hash := 0;
    805     Picture.GrName := 'StdUnits.png';
     805    Picture.GrName := 'StdUnits';
    806806    IsNew := True;
    807807  end
     
    823823    with Tribe[P].ModelPicture[mix] do
    824824    begin
    825       HGr := LoadGraphicSet(Picture.GrName);
     825      HGr := LoadGraphicSet(Picture.GrName + PngExt);
    826826      pix := Picture.pix;
    827827    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;
  • trunk/LocalPlayer/Tribes.pas

    r661 r715  
    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,
     
    493493        Dec(I);
    494494      Assert(I >= 0);
    495       Assert(PictureList[I].HGr = LoadGraphicSet(GrName));
     495      Assert(PictureList[I].HGr = LoadGraphicSet(GrName + PngExt));
    496496      Assert(PictureList[I].pix = pix);
    497497      ModelPicture[mix].HGr := PictureList[I].HGr;
     
    503503      with ModelPicture[mix] do
    504504      begin
    505         HGr := LoadGraphicSet(GrName);
     505        HGr := LoadGraphicSet(GrName + PngExt);
    506506        pix := Info.pix;
    507507        Inc(HGr.PixUsed[pix]);
     
    514514      begin
    515515        Input := Script[I];
    516         if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then
     516        if Input = '#UNITS ' + ExtractFileNameOnly(GrName + PngExt) then
    517517          Ok := True
    518518        else if (Input <> '') and (Input[1] = '#') then
     
    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';
    628       HGr := GrExt.SearchByName(TestPic.GrName);
     627      TestPic.GrName := Copy(Input, 8, 255);
     628      HGr := GrExt.SearchByName(TestPic.GrName + PngExt);
    629629    end
    630630    else if (Input <> '') and (Input[1] = '#') then
  • trunk/LocalPlayer/UnitStat.pas

    r622 r715  
    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;
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r711 r715  
    116116
    117117const
     118  BmpExt = '.bmp';
     119  PngExt = '.png';
     120  JpgExt = '.jpg';
     121
    118122  TransparentColor1 = $FF00FF;
    119123  TransparentColor2 = $7F007F;
     
    434438  Result := False;
    435439  if ExtractFileExt(FileName) = '' then
    436     FileName := FileName + '.png';
     440    FileName := FileName + PngExt;
    437441
    438442  if FileExists(FileName) then begin
    439     if ExtractFileExt(FileName) = '.jpg' then begin
     443    if ExtractFileExt(FileName) = JpgExt then begin
    440444      Jpeg := TJpegImage.Create;
    441445      try
     
    451455      FreeAndNil(Jpeg);
    452456    end else
    453     if ExtractFileExt(FileName) = '.png' then begin
     457    if ExtractFileExt(FileName) = PngExt then begin
    454458      Png := TPortableNetworkGraphic.Create;
    455459      try
     
    473477      FreeAndNil(Png);
    474478    end else
    475     if ExtractFileExt(FileName) = '.bmp' then begin
     479    if ExtractFileExt(FileName) = BmpExt then begin
    476480      try
    477481        Bmp.LoadFromFile(FileName);
     
    18821886  LoadPhrases;
    18831887  LoadFonts;
    1884   Templates := LoadGraphicSet('Templates.png', False);
     1888  Templates := LoadGraphicSet('Templates' + PngExt, False);
    18851889  with Templates do begin
    18861890    Logo := GetItem('Logo');
     
    18981902  end;
    18991903
    1900   LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    1901   LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
    1902   LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons.png');
     1904  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors' + PngExt);
     1905  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper' + JpgExt);
     1906  LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons' + PngExt);
    19031907end;
    19041908
     
    19231927  GrExt := TGraphicSets.Create;
    19241928
    1925   HGrSystem := LoadGraphicSet('System.png');
     1929  HGrSystem := LoadGraphicSet('System' + PngExt);
    19261930  with HGrSystem do begin
    19271931    CityMark1 := GetItem('CityMark1');
     
    19291933  end;
    19301934
    1931   HGrSystem2 := LoadGraphicSet('System2.png');
     1935  HGrSystem2 := LoadGraphicSet('System2' + PngExt);
    19321936  with HGrSystem2 do begin
    19331937    Ornament := GetItem('Ornament');
  • trunk/Packages/CevoComponents/Texture.pas

    r471 r715  
    4747  FAge := AValue;
    4848  LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +
    49     'Texture' + IntToStr(Age + 1) + '.jpg');
     49    'Texture' + IntToStr(Age + 1) + JpgExt);
    5050  ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];
    5151  ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
Note: See TracChangeset for help on using the changeset viewer.