Changeset 88 for trunk


Ignore:
Timestamp:
Jan 18, 2017, 4:22:26 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Wrong repeated image path composition for StdUnits.png file.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r86 r88  
    653653      Picture.pix := pixNoSlaves;
    654654    Picture.Hash := 0;
    655     Picture.GrName := 'StdUnits';
     655    Picture.GrName := 'StdUnits.png';
    656656    IsNew := true;
    657657  end
     
    673673    with Tribe[p].ModelPicture[mix] do
    674674    begin
    675       HGr := LoadGraphicSet(Picture.GrName + '.png');
     675      HGr := LoadGraphicSet(Picture.GrName);
    676676      pix := Picture.pix;
    677677    end;
     
    17091709              pix := pixNoSlaves;
    17101710            Hash := 0;
    1711             GrName := 'StdUnits';
     1711            GrName := 'StdUnits.png';
    17121712            Tribe[p1].SetModelPicture(Picture, true);
    17131713          end
  • trunk/LocalPlayer/Tribes.pas

    r73 r88  
    477477            dec(i);
    478478          assert(i >= 0);
    479           assert(PictureList[i].HGr = LoadGraphicSet(GrName + '.png'));
     479          assert(PictureList[i].HGr = LoadGraphicSet(GrName));
    480480          assert(PictureList[i].pix = pix);
    481481          ModelPicture[mix].HGr := PictureList[i].HGr;
     
    487487          with ModelPicture[mix] do
    488488          begin
    489             HGr := LoadGraphicSet(GrName + '.png');
     489            HGr := LoadGraphicSet(GrName);
    490490            pix := Info.pix;
    491491            inc(GrExt[HGr].pixUsed[pix]);
     
    596596      LeastUsed := MaxInt;
    597597
    598       TestPic.GrName := 'StdUnits';
     598      TestPic.GrName := 'StdUnits.png';
    599599      HGr := HGrStdUnits;
    600600      for i := 0 to StdUnitScript.Count - 1 do
     
    611611        begin
    612612          ok := true;
    613           TestPic.GrName := Copy(Input, 8, 255);
     613          TestPic.GrName := Copy(Input, 8, 255) + '.png';
    614614          HGr := nGrExt - 1;
    615615          while (HGr >= 0) and (GrExt[HGr].Name <> TestPic.GrName) do
  • trunk/ScreenTools.pas

    r74 r88  
    5959procedure EditFrame(ca: TCanvas; p: TRect; const T: TTexture);
    6060function HexStringToColor(s: string): integer;
    61 function LoadGraphicFile(bmp: TBitmap; Path: string;
     61function LoadGraphicFile(bmp: TBitmap; const Path: string;
    6262  Options: integer = 0): boolean;
    63 function LoadGraphicSet(Name: string): integer;
     63function LoadGraphicSet(const Name: string): integer;
    6464procedure Dump(dst: TBitmap; HGr, xDst, yDst, Width, Height, xGr, yGr: integer);
    6565procedure Sprite(Canvas: TCanvas; HGr, xDst, yDst, Width, Height, xGr,
     
    451451end;
    452452
    453 function LoadGraphicFile(bmp: TBitmap; Path: string; Options: integer): boolean;
     453function LoadGraphicFile(bmp: TBitmap; const Path: string; Options: integer): boolean;
    454454var
    455455  jtex: tjpegimage;
     
    505505  if not Result then begin
    506506    if Options and gfNoError = 0 then
    507       Application.MessageBox(PChar(Format(Phrases.Lookup('FILENOTFOUND'),
    508         [Path])), 'C-evo', 0);
    509     Exit;
     507      raise Exception.Create(Format(Phrases.Lookup('FILENOTFOUND'),
     508        [Path]));
    510509  end;
    511510
     
    514513end;
    515514
    516 function LoadGraphicSet(Name: string): integer;
    517 var
    518   i, x, y, xmax, OriginalColor: integer;
     515function LoadGraphicSet(const Name: string): integer;
     516var
     517  I, x, y, xmax, OriginalColor: integer;
    519518  FileName: string;
    520519  Source: TBitmap;
    521520  DataPixel, MaskPixel: TPixelPointer;
    522521begin
    523   i := 0;
    524   while (i < nGrExt) and (GrExt[i].Name <> Name) do
    525     inc(i);
    526   result := i;
    527   if i = nGrExt then begin
     522  I := 0;
     523  while (I < nGrExt) and (GrExt[i].Name <> Name) do
     524    Inc(I);
     525  Result := I;
     526  if I = nGrExt then begin
    528527    Source := TBitmap.Create;
    529528    Source.PixelFormat := pf24bit;
Note: See TracChangeset for help on using the changeset viewer.