Changeset 246 for branches/highdpi/Start.pas
- Timestamp:
- May 21, 2020, 8:17:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Start.pas
r244 r246 48 48 Bitmap: TDpiBitmap; { game world sample preview } 49 49 Size: TPoint; 50 Colors: array [0 ..fTerrain, 0..1] of TColor;50 Colors: array [0 .. 11, 0 .. 1] of TColor; 51 51 Mode: TMiniMode; 52 52 procedure LoadFromLogFile(FileName: string; var LastTurn: Integer); … … 355 355 Bitmap.BeginUpdate; 356 356 MiniPixel := PixelPointer(Bitmap); 357 for y := 0 to ScaleTo Vcl(Size.Y) - 1 do begin358 for x := 0 to ScaleTo Vcl(Size.X) - 1 do begin357 for y := 0 to ScaleToNative(Size.Y) - 1 do begin 358 for x := 0 to ScaleToNative(Size.X) - 1 do begin 359 359 for i := 0 to 1 do begin 360 xm := (x * 2 + i + y and 1) mod (ScaleTo Vcl(Size.X) * 2);360 xm := (x * 2 + i + y and 1) mod (ScaleToNative(Size.X) * 2); 361 361 MiniPixel.SetX(xm); 362 362 cm := Colors 363 [Map[ScaleFrom Vcl(x) * lxmax div Size.X + lxmax *364 ((ScaleFrom Vcl(y) * (lymax - 1) + Size.Y div 2) div (Size.Y - 1))] and363 [Map[ScaleFromNative(x) * lxmax div Size.X + lxmax * 364 ((ScaleFromNative(y) * (lymax - 1) + Size.Y div 2) div (Size.Y - 1))] and 365 365 fTerrain, i]; 366 366 MiniPixel.Pixel^.B := ((cm shr 16) and $FF) * Brightness div 3; … … 388 388 MiniPixel := PixelPointer(Bitmap); 389 389 PrevMiniPixel := PixelPointer(Bitmap, 0, -1); 390 for y := 0 to ScaleTo Vcl(Size.Y) - 1 do begin391 for x := 0 to ScaleTo Vcl(Size.X) - 1 do begin390 for y := 0 to ScaleToNative(Size.Y) - 1 do begin 391 for x := 0 to ScaleToNative(Size.X) - 1 do begin 392 392 for i := 0 to 1 do begin 393 xm := (x * 2 + i + y and 1) mod (ScaleTo Vcl(Size.X) * 2);393 xm := (x * 2 + i + y and 1) mod (ScaleToNative(Size.X) * 2); 394 394 MiniPixel.SetX(xm); 395 Tile := SaveMap[ScaleFrom Vcl(x) + Size.X * ScaleFromVcl(y)];395 Tile := SaveMap[ScaleFromNative(x) + Size.X * ScaleFromNative(y)]; 396 396 if Tile and fTerrain = fUNKNOWN then 397 397 cm := $000000 … … 694 694 Location := Point((DpiScreen.Width - 800) * 3 div 8, 695 695 DpiScreen.Height - Height - (DpiScreen.Height - 600) div 3); 696 Left := Location.X; 697 Top := Location.Y; 696 BoundsRect := Bounds(Location.X, Location.Y, Width, Height); 698 697 699 698 r0 := DpiCreateRectRgn(0, 0, Width, Height); … … 708 707 DeleteObject(r0); // causes crash with Windows 95 709 708 end else begin 710 Left := (DpiScreen.Width - Width) div 2;711 Top := (DpiScreen.Height - Height) div 2;709 BoundsRect := Bounds((DpiScreen.Width - Width) div 2, 710 (DpiScreen.Height - Height) div 2, Width, Height) 712 711 end; 713 712 end; … … 1609 1608 if Tab <> tbNew then 1610 1609 if List.Count > 0 then begin 1611 if (List .Count > ListIndex[Tab]) then1610 if (ListIndex[Tab] < List.Count) and (ListIndex[Tab] >= 0) then 1612 1611 List.ItemIndex := ListIndex[Tab] 1613 1612 else List.ItemIndex := 0;
Note:
See TracChangeset
for help on using the changeset viewer.