Changeset 210 for branches/highdpi/LocalPlayer/CityScreen.pas
- Timestamp:
- May 9, 2020, 4:02:07 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/CityScreen.pas
r193 r210 5 5 6 6 uses 7 {$IFDEF LINUX}7 UDpiControls, {$IFDEF LINUX} 8 8 LMessages, 9 9 {$ENDIF} 10 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin, UDpiControls,10 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin, 11 11 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, 12 12 ButtonA, ButtonC, Area, GraphType; … … 90 90 91 91 uses 92 Select, Messg, MessgEx, Help, Tribes, Directories, Math ;92 Select, Messg, MessgEx, Help, Tribes, Directories, Math, UPixelPointer, Sound; 93 93 94 94 {$R *.lfm} … … 216 216 Template := TDpiBitmap.Create; 217 217 Template.PixelFormat := pf24bit; 218 LoadGraphicFile(Template, HomeDir + 'Graphics'+ DirectorySeparator + 'City.png', gfNoGamma);218 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City.png', gfNoGamma); 219 219 CityMapTemplate := TDpiBitmap.Create; 220 220 CityMapTemplate.PixelFormat := pf24bit; 221 LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics'+ DirectorySeparator + 'BigCityMap.png', gfNoGamma);221 LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap.png', gfNoGamma); 222 222 SmallCityMapTemplate := TDpiBitmap.Create; 223 223 SmallCityMapTemplate.PixelFormat := pf24bit; 224 LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics'+ DirectorySeparator + 'SmallCityMap.png',224 LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap.png', 225 225 gfNoGamma); 226 226 SmallCityMap := TDpiBitmap.Create; … … 260 260 Back.Canvas.FillRect(0, 0, ClientWidth, ClientHeight); 261 261 262 Dpi bitblt(Back.Canvas.Handle, 0, 0, ClientWidth, ClientHeight,263 MainTexture.Image.Canvas .Handle, 0, 0, SRCCOPY);262 DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 263 MainTexture.Image.Canvas, 0, 0); 264 264 ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight); 265 265 end; … … 291 291 Color2 := Colors.Canvas.Pixels[clkAge0 + Age, cliHouse]; 292 292 SmallCityMap.Canvas.FillRect(0, 0, SmallCityMap.Width, SmallCityMap.Height); 293 Dpi bitblt(SmallCityMap.Canvas.Handle, 0, 0, 83, hSmallMap,294 SmallCityMapTemplate.Canvas .Handle, 83 * SizeClass, 0, SRCCOPY);293 DpiBitCanvas(SmallCityMap.Canvas, 0, 0, 83, hSmallMap, 294 SmallCityMapTemplate.Canvas, 83 * SizeClass, 0); 295 295 if IsPort then 296 296 begin 297 Dpi bitblt(SmallCityMap.Canvas.Handle, 83, 0, 15, hSmallMap,298 SmallCityMapTemplate.Canvas .Handle, 332 + 15, 0, SRCCOPY);297 DpiBitCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap, 298 SmallCityMapTemplate.Canvas, 332 + 15, 0); 299 299 ImageOp_CCC(SmallCityMap, 0, 0, 83, hSmallMap, Color0, Color1, Color2); 300 300 Color2 := Colors.Canvas.Pixels[clkCity, cliWater]; … … 303 303 else 304 304 begin 305 Dpi bitblt(SmallCityMap.Canvas.Handle, 83, 0, 15, hSmallMap,306 SmallCityMapTemplate.Canvas .Handle, 332, 0, SRCCOPY);305 DpiBitCanvas(SmallCityMap.Canvas, 83, 0, 15, hSmallMap, 306 SmallCityMapTemplate.Canvas, 332, 0); 307 307 ImageOp_CCC(SmallCityMap, 0, 0, wSmallMap, hSmallMap, Color0, 308 308 Color1, Color2); … … 311 311 with SmallCityMap.Canvas do 312 312 begin 313 brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImp];313 Brush.Color := ScreenTools.Colors.Canvas.Pixels[clkAge0 + Age, cliImp]; 314 314 for i := 0 to 29 do 315 315 begin … … 359 359 ZoomCityMap.Canvas.FillRect(0, 0, ZoomCityMap.Width, ZoomCityMap.Height); 360 360 361 Dpi bitblt(ZoomCityMap.Canvas.Handle, 0, 0, wZoomMap, hZoomMap,362 Back.Canvas .Handle, xZoomMap, yZoomMap, SRCCOPY);361 DpiBitCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap, 362 Back.Canvas, xZoomMap, yZoomMap); 363 363 if Mode = mImp then begin 364 364 if ZoomArea < 3 then begin … … 442 442 PixelPtr: TPixelPointer; 443 443 begin 444 X := ScaleToVcl(X); 445 Y := ScaleToVcl(Y); 446 W := ScaleToVcl(W); 447 H := ScaleToVcl(H); 444 448 Offscreen.BeginUpdate; 445 PixelPtr .Init(Offscreen, X, Y);449 PixelPtr := PixelPointer(Offscreen, X, Y); 446 450 for YY := 0 to H - 1 do begin 447 451 for XX := 0 to W - 1 do begin … … 498 502 499 503 var 500 x, y, xGr, i, i1,j, iix, d, dx, dy, PrCost, Cnt, Loc1, FreeSupp, Paintiix,504 x, y, xGr, i, j, iix, d, dx, dy, PrCost, Cnt, Loc1, FreeSupp, Paintiix, 501 505 HappyGain, OptiType, rx, ry, TrueFood, TrueProd, TruePoll: integer; 502 506 av: integer; … … 542 546 RedTex.clTextShade := $0000FF; 543 547 544 Dpibitblt(offscreen.Canvas.Handle, 0, 0, 640, 480, Back.Canvas.Handle, 0, 545 0, SRCCOPY); 546 547 offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 548 DpiBitCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0); 549 550 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 548 551 RisedTextOut(offscreen.Canvas, 42, 7, Caption); 549 552 with offscreen.Canvas do … … 558 561 TextOut(8 + 14 - textwidth(s) div 2, 7, s); 559 562 end; 560 offscreen.Canvas.Font.Assign(UniFont[ftSmall]);563 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 561 564 562 565 if not IsCityAlive then … … 614 617 false, AllowChange and IsCityAlive and 615 618 (c.Status and csResourceWeightsMask = 0)); 616 Dpi bitblt(offscreen.Canvas.Handle, xmArea + 102, 42, 90, 33, Back.Canvas.Handle,617 xmArea + 102, 42 , SRCCOPY);619 DpiBitCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 620 xmArea + 102, 42); 618 621 619 622 if IsCityAlive then … … 645 648 else 646 649 xGr := 141; 647 Dpi bitblt(offscreen.Canvas.Handle, xmArea - 192 + 5 + i * d, ymArea - 96 - 29,648 27, 30, GrExt[HGrSystem].Mask.Canvas .Handle, xGr, 171, SRCAND); { shadow }650 DpiBitCanvas(offscreen.Canvas, xmArea - 192 + 5 + i * d, ymArea - 96 - 29, 651 27, 30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow } 649 652 Sprite(offscreen, HGrSystem, xmArea - 192 + 4 + i * d, ymArea - 96 - 30, 27, 650 653 30, xGr, 171); … … 657 660 begin 658 661 xGr := 1 + 112; 659 Dpi bitblt(offscreen.Canvas.Handle, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27,660 30, GrExt[HGrSystem].Mask.Canvas .Handle, xGr, 171, SRCAND); { shadow }662 DpiBitCanvas(offscreen.Canvas, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27, 663 30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow } 661 664 Sprite(offscreen, HGrSystem, xmArea + 192 - 27 - i * d, 29, 27, 30, 662 665 xGr, 171); … … 803 806 804 807 // small map 805 Dpi bitblt(offscreen.Canvas.Handle, xSmallMap, ySmallMap, wSmallMap, hSmallMap,806 SmallCityMap.Canvas .Handle, 0, 0, SRCCOPY);808 DpiBitCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap, 809 SmallCityMap.Canvas, 0, 0); 807 810 if Mode = mImp then 808 811 Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3), … … 831 834 Sprite(offscreen, HGrSystem, x + 6, y - 5, 10, 10, 154, 126); 832 835 833 Dpi bitblt(offscreen.Canvas.Handle, xZoomMap, yZoomMap, wZoomMap, hZoomMap,834 ZoomCityMap.Canvas .Handle, 0, 0, SRCCOPY);836 DpiBitCanvas(offscreen.Canvas, xZoomMap, yZoomMap, wZoomMap, hZoomMap, 837 ZoomCityMap.Canvas, 0, 0); 835 838 836 839 for i := 0 to 5 do … … 1620 1623 with Canvas do 1621 1624 begin 1622 Dpi bitblt(Canvas.Handle, xView + 5, yView + 1, 64, 2, Back.Canvas.Handle,1623 xView + 5, yView + 1 , SRCCOPY);1624 Dpi bitblt(Canvas.Handle, xView + 5, yView + 3, 2, 42, Back.Canvas.Handle,1625 xView + 5, yView + 3 , SRCCOPY);1626 Dpi bitblt(Canvas.Handle, xView + 5 + 62, yView + 3, 2, 42,1627 Back.Canvas .Handle, xView + 5 + 62, yView + 3, SRCCOPY);1625 DpiBitCanvas(Canvas, xView + 5, yView + 1, 64, 2, Back.Canvas, 1626 xView + 5, yView + 1); 1627 DpiBitCanvas(Canvas, xView + 5, yView + 3, 2, 42, Back.Canvas, 1628 xView + 5, yView + 3); 1629 DpiBitCanvas(Canvas, xView + 5 + 62, yView + 3, 2, 42, 1630 Back.Canvas, xView + 5 + 62, yView + 3); 1628 1631 ScreenTools.Frame(Canvas, xView + 9 - 1, yView + 5 - 1, xView + 9 + xSizeBig, 1629 1632 yView + 5 + ySizeBig, $B0B0B0, $FFFFFF); 1630 1633 RFrame(Canvas, xView + 9 - 2, yView + 5 - 2, xView + 9 + xSizeBig + 1, 1631 1634 yView + 5 + ySizeBig + 1, $FFFFFF, $B0B0B0); 1632 brush.Color := $000000;1635 Brush.Color := $000000; 1633 1636 FillRect(Rect(xView + 9, yView + 5, xView + 1 + 72 - 8, 1634 1637 yView + 5 + 40)); 1635 brush.style := bsClear;1638 Brush.style := bsClear; 1636 1639 end 1637 1640 else if BlinkTime = 6 then … … 1644 1647 else if c.Project and cpImp = 0 then 1645 1648 begin // project is unit 1646 Dpi bitblt(Canvas.Handle, xView + 9, yView + 5, xSizeBig, ySizeBig,1647 bigimp.Canvas.Handle, 0, 0, SRCCOPY);1649 DpiBitCanvas(Canvas, xView + 9, yView + 5, xSizeBig, ySizeBig, 1650 Bigimp.Canvas, 0, 0); 1648 1651 with Tribe[cOwner].ModelPicture[c.Project and cpIndex] do 1649 1652 Sprite(Canvas, HGr, xView + 5, yView + 1, 64, 44, pix mod 10 * 65 + 1,
Note:
See TracChangeset
for help on using the changeset viewer.