Changeset 246 for branches/highdpi/LocalPlayer/CityScreen.pas
- Timestamp:
- May 21, 2020, 8:17:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/CityScreen.pas
r210 r246 435 435 end; 436 436 end; 437 438 procedure MakeRed(X, Y, W, H: Integer);439 var440 XX, YY: Integer;441 Gray: Integer;442 PixelPtr: TPixelPointer;443 begin444 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 begin451 for XX := 0 to W - 1 do begin452 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 464 437 var 465 438 line, MessageCount: integer; … … 565 538 if not IsCityAlive then 566 539 begin 567 MakeRed( 18, 280, 298, 40);540 MakeRed(Offscreen, 18, 280, 298, 40); 568 541 if cGov = gAnarchy then 569 542 s := Phrases.Lookup('GOVERNMENT', gAnarchy) … … 701 674 else 702 675 begin 703 MakeRed( xHapp + dxBar - 6, yHapp + 2 * dyBar, wBar + 10, 38);676 MakeRed(Offscreen, xHapp + dxBar - 6, yHapp + 2 * dyBar, wBar + 10, 38); 704 677 CountBar(offscreen, xHapp + dxBar, yHapp + 2 * dyBar, wBar, 18, 705 678 Phrases.Lookup('LACK'), -Report.HappinessBalance, RedTex); … … 726 699 else 727 700 begin 728 MakeRed( xFood + dxBar - 6, yFood + 2 * dyBar, wBar + 10, 38);701 MakeRed(Offscreen, xFood + dxBar - 6, yFood + 2 * dyBar, wBar + 10, 38); 729 702 CountBar(offscreen, xFood + dxBar, yFood + 2 * dyBar, wBar, 1, 730 703 Phrases.Lookup('LACK'), -Report.FoodSurplus, RedTex); … … 759 732 else 760 733 begin 761 MakeRed( xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38);734 MakeRed(Offscreen, xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38); 762 735 CountBar(offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 3, 763 736 Phrases.Lookup('LACK'), -Report.Production, RedTex); … … 1684 1657 end 1685 1658 else 1659 if OpenSoundEvent >= 0 then 1686 1660 Play(CityEventSoundItem[OpenSoundEvent]); 1687 1661 OpenSoundEvent := -2;
Note:
See TracChangeset
for help on using the changeset viewer.