Changeset 318


Ignore:
Timestamp:
Mar 19, 2021, 12:32:32 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Defined and used more Templates graphic set items.
  • Fixed: Incorrect evaluation of nil graphic set references.
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Graphics/Templates.grs

    r316 r318  
    3030      <Height>36</Height>
    3131    </Item>
     32    <Item>
     33      <Name>LinkArrows</Name>
     34      <Left>1</Left>
     35      <Top>400</Top>
     36      <Width>91</Width>
     37      <Height>25</Height>
     38    </Item>
     39    <Item>
     40      <Name>ScienceNationDot</Name>
     41      <Left>114</Left>
     42      <Top>211</Top>
     43      <Width>17</Width>
     44      <Height>17</Height>
     45    </Item>   
     46    <Item>
     47      <Name>Research</Name>
     48      <Left>145</Left>
     49      <Top>75</Top>
     50      <Width>36</Width>
     51      <Height>36</Height>
     52    </Item>   
     53    <Item>
     54      <Name>Change</Name>
     55      <Left>124</Left>
     56      <Top>1</Top>
     57      <Width>14</Width>
     58      <Height>14</Height>
     59    </Item>   
     60    <Item>
     61      <Name>Treasury</Name>
     62      <Left>145</Left>
     63      <Top>1</Top>
     64      <Width>36</Width>
     65      <Height>36</Height>
     66    </Item>   
     67    <Item>
     68      <Name>StarshipDeparted</Name>
     69      <Left>1</Left>
     70      <Top>279</Top>
     71      <Width>140</Width>
     72      <Height>120</Height>
     73    </Item>   
     74    <Item>
     75      <Name>WeightOff</Name>
     76      <Left>105</Left>
     77      <Top>400</Top>
     78      <Width>18</Width>
     79      <Height>20</Height>
     80    </Item>   
     81    <Item>
     82      <Name>WeightOn</Name>
     83      <Left>123</Left>
     84      <Top>400</Top>
     85      <Width>18</Width>
     86      <Height>20</Height>
     87    </Item>   
    3288  </Items>
    3389</GraphicSet>
  • trunk/LocalPlayer/CityScreen.pas

    r313 r318  
    10521052        (integer(MyRO.EnemyModel[emix].mix) <> c.Project and cpIndex)) do
    10531053        dec(emix);
    1054       if Tribe[cOwner].ModelPicture[c.Project and cpIndex].HGr = HGrSystem then
     1054      if not Assigned(Tribe[cOwner].ModelPicture[c.Project and cpIndex].HGr) then
    10551055        InitEnemyModel(emix);
    10561056    end;
  • trunk/LocalPlayer/Draft.pas

    r315 r318  
    300300      for i := 0 to MaxWeight - 1 do
    301301        if i < Weight then
    302           ImageOp_BCC(offscreen, Templates.Data, xWeight + 20 * i, yWeight, 123, 400,
    303             18, 20, 0, $949494)
     302          ImageOp_BCC(offscreen, Templates.Data, Point(xWeight + 20 * i, yWeight),
     303            WeightOn.BoundsRect, 0, $949494)
    304304        else
    305           ImageOp_BCC(offscreen, Templates.Data, xWeight + 20 * i, yWeight, 105, 400,
    306             18, 20, 0, $949494);
     305          ImageOp_BCC(offscreen, Templates.Data, Point(xWeight + 20 * i, yWeight),
     306            WeightOff.BoundsRect, 0, $949494);
    307307    end;
    308308
  • trunk/LocalPlayer/Help.pas

    r315 r318  
    637637              ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[i], 2 - 1 + i * 24,
    638638                8 + 36 + x0[i], 2 + 20 + i * 24, $000000, $000000);
    639               Dump(OffScreen, HGrSystem,  8 + x0[i], 2 + i * 24, 36, 20,
     639              Dump(OffScreen, HGrSystem, 8 + x0[i], 2 + i * 24, 36, 20,
    640640                75 + HelpLineInfo.Picpix * 37, 295);
    641641              x0[i] := x0[i] + (8 + 8 + 36);
  • trunk/LocalPlayer/IsoEngine.pas

    r315 r318  
    587587      else
    588588        mixShow := mix;
    589       if (Tribe[Owner].ModelPicture[mixShow].HGr = HGrSystem) and
     589      if (not Assigned(Tribe[Owner].ModelPicture[mixShow].HGr)) and
    590590        (@OnInitEnemyModel <> nil) then
    591591        if not OnInitEnemyModel(emix) then
  • trunk/LocalPlayer/MessgEx.pas

    r316 r318  
    436436        BitBltCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
    437437          (ClientWidth - 140) div 2, 24);
    438         ImageOp_BCC(Buffer, Templates.Data, 0, 0, 1, 279, 140, 120, 0, $FFFFFF);
     438        ImageOp_BCC(Buffer, Templates.Data, Point(0, 0), StarshipDeparted.BoundsRect, 0, $FFFFFF);
    439439        BitBltCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
    440440          Buffer.Canvas, 0, 0);
  • trunk/LocalPlayer/Select.pas

    r315 r318  
    5353    Column: array [0 .. nPl - 1] of integer;
    5454    Closable, MultiPage: boolean;
    55     ScienceNationDot: TBitmap;
     55    ScienceNationDotBuffer: TBitmap;
    5656    procedure ScrollBarUpdate(Sender: TObject);
    5757    procedure InitLines;
     
    110110  Layer1Btn.Hint := Phrases.Lookup('BTN_WONDERS');
    111111  Layer2Btn.Hint := Phrases.Lookup('BTN_CLASSES');
    112   ScienceNationDot := TBitmap.Create;
    113   ScienceNationDot.PixelFormat := pf24bit;
    114   ScienceNationDot.SetSize(17, 17);
    115   ScienceNationDot.Canvas.FillRect(0, 0, ScienceNationDot.Width, ScienceNationDot.Height);
     112  ScienceNationDotBuffer := TBitmap.Create;
     113  ScienceNationDotBuffer.PixelFormat := pf24bit;
     114  ScienceNationDotBuffer.SetSize(17, 17);
     115  ScienceNationDotBuffer.Canvas.FillRect(0, 0, ScienceNationDotBuffer.Width, ScienceNationDotBuffer.Height);
    116116end;
    117117
     
    119119begin
    120120  FreeAndNil(sb);
    121   FreeAndNil(ScienceNationDot);
     121  FreeAndNil(ScienceNationDotBuffer);
    122122end;
    123123
     
    817817        LoweredTextOut(Canvas, -1, MainTexture, xScreen + 10,
    818818          ClientHeight - 29, s);
    819         BitBltCanvas(ScienceNationDot.Canvas, 0, 0, 17, 17, Canvas,
    820           xScreen - 10, ClientHeight - 27);
    821         ImageOp_BCC(ScienceNationDot, Templates.Data, 0, 0, 114, 211, 17, 17,
    822           MainTexture.clBevelShade, Tribe[ScienceNation].Color);
    823         BitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, 17, 17,
    824           ScienceNationDot.Canvas, 0, 0);
    825       end;
    826     end
     819        BitBltCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width,
     820          ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27);
     821        ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0),
     822          ScienceNationDot.BoundsRect, MainTexture.clBevelShade, Tribe[ScienceNation].Color);
     823        BitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,
     824          ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0);
     825      end;
     826    end;
    827827  end;
    828828end;
     
    855855    begin
    856856      CityDlg.FormShow(nil);
    857       CityDlg.Invalidate
     857      CityDlg.Invalidate;
    858858    end;
    859     result := true
     859    result := true;
    860860  end
    861861  else
    862     result := false
     862    result := false;
    863863end;
    864864
     
    881881    begin
    882882      UnitStatDlg.FormShow(nil);
    883       UnitStatDlg.Invalidate
     883      UnitStatDlg.Invalidate;
    884884    end;
    885     result := true
     885    result := true;
    886886  end
    887887  else
    888     result := false
     888    result := false;
    889889end;
    890890
     
    905905      result := lix;
    906906      Closable := true;
    907       Close
    908     end
     907      Close;
     908    end;
    909909  end
    910910  else if (ssLeft in Shift) and (ssShift in Shift) then
     
    949949        kShipPart, kEShipPart:
    950950          ;
    951       end
     951      end;
    952952  end
    953953  else if ssRight in Shift then
     
    961961          if RenameModel(lix) then
    962962            SmartUpdateContent;
    963       end
    964   end
     963      end;
     964  end;
    965965end;
    966966
     
    991991            swap := code[0, i];
    992992            code[0, i] := code[0, j];
    993             code[0, j] := swap
     993            code[0, j] := swap;
    994994          end;
    995995  end;
     
    10061006          swap := code[0, i];
    10071007          code[0, i] := code[0, j];
    1008           code[0, j] := swap
     1008          code[0, j] := swap;
    10091009        end;
    10101010  end;
     
    10471047      if (AdvPreq[i, 1] >= 0) then
    10481048        MarkPreqs(AdvPreq[i, 1]);
    1049     end
     1049    end;
    10501050  end;
    10511051
     
    10601060  begin
    10611061    Lines[i] := 0;
    1062     FirstShrinkedLine[i] := MaxInt
     1062    FirstShrinkedLine[i] := MaxInt;
    10631063  end;
    10641064  case Kind of
     
    11031103                    (MyMap[Loc1] and fCanal > 0)) then
    11041104                    ok := true;
    1105                 end
     1105                end;
    11061106          end
    11071107          else
     
    11121112            begin
    11131113              code[2, Lines[2]] := i;
    1114               inc(Lines[2])
     1114              inc(Lines[2]);
    11151115            end;
    11161116            if MyModel[i].Status and msAllowConscripts <> 0 then
    11171117            begin
    11181118              code[2, Lines[2]] := i + cpConscripts;
    1119               inc(Lines[2])
     1119              inc(Lines[2]);
    11201120            end;
    11211121          end;
     
    11531153        begin
    11541154          code[0, Lines[0]] := adMilitary;
    1155           inc(Lines[0])
     1155          inc(Lines[0]);
    11561156        end;
    11571157      end;
     
    12701270            begin
    12711271              code[0, Lines[0]] := i;
    1272               inc(Lines[0])
     1272              inc(Lines[0]);
    12731273            end;
    12741274        SortCities;
     
    12821282          begin
    12831283            code[0, Lines[0]] := i;
    1284             inc(Lines[0])
     1284            inc(Lines[0]);
    12851285          end;
    12861286        SortCities;
    1287         FirstShrinkedLine[0] := 0
     1287        FirstShrinkedLine[0] := 0;
    12881288      end;
    12891289    { kChooseECity:
     
    13051305        Lines[0] := MyRO.nModel;
    13061306        SortModels;
    1307         FirstShrinkedLine[0] := 0
     1307        FirstShrinkedLine[0] := 0;
    13081308      end;
    13091309    kChooseModel:
     
    13291329        begin
    13301330          code[0, Lines[0]] := mixAll;
    1331           inc(Lines[0]);
    1332         end;
    1333         FirstShrinkedLine[0] := 0
     1331          inc(Lines[0]);;
     1332        end;
     1333        FirstShrinkedLine[0] := 0;
    13341334      end;
    13351335    kChooseEModel:
     
    13491349          if ModelOk[emix] then
    13501350          begin
    1351             if Tribe[DipMem[me].pContact].ModelPicture
    1352               [MyRO.EnemyModel[emix].mix].HGr = HGrSystem then
     1351            if not Assigned(Tribe[DipMem[me].pContact].ModelPicture
     1352              [MyRO.EnemyModel[emix].mix].HGr) then
    13531353              InitEnemyModel(emix);
    13541354            code[0, Lines[0]] := emix;
     
    13621362          inc(Lines[0]);
    13631363        end;
    1364         FirstShrinkedLine[0] := 0
     1364        FirstShrinkedLine[0] := 0;
    13651365      end;
    13661366    kEModels:
     
    13731373            (MyRO.EnemyModel[code[1, Lines[0]]].mix = i)) do
    13741374            dec(code[1, Lines[0]]);
    1375           if Tribe[pView].ModelPicture[i].HGr = HGrSystem then
     1375          if not Assigned(Tribe[pView].ModelPicture[i].HGr) then
    13761376            InitEnemyModel(code[1, Lines[0]]);
    13771377          code[0, Lines[0]] := i;
     
    13811381        end;
    13821382        SortModels;
    1383         FirstShrinkedLine[0] := 0
     1383        FirstShrinkedLine[0] := 0;
    13841384      end;
    13851385    kAllEModels:
     
    13941394            PPicture := @Tribe[MyRO.EnemyModel[emix].Owner].ModelPicture
    13951395              [MyRO.EnemyModel[emix].mix];
    1396             if PPicture.HGr = HGrSystem then
     1396            if not Assigned(PPicture.HGr) then
    13971397              InitEnemyModel(emix);
    13981398            ok := true;
     
    14091409                  code[1, j] := 1;
    14101410                  ok := false;
    1411                   Break
     1411                  Break;
    14121412                end;
    14131413              end;
     
    14181418              code[2, Lines[0]] := ModelSortValue(MyRO.EnemyModel[emix], true);
    14191419              inc(Lines[0]);
    1420             end
     1420            end;
    14211421          end;
    14221422        SortModels;
     
    14271427      begin
    14281428        code[0, Lines[0]] := i;
    1429         inc(Lines[0])
     1429        inc(Lines[0]);
    14301430      end;
    14311431    (* kDeliver:
     
    14721472        begin
    14731473          code[0, Lines[0]] := i;
    1474           inc(Lines[0])
     1474          inc(Lines[0]);
    14751475        end;
    14761476    kMission:
     
    14781478      begin
    14791479        code[0, Lines[0]] := i;
    1480         inc(Lines[0])
     1480        inc(Lines[0]);
    14811481      end;
    14821482  end;
     
    15861586          TechNameSpace := TechNameSpace + 640 - InnerWidth - 2 * SideFrame;
    15871587          InnerWidth := 640 - 2 * SideFrame
    1588         end
     1588        end;
    15891589      end;
    15901590    kAdvance, kFarAdvance:
     
    16951695  begin
    16961696    ToggleBtn.ButtonIndex := 13;
    1697     ToggleBtn.Hint := Phrases.Lookup('FARTECH')
     1697    ToggleBtn.Hint := Phrases.Lookup('FARTECH');
    16981698  end
    16991699  else if Kind = kCities then
    17001700  begin
    17011701    ToggleBtn.ButtonIndex := 15;
    1702     ToggleBtn.Hint := Phrases.Lookup('BTN_PAGE')
     1702    ToggleBtn.Hint := Phrases.Lookup('BTN_PAGE');
    17031703  end
    17041704  else
    17051705  begin
    17061706    ToggleBtn.ButtonIndex := 28;
    1707     ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT')
     1707    ToggleBtn.Hint := Phrases.Lookup('BTN_SELECT');
    17081708  end;
    17091709
     
    17401740    ShowNewContent(NewMode, kModels)
    17411741  else
    1742     ShowNewContent(NewMode, kEModels)
     1742    ShowNewContent(NewMode, kEModels);
    17431743end;
    17441744
     
    17561756  sb.Init(Lines[Layer] - 1, DispLines);
    17571757  OffscreenPaint;
    1758   Invalidate
     1758  Invalidate;
    17591759end;
    17601760
     
    17681768  Sel := -2;
    17691769  sb.Init(Lines[Layer] - 1, DispLines);
    1770   SmartUpdateContent
     1770  SmartUpdateContent;
    17711771end;
    17721772
     
    17811781        result := adFar;
    17821782        Closable := true;
    1783         Close
     1783        Close;
    17841784      end;
    17851785    kCities, kCityEvents:
     
    18211821        Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top +
    18221822          ToggleBtn.Height);
    1823       end
    1824   end
     1823      end;
     1824  end;
    18251825end;
    18261826
     
    18351835  // prevent closing
    18361836  else
    1837     inherited
     1837    inherited;
    18381838end;
    18391839
     
    18411841begin
    18421842  if Visible and (Kind = kCities) then
    1843     SmartUpdateContent
     1843    SmartUpdateContent;
    18441844end;
    18451845
  • trunk/LocalPlayer/Term.pas

    r316 r318  
    752752  for emix := 0 to MyRO.nEnemyModel - 1 do
    753753    with MyRO.EnemyModel[emix] do
    754       if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then
     754      if not Assigned(Tribe[Owner].ModelPicture[mix].HGr) then
    755755        InitEnemyModel(emix);
    756756end;
     
    835835    while MyData.ToldModels < MyRO.nModel do
    836836    begin { new Unit class available }
    837       if (ModelPicture[MyData.ToldModels].HGr <> HGrSystem) and
     837      if Assigned(ModelPicture[MyData.ToldModels].HGr) and
    838838        (MyModel[MyData.ToldModels].Kind <> mkSelfDeveloped) then
    839839      begin // save picture of DevModel
    840840        ModelPicture[MyData.ToldModels + 1] := ModelPicture[MyData.ToldModels];
    841841        ModelName[MyData.ToldModels + 1] := ModelName[MyData.ToldModels];
    842         ModelPicture[MyData.ToldModels].HGr := HGrSystem
     842        ModelPicture[MyData.ToldModels].HGr := nil;
    843843      end;
    844       if ModelPicture[MyData.ToldModels].HGr = HGrSystem then
     844      if not Assigned(ModelPicture[MyData.ToldModels].HGr) then
    845845        InitMyModel(MyData.ToldModels, true);
    846846      { only run if no researched model }
     
    873873          Server(cSetModelName + (Length(ModelNameInfo.NewName) + 1 + 4 + 3)
    874874            div 4, me, 0, ModelNameInfo);
    875         end
     875        end;
    876876      end;
    877877      if MyModel[MyData.ToldModels].Kind = mkSettler then
     
    10431043        DraftDlg.ShowNewContent(wmModal);
    10441044        if DraftDlg.ModalResult <> mrOK then
    1045           Tribe[me].ModelPicture[MyRO.nModel].HGr := HGrSystem
     1045          Tribe[me].ModelPicture[MyRO.nModel].HGr := nil
    10461046      end;
    10471047    until (ChosenResearch <> adMilitary) or (DraftDlg.ModalResult = mrOK);
     
    27852785              ItsMeAgain(p1);
    27862786              for mix := 0 to MyRO.nModel - 1 do
    2787                 if Tribe[me].ModelPicture[mix].HGr = HGrSystem then
     2787                if not Assigned(Tribe[me].ModelPicture[mix].HGr) then
    27882788                  InitMyModel(mix, true);
    27892789            end;
     
    30753075        begin
    30763076          CurrentMoveInfo.DoShow := false;
    3077           if not idle and (Tribe[Owner].ModelPicture[mix].HGr = HGrSystem) then
     3077          if not idle and (not Assigned(Tribe[Owner].ModelPicture[mix].HGr)) then
    30783078            InitEnemyModel(emix);
    30793079
     
    32703270          begin
    32713271            ToLoc := dLoc(FromLoc, dx, dy);
    3272             if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then
     3272            if not Assigned(Tribe[Owner].ModelPicture[mix].HGr) then
    32733273              InitEnemyModel(emix);
    32743274
     
    34033403            if TribeOriginal[NewPlayer] then
    34043404              Tribe[NewPlayer].ModelName[mix] := NewName;
    3405       end
    3406   end
     3405      end;
     3406  end;
    34073407end;
    34083408
     
    48594859
    48604860    // treasury section
    4861     ImageOp_BCC(TopBar, Templates.Data, xTreasurySection + 8, 1, 145, 1, 36, 36,
     4861    ImageOp_BCC(TopBar, Templates.Data, Point(xTreasurySection + 8, 1), TreasuryIcon.BoundsRect,
    48624862      $40A040, $4030C0);
    48634863    s := IntToStr(TrueMoney);
     
    48664866    if MyRO.Government <> gAnarchy then
    48674867    begin
    4868       ImageOp_BCC(TopBar, Templates.Data, xTreasurySection + 48, 22, 124, 1, 14, 14,
     4868      ImageOp_BCC(TopBar, Templates.Data, Point(xTreasurySection + 48, 22), ChangeIcon.BoundsRect,
    48694869        $0000C0, $0080C0);
    48704870      if TaxSum >= 0 then
     
    48774877
    48784878    // research section
    4879     ImageOp_BCC(TopBar, Templates.Data, xResearchSection + 8, 1, 145, 75, 36, 36,
     4879    ImageOp_BCC(TopBar, Templates.Data, Point(xResearchSection + 8, 1), ResearchIcon.BoundsRect,
    48804880      $FF0000, $00FFE0);
    48814881    if MyData.FarTech <> adNexus then
     
    49284928    if (MyData.FarTech <> adNexus) and (ScienceSum > 0) then
    49294929    begin
    4930       ImageOp_BCC(TopBar, Templates.Data, xResearchSection + 48 + CostFactor + 11,
    4931         22, 124, 1, 14, 14, $0000C0, $0080C0);
     4930      ImageOp_BCC(TopBar, Templates.Data, Point(xResearchSection + 48 + CostFactor + 11,
     4931        22), ChangeIcon.BoundsRect, $0000C0, $0080C0);
    49324932      s := Format(Phrases.Lookup('TECHGAIN'), [ScienceSum]);
    49334933      LoweredTextOut(TopBar.Canvas, -1, MainTexture, xResearchSection + 48 +
     
    53535353              MyRO.EnemyModel[emix].mix, MouseLoc) >= rExecuted) then
    53545354            begin
    5355               if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = HGrSystem then
     5355              if not Assigned(Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr) then
    53565356                InitEnemyModel(emix);
    53575357              m2 := TMenuItem.Create(m);
     
    64476447    SumCities(TaxSum, ScienceSum);
    64486448    for i := 0 to MyRO.nModel - 1 do
    6449       if Tribe[me].ModelPicture[i].HGr = HGrSystem then
     6449      if not Assigned(Tribe[me].ModelPicture[i].HGr) then
    64506450        InitMyModel(i, True);
    64516451
  • trunk/LocalPlayer/UnitStat.pas

    r313 r318  
    136136      begin
    137137        mox := @MyRO.EnemyModel[emix];
    138         if Tribe[owner].ModelPicture[mix].HGr = HGrSystem then
     138        if not Assigned(Tribe[owner].ModelPicture[mix].HGr) then
    139139          InitEnemyModel(emix);
    140140      end
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r317 r318  
    102102  Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean;
    103103  const T: TTexture);
    104 procedure PaintLogo(ca: TCanvas; x, y, clLight, clShade: integer);
     104procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: integer);
    105105function SetMainTextureByAge(Age: integer): boolean;
    106106procedure LoadPhrases;
     
    164164  HGrSystem: TGraphicSet;
    165165  HGrSystem2: TGraphicSet;
    166   CityMark1: TGraphicSetItem;
    167   CityMark2: TGraphicSetItem;
    168   Ornament: TGraphicSetItem;
    169   Logo: TGraphicSetItem;
    170   BigBook: TGraphicSetItem;
    171   SmallBook: TGraphicSetItem;
    172   MenuLogo: TGraphicSetItem;
    173166  ClickFrameColor: Integer;
    174167  MainTextureAge: Integer;
     
    183176  InitOrnamentDone: Boolean;
    184177  Phrases2FallenBackToEnglish: Boolean;
     178
     179  // Graphic set items
     180  CityMark1: TGraphicSetItem;
     181  CityMark2: TGraphicSetItem;
     182  Ornament: TGraphicSetItem;
     183  Logo: TGraphicSetItem;
     184  BigBook: TGraphicSetItem;
     185  SmallBook: TGraphicSetItem;
     186  MenuLogo: TGraphicSetItem;
     187  LinkArrows: TGraphicSetItem;
     188  ScienceNationDot: TGraphicSetItem;
     189  ResearchIcon: TGraphicSetItem;
     190  ChangeIcon: TGraphicSetItem;
     191  TreasuryIcon: TGraphicSetItem;
     192  StarshipDeparted: TGraphicSetItem;
     193  WeightOn: TGraphicSetItem;
     194  WeightOff: TGraphicSetItem;
    185195
    186196  UniFont: array [TFontType] of TFont;
     
    15021512end;
    15031513
    1504 procedure PaintLogo(ca: TCanvas; x, y, clLight, clShade: Integer);
     1514procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer);
    15051515begin
    15061516  // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    15071517  LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    1508   BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, ca, x, y);
     1518  BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y);
    15091519  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect,
    1510     clLight, clShade);
    1511   BitBltCanvas(ca, x, y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
     1520    LightColor, ShadeColor);
     1521  BitBltCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
    15121522end;
    15131523
     
    16901700  LoadFonts;
    16911701  Templates := LoadGraphicSet2('Templates.png');
    1692   Logo := Templates.GetItem('Logo');
    1693   BigBook := Templates.GetItem('BigBook');
    1694   SmallBook := Templates.GetItem('SmallBook');
    1695   MenuLogo := Templates.GetItem('MenuLogo');
     1702  with Templates do begin
     1703    Logo := GetItem('Logo');
     1704    BigBook := GetItem('BigBook');
     1705    SmallBook := GetItem('SmallBook');
     1706    MenuLogo := GetItem('MenuLogo');
     1707    LinkArrows := GetItem('LinkArrows');
     1708    ScienceNationDot := GetItem('ScienceNationDot');
     1709    ResearchIcon := GetItem('Research');
     1710    ChangeIcon := GetItem('Change');
     1711    TreasuryIcon := GetItem('Treasury');
     1712    StarshipDeparted := GetItem('StarshipDeparted');
     1713    WeightOn := GetItem('WeightOn');
     1714    WeightOff := GetItem('WeightOff');
     1715  end;
     1716
    16961717  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    16971718  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
  • trunk/Start.pas

    r317 r318  
    881881              // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    882882              LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    883               BitBltCanvas(LogoBuffer.Canvas, 0, 0, 91, 25, Canvas,
     883              BitBltCanvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas,
    884884                xActionIcon, y + 2);
    885               ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, 1, 400, 91, 25, 0,
     885              ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0,
    886886                Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]);
    887               BitBltCanvas(Canvas, xActionIcon, y + 2, 91, 25,
     887              BitBltCanvas(Canvas, xActionIcon, y + 2, LinkArrows.Width, LinkArrows.Height,
    888888                LogoBuffer.Canvas, 0, 0);
    889889            end;
Note: See TracChangeset for help on using the changeset viewer.