Changeset 308
- Timestamp:
- Mar 9, 2021, 9:13:07 PM (4 years ago)
- Location:
- branches/highdpi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r303 r308 9 9 Controls, StdCtrls, fgl, Graphics, ComCtrls, ExtCtrls, LCLType, GraphType, 10 10 Types, CustApp, LMessages, LCLIntf, Menus, Math, UPixelPointer2; 11 12 const 13 FixedDpi = -1; 11 14 12 15 type … … 1071 1074 function ScaleToNative(Value: Integer): Integer; 1072 1075 begin 1073 Result := Round(Value * DpiScreen.Dpi / 96);1076 Result := Trunc(Value * DpiScreen.Dpi / 96); 1074 1077 end; 1075 1078 … … 3068 3071 procedure TDpiScreen.UpdateScreen; 3069 3072 begin 3070 Dpi := Screen.PixelsPerInch; 3073 if FixedDpi = -1 then Dpi := Screen.PixelsPerInch 3074 else Dpi := FixedDpi; 3071 3075 end; 3072 3076 -
branches/highdpi/Start.pas
r303 r308 380 380 MiniPixel: TPixelPointer; 381 381 PrevMiniPixel: TPixelPointer; 382 TerrainTile: Cardinal; 382 383 begin 383 384 OwnColor := GrExt[HGrSystem].Data.Canvas.Pixels[95, 67]; … … 415 416 cm := OwnColor 416 417 else cm := EnemyColor 417 else 418 cm := Colors[Tile and fTerrain, i]; 418 else begin 419 TerrainTile := Tile and fTerrain; 420 if TerrainTile > 11 then TerrainTile := 0; 421 cm := Colors[TerrainTile, i]; 422 end; 419 423 MiniPixel.Pixel^.B := (cm shr 16) and $ff; 420 424 MiniPixel.Pixel^.G := (cm shr 8) and $ff;
Note:
See TracChangeset
for help on using the changeset viewer.