Ignore:
Timestamp:
Mar 17, 2021, 11:11:55 AM (3 years ago)
Author:
chronos
Message:
  • Modified: LoadGraphicSet now returns TGrExtDescr reference. Replaced integer index references to GrExt with with direct class reference to TGrExtDescr.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r312 r313  
    445445  SoundPreloadDone: Integer;
    446446  MarkCityLoc: Integer;
    447   HGrTerrain: Integer;
    448   HGrCities: Integer;
     447  HGrTerrain: TGrExtDescr;
     448  HGrCities: TGrExtDescr;
    449449  MovieSpeed: Integer;
    450450  CityRepMask: Cardinal;
     
    751751  for emix := 0 to MyRO.nEnemyModel - 1 do
    752752    with MyRO.EnemyModel[emix] do
    753       if Tribe[Owner].ModelPicture[mix].HGr = 0 then
     753      if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then
    754754        InitEnemyModel(emix);
    755755end;
     
    834834    while MyData.ToldModels < MyRO.nModel do
    835835    begin { new Unit class available }
    836       if (ModelPicture[MyData.ToldModels].HGr > 0) and
     836      if (ModelPicture[MyData.ToldModels].HGr <> HGrSystem) and
    837837        (MyModel[MyData.ToldModels].Kind <> mkSelfDeveloped) then
    838838      begin // save picture of DevModel
    839839        ModelPicture[MyData.ToldModels + 1] := ModelPicture[MyData.ToldModels];
    840840        ModelName[MyData.ToldModels + 1] := ModelName[MyData.ToldModels];
    841         ModelPicture[MyData.ToldModels].HGr := 0
     841        ModelPicture[MyData.ToldModels].HGr := HGrSystem
    842842      end;
    843       if ModelPicture[MyData.ToldModels].HGr = 0 then
     843      if ModelPicture[MyData.ToldModels].HGr = HGrSystem then
    844844        InitMyModel(MyData.ToldModels, true);
    845845      { only run if no researched model }
     
    10421042        DraftDlg.ShowNewContent(wmModal);
    10431043        if DraftDlg.ModalResult <> mrOK then
    1044           Tribe[me].ModelPicture[MyRO.nModel].HGr := 0
     1044          Tribe[me].ModelPicture[MyRO.nModel].HGr := HGrSystem
    10451045      end;
    10461046    until (ChosenResearch <> adMilitary) or (DraftDlg.ModalResult = mrOK);
     
    16031603  for x := 0 to 11 do
    16041604    for y := 0 to 1 do
    1605       MiniColors[x, y] := GrExt[HGrSystem].Data.Canvas.Pixels[66 + x, 67 + y];
     1605      MiniColors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y];
    16061606  IsoEngine.Init(InitEnemyModel);
    16071607  if not IsoEngine.ApplyTileSize(xxt, yyt) and ((xxt <> 48) or (yyt <> 24) or (xxt <> 72))
     
    27852785              ItsMeAgain(p1);
    27862786              for mix := 0 to MyRO.nModel - 1 do
    2787                 if Tribe[me].ModelPicture[mix].HGr = 0 then
     2787                if Tribe[me].ModelPicture[mix].HGr = HGrSystem then
    27882788                  InitMyModel(mix, true);
    27892789            end;
     
    30753075        begin
    30763076          CurrentMoveInfo.DoShow := false;
    3077           if not idle and (Tribe[Owner].ModelPicture[mix].HGr = 0) then
     3077          if not idle and (Tribe[Owner].ModelPicture[mix].HGr = HGrSystem) then
    30783078            InitEnemyModel(emix);
    30793079
     
    32703270          begin
    32713271            ToLoc := dLoc(FromLoc, dx, dy);
    3272             if Tribe[Owner].ModelPicture[mix].HGr = 0 then
     3272            if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then
    32733273              InitEnemyModel(emix);
    32743274
     
    40734073begin
    40744074  if not Assigned(MyMap) then Exit;
    4075   cmPolOcean := GrExt[HGrSystem].Data.Canvas.Pixels[101, 67];
    4076   cmPolNone := GrExt[HGrSystem].Data.Canvas.Pixels[102, 67];
     4075  cmPolOcean := HGrSystem.Data.Canvas.Pixels[101, 67];
     4076  cmPolNone := HGrSystem.Data.Canvas.Pixels[102, 67];
    40774077  hw := MapWidth div (xxt * 2);
    40784078  with Mini.Canvas do begin
     
    44004400          $FFFFFF, $B0B0B0);
    44014401        BitBltCanvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig,
    4402           ySizeBig, GrExt[HGrSystem2].Data.Canvas, 70, 123);
     4402          ySizeBig, HGrSystem2.Data.Canvas, 70, 123);
    44034403      end
    44044404      else if MyRO.NatBuilt[imPalace] > 0 then
     
    46154615            BiColorTextWidth(Panel.Canvas, s) div 2, PanelHeight - 23, s);
    46164616
    4617           FrameImage(Panel.Canvas, GrExt[HGrSystem].Data,
     4617          FrameImage(Panel.Canvas, HGrSystem.Data,
    46184618            xMidPanel + 7 + xUnitText, yTroop + 15, 12, 14,
    46194619            121 + Exp div ExpCost * 13, 28);
     
    53535353              MyRO.EnemyModel[emix].mix, MouseLoc) >= rExecuted) then
    53545354            begin
    5355               if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = 0 then
     5355              if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = HGrSystem then
    53565356                InitEnemyModel(emix);
    53575357              m2 := TMenuItem.Create(m);
     
    64366436procedure TMainScreen.SetViewpoint(p: integer);
    64376437var
    6438   i: integer;
     6438  i: Integer;
    64396439begin
    64406440  if supervising and (G.RO[0].Turn > 0) and
     
    64476447    SumCities(TaxSum, ScienceSum);
    64486448    for i := 0 to MyRO.nModel - 1 do
    6449       if Tribe[me].ModelPicture[i].HGr = 0 then
    6450         InitMyModel(i, true);
     6449      if Tribe[me].ModelPicture[i].HGr = HGrSystem then
     6450        InitMyModel(i, True);
    64516451
    64526452    SetTroopLoc(-1);
    64536453    PanelPaint;
    6454     MapValid := false;
     6454    MapValid := False;
    64556455    PaintAllMaps;
    64566456  end;
Note: See TracChangeset for help on using the changeset viewer.