Ignore:
Timestamp:
May 21, 2020, 8:17:38 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Update from trunk rev 245.
  • Modified: Vcl prefix/suffix changed to Native.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/CityScreen.pas

    r210 r246  
    435435    end;
    436436  end;
    437 
    438   procedure MakeRed(X, Y, W, H: Integer);
    439   var
    440     XX, YY: Integer;
    441     Gray: Integer;
    442     PixelPtr: TPixelPointer;
    443   begin
    444     X := ScaleToVcl(X);
    445     Y := ScaleToVcl(Y);
    446     W := ScaleToVcl(W);
    447     H := ScaleToVcl(H);
    448     Offscreen.BeginUpdate;
    449     PixelPtr := PixelPointer(Offscreen, X, Y);
    450     for YY := 0 to H - 1 do begin
    451       for XX := 0 to W - 1 do begin
    452         Gray := (Integer(PixelPtr.Pixel^.B) + Integer(PixelPtr.Pixel^.G) +
    453         Integer(PixelPtr.Pixel^.R)) * 85 shr 8;
    454         PixelPtr.Pixel^.B := 0;
    455         PixelPtr.Pixel^.G := 0;
    456         PixelPtr.Pixel^.R := Gray; // 255-(255-gray) div 2;
    457         PixelPtr.NextPixel;
    458       end;
    459       PixelPtr.NextLine;
    460     end;
    461     Offscreen.EndUpdate;
    462   end;
    463 
    464437var
    465438  line, MessageCount: integer;
     
    565538  if not IsCityAlive then
    566539  begin
    567     MakeRed(18, 280, 298, 40);
     540    MakeRed(Offscreen, 18, 280, 298, 40);
    568541    if cGov = gAnarchy then
    569542      s := Phrases.Lookup('GOVERNMENT', gAnarchy)
     
    701674    else
    702675    begin
    703       MakeRed(xHapp + dxBar - 6, yHapp + 2 * dyBar, wBar + 10, 38);
     676      MakeRed(Offscreen, xHapp + dxBar - 6, yHapp + 2 * dyBar, wBar + 10, 38);
    704677      CountBar(offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 18,
    705678        Phrases.Lookup('LACK'), -Report.HappinessBalance, RedTex);
     
    726699    else
    727700    begin
    728       MakeRed(xFood + dxBar - 6, yFood + 2 * dyBar, wBar + 10, 38);
     701      MakeRed(Offscreen, xFood + dxBar - 6, yFood + 2 * dyBar, wBar + 10, 38);
    729702      CountBar(offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 1,
    730703        Phrases.Lookup('LACK'), -Report.FoodSurplus, RedTex);
     
    759732    else
    760733    begin
    761       MakeRed(xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38);
     734      MakeRed(Offscreen, xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38);
    762735      CountBar(offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 3,
    763736        Phrases.Lookup('LACK'), -Report.Production, RedTex);
     
    16841657  end
    16851658  else
     1659  if OpenSoundEvent >= 0 then
    16861660    Play(CityEventSoundItem[OpenSoundEvent]);
    16871661  OpenSoundEvent := -2;
Note: See TracChangeset for help on using the changeset viewer.