Changeset 212 for branches/highdpi/LocalPlayer/IsoEngine.pas
- Timestamp:
- May 9, 2020, 9:35:25 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/IsoEngine.pas
r210 r212 34 34 function IsShoreTile(Loc: integer): boolean; 35 35 procedure MakeDark(Line: PPixelPointer; Length: Integer); 36 procedure ShadeOutside(x0, y0, x1, y1, xm, ym: integer);36 procedure ShadeOutside(x0, y0, Width, Height, xm, ym: integer); 37 37 protected 38 38 FOutput: TDpiBitmap; … … 1015 1015 1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1)); 1016 1016 Borders.BeginUpdate; 1017 for dy := 0 to yyt * 2 - 1 do 1018 begin 1019 PixelPtr := PixelPointer(Borders, 0, p1 * (yyt * 2) + dy); 1020 for dx := 0 to xxt * 2 - 1 do begin 1017 PixelPtr := PixelPointer(Borders, ScaleToVcl(0), ScaleToVcl(p1 * (yyt * 2))); 1018 for dy := 0 to ScaleToVcl(yyt * 2) - 1 do begin 1019 for dx := 0 to ScaleToVcl(xxt * 2) - 1 do begin 1021 1020 if PixelPtr.Pixel^.B = 99 then begin 1022 1021 PixelPtr.Pixel^.B := Tribe[p1].Color shr 16 and $FF; … … 1026 1025 PixelPtr.NextPixel; 1027 1026 end; 1027 PixelPtr.NextLine; 1028 1028 end; 1029 1029 Borders.EndUpdate; … … 1330 1330 end; 1331 1331 1332 procedure TIsoMap.ShadeOutside(x0, y0, x1, y1, xm, ym: integer);1332 procedure TIsoMap.ShadeOutside(x0, y0, Width, Height, xm, ym: integer); 1333 1333 const 1334 1334 rShade = 3.75; … … 1339 1339 begin 1340 1340 FOutput.BeginUpdate; 1341 for y := y0 to y1 - 1 do begin1342 Line := PixelPointer(FOutput, 0, y);1343 y_n := ( y- ym) / yyt;1344 if abs(y_n) < rShade then begin1341 Line := PixelPointer(FOutput, ScaleToVcl(x0), ScaleToVcl(y0)); 1342 for y := 0 to ScaleToVcl(Height) - 1 do begin 1343 y_n := (ScaleFromVcl(y) + y0 - ym) / yyt; 1344 if Abs(y_n) < rShade then begin 1345 1345 // Darken left and right parts of elipsis 1346 w_n := sqrt(sqr(rShade) - sqr(y_n));1347 wBright := trunc(w_n * xxt + 0.5);1348 Line.SetX( x0);1349 MakeDark(@Line, xm - x0 - wBright);1350 Line.SetX( xm + wBright);1351 MakeDark(@Line, x1 - xm - wBright);1346 w_n := Sqrt(Sqr(rShade) - Sqr(y_n)); 1347 wBright := Trunc(w_n * xxt + 0.5); 1348 Line.SetX(0); 1349 MakeDark(@Line, ScaleToVcl(xm - wBright)); 1350 Line.SetX(ScaleToVcl(xm + wBright)); 1351 MakeDark(@Line, ScaleToVcl(Width - xm - wBright)); 1352 1352 end else begin 1353 1353 // Darken entire line 1354 Line.SetX( x0);1355 MakeDark(@Line, x1 - x0);1354 Line.SetX(0); 1355 MakeDark(@Line, ScaleToVcl(Width)); 1356 1356 end; 1357 Line.NextLine; 1357 1358 end; 1358 1359 FOutput.EndUpdate; … … 1576 1577 xm := x + (dx + 1) * xxt; 1577 1578 ym := y + (dy + 1) * yyt + yyt; 1578 ShadeOutside(FLeft, FTop, FRight , FBottom, xm, ym);1579 ShadeOutside(FLeft, FTop, FRight - FLeft, FBottom - FTop, xm, ym); 1579 1580 CityGrid(xm, ym, CityAllowClick); 1580 1581 for dy := -2 to ny + 1 do
Note:
See TracChangeset
for help on using the changeset viewer.