Changeset 265 for branches/highdpi/LocalPlayer
- Timestamp:
- Jun 25, 2020, 10:24:44 PM (5 years ago)
- Location:
- branches/highdpi/LocalPlayer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Help.pas
r255 r265 993 993 Name: string; 994 994 begin 995 RightMargin := InnerWidth - 16 - GetSystemMetrics(SM_CXVSCROLL);995 RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL); 996 996 FollowFormat := pkNormal; 997 997 while s <> '' do … … 1255 1255 s := List[i]; 1256 1256 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 - 1257 GetSystemMetrics(SM_CXVSCROLL) do1257 DpiGetSystemMetrics(SM_CXVSCROLL) do 1258 1258 Delete(s, length(s), 1); 1259 1259 MainText.AddLine(s); … … 1273 1273 s := List[i]; 1274 1274 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 - 1275 GetSystemMetrics(SM_CXVSCROLL) do1275 DpiGetSystemMetrics(SM_CXVSCROLL) do 1276 1276 Delete(s, length(s), 1); 1277 1277 MainText.AddLine(s); … … 2248 2248 2249 2249 // cut lines to fit to window 2250 RightMargin := InnerWidth - 16 - GetSystemMetrics(SM_CXVSCROLL);2250 RightMargin := InnerWidth - 16 - DpiGetSystemMetrics(SM_CXVSCROLL); 2251 2251 OffScreen.Canvas.Font.Assign(UniFont[ftNormal]); 2252 2252 for i := 0 to SearchResult.Count - 1 do -
branches/highdpi/LocalPlayer/IsoEngine.pas
r246 r265 375 375 begin 376 376 for i := 0 to yyt * 3 - 1 do 377 MaskLine[i] := PixelPointer(Mask24, 0, 1 + ySrc * (yyt * 3 + 1) + i); 378 for xSrc := 0 to 9 - 1 do 379 begin 380 i := ySrc * 9 + xSrc; 377 MaskLine[i] := PixelPointer(Mask24, 0, ScaleToNative(1 + ySrc * (yyt * 3 + 1) + i)); 378 for xSrc := 0 to TerrainIconCols - 1 do begin 379 i := ySrc * TerrainIconCols + xSrc; 381 380 TSpriteSize[i].Left := 0; 382 381 repeat 383 382 Border := true; 384 383 for y := 0 to yyt * 3 - 1 do begin 385 MaskLine[y].SetX( 1 + xSrc * (xxt * 2 + 1) + TSpriteSize[i].Left);384 MaskLine[y].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[i].Left)); 386 385 if MaskLine[y].Pixel^.B = 0 then Border := false; 387 386 end; … … 392 391 Border := true; 393 392 for x := 0 to xxt * 2 - 1 do begin 394 MaskLine[TSpriteSize[i].Top].SetX( 1 + xSrc * (xxt * 2 + 1) + x);393 MaskLine[TSpriteSize[i].Top].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x)); 395 394 if MaskLine[TSpriteSize[i].Top].Pixel^.B = 0 then Border := false; 396 395 end; … … 401 400 Border := true; 402 401 for y := 0 to yyt * 3 - 1 do begin 403 MaskLine[y].SetX( xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right);402 MaskLine[y].SetX(ScaleToNative(xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right)); 404 403 if MaskLine[y].Pixel^.B = 0 then Border := false; 405 404 end; … … 410 409 Border := true; 411 410 for x := 0 to xxt * 2 - 1 do begin 412 MaskLine[TSpriteSize[i].Bottom - 1].SetX( 1 + xSrc * (xxt * 2 + 1) + x);411 MaskLine[TSpriteSize[i].Bottom - 1].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x)); 413 412 if MaskLine[TSpriteSize[i].Bottom - 1].Pixel^.B = 0 then Border := false; 414 413 end; … … 1079 1078 if not(FoW and (Tile and fObserved = 0)) then 1080 1079 PaintBorder; 1081 1082 1080 if (Loc >= 0) and (Loc < G.lx * G.ly) and (Loc = FAdviceLoc) then 1083 1081 TSprite(x, y, spPlain); … … 1289 1287 i: integer; 1290 1288 begin 1289 FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3)); 1291 1290 FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3)); 1292 1291 for i := 0 to nx div 2 do … … 1560 1559 PaintTileExtraTerrain(x + xxt * dx, y + yyt + yyt * dy, 1561 1560 dLoc(Loc, dx, dy)); 1561 1562 1562 if CityOwner >= 0 then 1563 1563 begin -
branches/highdpi/LocalPlayer/Select.pas
r252 r265 684 684 kTribe, kMission: // center text 685 685 if Lines[0] > MaxLines then 686 x := (InnerWidth - GetSystemMetrics(SM_CXVSCROLL)) div 2 -686 x := (InnerWidth - DpiGetSystemMetrics(SM_CXVSCROLL)) div 2 - 687 687 BiColorTextWidth(ca, s) div 2 688 688 else … … 1575 1575 kTribe: 1576 1576 if Lines[0] > MaxLines then 1577 InnerWidth := 280 + GetSystemMetrics(SM_CXVSCROLL)1577 InnerWidth := 280 + DpiGetSystemMetrics(SM_CXVSCROLL) 1578 1578 else 1579 1579 InnerWidth := 280; … … 1581 1581 begin 1582 1582 InnerWidth := 104 - 33 + 15 + 8 + TechNameSpace + 24 * nColumn + 1583 GetSystemMetrics(SM_CXVSCROLL);1583 DpiGetSystemMetrics(SM_CXVSCROLL); 1584 1584 if InnerWidth + 2 * SideFrame > 640 then 1585 1585 begin … … 1590 1590 kAdvance, kFarAdvance: 1591 1591 InnerWidth := 104 - 33 + 15 + 8 + TechNameSpace + 24 + 1592 GetSystemMetrics(SM_CXVSCROLL);1592 DpiGetSystemMetrics(SM_CXVSCROLL); 1593 1593 kChooseTech, kChooseETech, kStealTech: 1594 1594 InnerWidth := 104 - 33 + 15 + 8 + TechNameSpace + 1595 GetSystemMetrics(SM_CXVSCROLL);1595 DpiGetSystemMetrics(SM_CXVSCROLL); 1596 1596 else 1597 1597 InnerWidth := 363; … … 1604 1604 { TODO: 1605 1605 SetWindowPos(sb.ScrollBar.Handle, 0, SideFrame + InnerWidth - GetSystemMetrics(SM_CXVSCROLL), 1606 TitleHeight, GetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48,1606 TitleHeight, DpiGetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48, 1607 1607 SWP_NOZORDER or SWP_NOREDRAW); 1608 1608 } -
branches/highdpi/LocalPlayer/Term.pas
r254 r265 563 563 nx := BigImp.Width div xSizeBig * xSizeSmall; 564 564 ny := BigImp.Height div ySizeBig * ySizeSmall; 565 SmallImp.SetSize(nx, ny); 566 SmallImp.Canvas.StretchDraw(Rect(0, 0, SmallImp.Width, SmallImp.Height), BigImp); 567 568 { nx := BigImp.Width div xSizeBig * xSizeSmall; 569 ny := BigImp.Height div ySizeBig * ySizeSmall; 565 570 566 571 // resample icons … … 636 641 SmallImp.EndUpdate; 637 642 FreeMem(Resampled); 643 } 638 644 end; 639 645 … … 3583 3589 sb.SetBorderSpacing(ClientHeight - yTroop - 24, ClientWidth - xRightPanel + 8, 8); 3584 3590 {TODO: 3585 SetWindowPos(sb.ScrollBar.Handle, 0, xRightPanel + 10 - 14 - GetSystemMetrics(SM_CXVSCROLL),3591 SetWindowPos(sb.ScrollBar.Handle, 0, xRightPanel + 10 - 14 - DpiGetSystemMetrics(SM_CXVSCROLL), 3586 3592 ClientHeight - MidPanelHeight + 8, 0, 0, SWP_NOSIZE or SWP_NOZORDER); 3587 3593 } … … 3669 3675 if SmallScreen and not supervising then 3670 3676 xTroop := xRightPanel + 10 - 3 * 66 - 3671 GetSystemMetrics(SM_CXVSCROLL) - 19 - 4;3677 DpiGetSystemMetrics(SM_CXVSCROLL) - 19 - 4; 3672 3678 // not perfect but we assume almost no one is still playing on a 800x600 screen 3673 3679 end; 3674 TrRow := (xRightPanel + 10 - xTroop - GetSystemMetrics(SM_CXVSCROLL) - 19)3680 TrRow := (xRightPanel + 10 - xTroop - DpiGetSystemMetrics(SM_CXVSCROLL) - 19) 3675 3681 div TrPitch; 3676 3682 end; … … 5330 5336 else 5331 5337 EditPopup.Popup(Left + x + 4, 5332 Top + y + GetSystemMetrics(SM_CYCAPTION) + 4);5338 Top + y + DpiGetSystemMetrics(SM_CYCAPTION) + 4); 5333 5339 end 5334 5340 else if (UnFocus >= 0) and (MyUn[UnFocus].Loc <> MouseLoc) then … … 6214 6220 StatPopup.Popup(Left + ClientWidth - xPalace + 6, 6215 6221 Top + ClientHeight - PanelHeight + yPalace + ySizeBig + 6216 GetSystemMetrics(SM_CYCAPTION) + 3)6222 DpiGetSystemMetrics(SM_CYCAPTION) + 3) 6217 6223 end 6218 6224 (* else if (x>=xAdvisor-3) and (y>=yAdvisor-3) … … 6306 6312 begin 6307 6313 TroopLoc := Loc; 6308 TrRow := (xRightPanel + 10 - xTroop - GetSystemMetrics(SM_CXVSCROLL) - 19)6314 TrRow := (xRightPanel + 10 - xTroop - DpiGetSystemMetrics(SM_CXVSCROLL) - 19) 6309 6315 div TrPitch; 6310 6316 TrCnt := 0; … … 7440 7446 else 7441 7447 Popup.Popup(Left + TDpiControl(Sender).Left + 4, Top + TDpiControl(Sender).Top + 7442 GetSystemMetrics(SM_CYCAPTION) + 4);7448 DpiGetSystemMetrics(SM_CYCAPTION) + 4); 7443 7449 end; 7444 7450 … … 7600 7606 GamePopup.Popup(Left, Top + TopBarHeight - 1) 7601 7607 else 7602 GamePopup.Popup(Left + 4, Top + GetSystemMetrics(SM_CYCAPTION) + 4 +7608 GamePopup.Popup(Left + 4, Top + DpiGetSystemMetrics(SM_CYCAPTION) + 4 + 7603 7609 TopBarHeight - 1); 7604 7610 end … … 7890 7896 GamePopup.Popup(Left, Top + TopBarHeight - 1) 7891 7897 else 7892 GamePopup.Popup(Left + 4, Top + GetSystemMetrics(SM_CYCAPTION) + 4 +7898 GamePopup.Popup(Left + 4, Top + DpiGetSystemMetrics(SM_CYCAPTION) + 4 + 7893 7899 TopBarHeight - 1); 7894 7900 exit
Note:
See TracChangeset
for help on using the changeset viewer.