Changeset 210 for branches/highdpi/LocalPlayer/IsoEngine.pas
- Timestamp:
- May 9, 2020, 4:02:07 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/IsoEngine.pas
r179 r210 5 5 6 6 uses 7 Protocol, ClientTools, ScreenTools, Tribes, UDpiControls, 8 {$IFNDEF SCR}Term, {$ENDIF} 9 LCLIntf, LCLType, SysUtils, Classes, Graphics; 7 UDpiControls, Protocol, ClientTools, ScreenTools, Tribes, {$IFNDEF SCR}Term, {$ENDIF} 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, UPixelPointer; 10 9 11 10 type … … 24 23 procedure PaintCity(x, y: integer; const CityInfo: TCityInfo; 25 24 accessory: boolean = true); 26 procedure BitBlt (Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,25 procedure BitBltBitmap(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc, 27 26 Rop: integer); 28 27 … … 40 39 FLeft, FTop, FRight, FBottom, RealTop, RealBottom, AttLoc, DefLoc, 41 40 DefHealth, FAdviceLoc: integer; 42 DataDC, MaskDC: HDC; 41 DataCanvas: TDpiCanvas; 42 MaskCanvas: TDpiCanvas; 43 43 function Connection4(Loc, Mask, Value: integer): integer; 44 44 function Connection8(Loc, Mask: integer): integer; … … 89 89 90 90 // sprites indexes 91 sp DeadLands= 2 * TerrainIconCols + 6;91 spRow2 = 2 * TerrainIconCols + 6; 92 92 spBlink1 = 1 * TerrainIconCols + 8; 93 93 spBlink2 = 2 * TerrainIconCols + 8; … … 107 107 spPollution = 12 * TerrainIconCols + 6; 108 108 spFortBack = 12 * TerrainIconCols + 7; 109 spMinerals = 12 * TerrainIconCols + 8; 109 110 spRiver = 13 * TerrainIconCols; 111 spRiverMouths = 15 * TerrainIconCols; 112 spGrid = 15 * TerrainIconCols + 6; 110 113 spJungle = 18 * TerrainIconCols; 114 spCanalMouths = 20 * TerrainIconCols; 111 115 112 116 var … … 137 141 i, x, y, xSrc, ySrc, HGrTerrainNew, HGrCitiesNew, age, size: integer; 138 142 LandMore, OceanMore, DitherMask, Mask24: TDpiBitmap; 139 MaskLine: array [0 .. 32* 3 - 1] of TPixelPointer; // 32 = assumed maximum for yyt143 MaskLine: array [0 .. 50 * 3 - 1] of TPixelPointer; // 32 = assumed maximum for yyt 140 144 Border: boolean; 141 145 begin … … 191 195 DitherMask.SetSize(xxt * 2, yyt * 2); 192 196 DitherMask.Canvas.FillRect(0, 0, DitherMask.Width, DitherMask.Height); 193 BitBlt(DitherMask.Canvas.Handle, 0, 0, xxt * 2, yyt * 2,194 GrExt[HGrTerrain].Mask.Canvas .Handle, 1 + 7 * (xxt * 2 + 1),197 DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 198 GrExt[HGrTerrain].Mask.Canvas, 1 + 7 * (xxt * 2 + 1), 195 199 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 196 200 … … 213 217 end; 214 218 for y := -1 to 6 do 215 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt, 216 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas.Handle, xSrc, ySrc, 217 SRCCOPY); 219 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 220 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc); 218 221 for y := -2 to 6 do 219 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt, xxt,220 yyt, GrExt[HGrTerrain].Data.Canvas .Handle, xSrc + xxt, ySrc + yyt,222 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, xxt, 223 yyt, GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt, 221 224 SRCPAINT); 222 225 for y := -2 to 6 do 223 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2) + xxt, (y + 2) * yyt,224 xxt, yyt, GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc + yyt,226 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2) + xxt, (y + 2) * yyt, 227 xxt, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, 225 228 SRCPAINT); 226 229 for y := -2 to 6 do 227 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt, xxt,228 yyt, DitherMask.Canvas .Handle, xxt, yyt, SRCAND);230 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, xxt, 231 yyt, DitherMask.Canvas, xxt, yyt, SRCAND); 229 232 for y := -2 to 6 do 230 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2) + xxt, (y + 2) * yyt,231 xxt, yyt, DitherMask.Canvas .Handle, 0, yyt, SRCAND);233 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2) + xxt, (y + 2) * yyt, 234 xxt, yyt, DitherMask.Canvas, 0, yyt, SRCAND); 232 235 end; 233 236 … … 250 253 end; 251 254 for x := -2 to 6 do 252 BitBlt(LandMore.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt, 253 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas.Handle, xSrc, ySrc, 254 SRCCOPY); 255 BitBlt(LandMore.Canvas.Handle, xxt * 2, (y + 2) * yyt, xxt, yyt, 256 GrExt[HGrTerrain].Data.Canvas.Handle, xSrc + xxt, ySrc + yyt, SRCPAINT); 255 DpiBitCanvas(LandMore.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 256 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc); 257 DpiBitCanvas(LandMore.Canvas, xxt * 2, (y + 2) * yyt, xxt, yyt, 258 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt, SRCPAINT); 257 259 for x := 0 to 7 do 258 BitBlt(LandMore.Canvas.Handle, (x + 2) * (xxt * 2) - xxt, (y + 2) * yyt,259 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc + yyt,260 DpiBitCanvas(LandMore.Canvas, (x + 2) * (xxt * 2) - xxt, (y + 2) * yyt, 261 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, 260 262 SRCPAINT); 261 263 for x := -2 to 6 do 262 BitBlt(LandMore.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt,263 xxt * 2, yyt, DitherMask.Canvas .Handle, 0, 0, SRCAND);264 DpiBitCanvas(LandMore.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 265 xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND); 264 266 end; 265 267 … … 273 275 ySrc := 1 + yyt; 274 276 if (x >= 1) = (y >= 2) then 275 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2), y * yyt, xxt * 2, yyt,276 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc, SRCCOPY);277 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 278 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc); 277 279 if (x >= 1) and ((y < 2) or (x >= 2)) then 278 280 begin 279 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2), y * yyt, xxt, yyt,280 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc + xxt, ySrc + yyt,281 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, 282 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt, 281 283 SRCPAINT); 282 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,283 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc + yyt, SRCPAINT);284 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt, 285 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 284 286 end; 285 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2), y * yyt, xxt, yyt,286 DitherMask.Canvas .Handle, xxt, yyt, SRCAND);287 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,288 DitherMask.Canvas .Handle, 0, yyt, SRCAND);287 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, 288 DitherMask.Canvas, xxt, yyt, SRCAND); 289 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt, 290 DitherMask.Canvas, 0, yyt, SRCAND); 289 291 end; 290 292 … … 298 300 ySrc := 1 + yyt; 299 301 if (x < 1) or (y >= 2) then 300 BitBlt(OceanMore.Canvas.Handle, x * (xxt * 2), y * yyt, xxt * 2, yyt,301 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc, SRCCOPY);302 DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 303 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc); 302 304 if (x = 1) and (y < 2) or (x >= 2) and (y >= 1) then 303 305 begin 304 BitBlt(OceanMore.Canvas.Handle, x * (xxt * 2), y * yyt, xxt, yyt,305 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc + xxt, ySrc + yyt,306 DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, 307 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt, 306 308 SRCPAINT); 307 BitBlt(OceanMore.Canvas.Handle, x * (xxt * 2) + xxt, y * yyt, xxt, yyt,308 GrExt[HGrTerrain].Data.Canvas .Handle, xSrc, ySrc + yyt, SRCPAINT);309 DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt, 310 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 309 311 end; 310 BitBlt(OceanMore.Canvas.Handle, x * (xxt * 2), y * yyt, xxt * 2, yyt,311 DitherMask.Canvas .Handle, 0, 0, SRCAND);312 DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 313 DitherMask.Canvas, 0, 0, SRCAND); 312 314 end; 313 315 314 BitBlt(DitherMask.Canvas.Handle, 0, 0, xxt * 2, yyt * 2,315 DitherMask.Canvas .Handle, 0, 0, DSTINVERT); { invert dither mask }316 BitBlt(DitherMask.Canvas.Handle, 0, 0, xxt * 2, yyt * 2,317 GrExt[HGrTerrain].Mask.Canvas .Handle, 1, 1 + yyt, SRCPAINT);316 DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 317 DitherMask.Canvas, 0, 0, DSTINVERT); { invert dither mask } 318 DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 319 GrExt[HGrTerrain].Mask.Canvas, 1, 1 + yyt, SRCPAINT); 318 320 319 321 for x := -1 to 6 do 320 322 for y := -2 to 6 do 321 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2), (y + 2) * yyt,322 xxt * 2, yyt, DitherMask.Canvas .Handle, 0, 0, SRCAND);323 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 324 xxt * 2, yyt, DitherMask.Canvas, 0, 0, SRCAND); 323 325 324 326 for y := -1 to 6 do 325 327 for x := -2 to 7 do 326 BitBlt(LandMore.Canvas.Handle, (x + 2) * (xxt * 2) - xxt, (y + 2) * yyt,327 xxt * 2, yyt, DitherMask.Canvas .Handle, 0, yyt, SRCAND);328 329 BitBlt(LandPatch.Canvas.Handle, 0, 0, (xxt * 2) * 9, yyt * 9,330 LandMore.Canvas .Handle, 0, 0, SRCPAINT);328 DpiBitCanvas(LandMore.Canvas, (x + 2) * (xxt * 2) - xxt, (y + 2) * yyt, 329 xxt * 2, yyt, DitherMask.Canvas, 0, yyt, SRCAND); 330 331 DpiBitCanvas(LandPatch.Canvas, 0, 0, (xxt * 2) * 9, yyt * 9, 332 LandMore.Canvas, 0, 0, SRCPAINT); 331 333 332 334 for x := 0 to 3 do 333 335 for y := 0 to 3 do 334 BitBlt(OceanPatch.Canvas.Handle, x * (xxt * 2), y * yyt, xxt * 2, yyt,335 DitherMask.Canvas .Handle, 0, 0, SRCAND);336 DpiBitCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 337 DitherMask.Canvas, 0, 0, SRCAND); 336 338 337 339 for y := 0 to 3 do 338 340 for x := 0 to 4 do 339 BitBlt(OceanMore.Canvas.Handle, x * (xxt * 2) - xxt, y * yyt, xxt * 2,340 yyt, DitherMask.Canvas .Handle, 0, yyt, SRCAND);341 342 BitBlt(OceanPatch.Canvas.Handle, 0, 0, (xxt * 2) * 4, yyt * 4,343 OceanMore.Canvas .Handle, 0, 0, SRCPAINT);341 DpiBitCanvas(OceanMore.Canvas, x * (xxt * 2) - xxt, y * yyt, xxt * 2, 342 yyt, DitherMask.Canvas, 0, yyt, SRCAND); 343 344 DpiBitCanvas(OceanPatch.Canvas, 0, 0, (xxt * 2) * 4, yyt * 4, 345 OceanMore.Canvas, 0, 0, SRCPAINT); 344 346 345 347 with DitherMask.Canvas do … … 348 350 FillRect(Rect(0, 0, xxt * 2, yyt)); 349 351 end; 350 BitBlt(DitherMask.Canvas.Handle, 0, 0, xxt * 2, yyt,351 GrExt[HGrTerrain].Mask.Canvas .Handle, 1, 1 + yyt, SRCCOPY);352 DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, 353 GrExt[HGrTerrain].Mask.Canvas, 1, 1 + yyt); 352 354 353 355 for x := 0 to 6 do 354 BitBlt(LandPatch.Canvas.Handle, (x + 2) * (xxt * 2), yyt, xxt * 2, yyt,355 DitherMask.Canvas .Handle, 0, 0, SRCAND);356 BitBlt(DitherMask.Canvas.Handle, 0, 0, xxt * 2, yyt, DitherMask.Canvas.Handle,356 DpiBitCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), yyt, xxt * 2, yyt, 357 DitherMask.Canvas, 0, 0, SRCAND); 358 DpiBitCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, DitherMask.Canvas, 357 359 0, 0, DSTINVERT); 358 360 359 361 for y := 0 to 6 do 360 BitBlt(LandPatch.Canvas.Handle, xxt * 2, (y + 2) * yyt, xxt * 2, yyt,361 DitherMask.Canvas .Handle, 0, 0, SRCAND);362 DpiBitCanvas(LandPatch.Canvas, xxt * 2, (y + 2) * yyt, xxt * 2, yyt, 363 DitherMask.Canvas, 0, 0, SRCAND); 362 364 363 365 LandMore.Free; … … 373 375 begin 374 376 for i := 0 to yyt * 3 - 1 do 375 MaskLine[i] .Init(Mask24, 0, 1 + ySrc * (yyt * 3 + 1) + i);377 MaskLine[i] := PixelPointer(Mask24, 0, 1 + ySrc * (yyt * 3 + 1) + i); 376 378 for xSrc := 0 to 9 - 1 do 377 379 begin … … 422 424 Borders := TDpiBitmap.Create; 423 425 Borders.PixelFormat := pf24bit; 424 Borders.SetSize(xxt * 2, (yyt * 2) * nPl);426 Borders.SetSize(xxt * 2, (yyt * 2) * nPl); 425 427 Borders.Canvas.FillRect(0, 0, Borders.Width, Borders.Height); 426 428 BordersOK := 0; … … 474 476 begin 475 477 Width := Width - (FLeft - x); 476 x := FLeft 478 x := FLeft; 477 479 end; 478 480 if y < FTop then 479 481 begin 480 482 Height := Height - (FTop - y); 481 y := FTop 483 y := FTop; 482 484 end; 483 485 if x + Width >= FRight then … … 499 501 end; 500 502 501 procedure TIsoMap.BitBlt (Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,503 procedure TIsoMap.BitBltBitmap(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc, 502 504 Rop: integer); 503 505 begin … … 506 508 Width := Width - (FLeft - x); 507 509 xSrc := xSrc + (FLeft - x); 508 x := FLeft 510 x := FLeft; 509 511 end; 510 512 if y < FTop then … … 512 514 Height := Height - (FTop - y); 513 515 ySrc := ySrc + (FTop - y); 514 y := FTop 516 y := FTop; 515 517 end; 516 518 if x + Width >= FRight then … … 521 523 exit; 522 524 523 DpiBitBlt(FOutput.Canvas.Handle, x, y, Width, Height, Src.Canvas.Handle, 524 xSrc, ySrc, Rop); 525 DpiBitCanvas(FOutput.Canvas, x, y, Width, Height, Src.Canvas, xSrc, ySrc, Rop); 525 526 end; 526 527 527 528 procedure TIsoMap.Sprite(HGr, xDst, yDst, Width, Height, xGr, yGr: integer); 528 529 begin 529 BitBlt (GrExt[HGr].Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND);530 BitBlt (GrExt[HGr].Data, xDst, yDst, Width, Height, xGr, yGr, SRCPAINT);530 BitBltBitmap(GrExt[HGr].Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND); 531 BitBltBitmap(GrExt[HGr].Data, xDst, yDst, Width, Height, xGr, yGr, SRCPAINT); 531 532 end; 532 533 … … 561 562 exit; 562 563 563 DpiBit Blt(FOutput.Canvas.Handle, xDst, yDst, Width, Height, MaskDC, xSrc, ySrc, SRCAND);564 DpiBitCanvas(FOutput.Canvas, xDst, yDst, Width, Height, MaskCanvas, xSrc, ySrc, SRCAND); 564 565 if not PureBlack then 565 DpiBitBlt(FOutput.Canvas.Handle, xDst, yDst, Width, Height, DataDC, xSrc, ySrc, 566 SRCPAINT); 566 DpiBitCanvas(FOutput.Canvas, xDst, yDst, Width, Height, DataCanvas, xSrc, ySrc, SRCPAINT); 567 567 end; 568 568 … … 612 612 xGr := 121 + j mod 7 * 9; 613 613 yGr := 1 + j div 7 * 9; 614 BitBlt (GrExt[HGrSystem].Mask, x + xsh + 3, y + ysh + 9, 8, 8, xGr,614 BitBltBitmap(GrExt[HGrSystem].Mask, x + xsh + 3, y + ysh + 9, 8, 8, xGr, 615 615 yGr, SRCAND); 616 616 Sprite(HGrSystem, x + xsh + 2, y + ysh + 8, 8, 8, xGr, yGr); … … 620 620 if Flags and unFortified <> 0 then 621 621 begin 622 { Data DC:=GrExt[HGrTerrain].Data.Canvas.Handle;623 Mask DC:=GrExt[HGrTerrain].Mask.Canvas.Handle;622 { DataCanvas:=GrExt[HGrTerrain].Data.Canvas; 623 MaskCanvas:=GrExt[HGrTerrain].Mask.Canvas; 624 624 TSprite(x,y+16,12*9+7); } 625 625 Sprite(HGrStdUnits, x, y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1); 626 end 627 end 626 end; 627 end; 628 628 end; { PaintUnit } 629 629 … … 819 819 exit; 820 820 821 BitBlt (GrExt[HGrTerrain].Data, x + xxt div 2, y, xxt, yyt,821 BitBltBitmap(GrExt[HGrTerrain].Data, x + xxt div 2, y, xxt, yyt, 822 822 1 + (Conn shr 6 + Conn and 1 shl 2) * (xxt * 2 + 1), 823 823 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 824 BitBlt (GrExt[HGrTerrain].Data, x + xxt, y + yyt div 2, xxt, yyt,824 BitBltBitmap(GrExt[HGrTerrain].Data, x + xxt, y + yyt div 2, xxt, yyt, 825 825 1 + (Conn and 7) * (xxt * 2 + 1) + xxt, 826 826 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 827 BitBlt (GrExt[HGrTerrain].Data, x + xxt div 2, y + yyt, xxt, yyt,827 BitBltBitmap(GrExt[HGrTerrain].Data, x + xxt div 2, y + yyt, xxt, yyt, 828 828 1 + (Conn shr 2 and 7) * (xxt * 2 + 1) + xxt, 829 829 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 830 BitBlt (GrExt[HGrTerrain].Data, x, y + yyt div 2, xxt, yyt,830 BitBltBitmap(GrExt[HGrTerrain].Data, x, y + yyt div 2, xxt, yyt, 831 831 1 + (Conn shr 4 and 7) * (xxt * 2 + 1), 832 832 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 833 833 Conn := Connection4(Loc, fTerrain, fUNKNOWN); { dither to black } 834 834 if Conn and 1 <> 0 then 835 BitBlt (GrExt[HGrTerrain].Mask, x + xxt, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) +835 BitBltBitmap(GrExt[HGrTerrain].Mask, x + xxt, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) + 836 836 xxt, 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 837 837 if Conn and 2 <> 0 then 838 BitBlt (GrExt[HGrTerrain].Mask, x + xxt, y + yyt, xxt, yyt,838 BitBltBitmap(GrExt[HGrTerrain].Mask, x + xxt, y + yyt, xxt, yyt, 839 839 1 + 7 * (xxt * 2 + 1) + xxt, 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 840 840 if Conn and 4 <> 0 then 841 BitBlt (GrExt[HGrTerrain].Mask, x, y + yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1),841 BitBltBitmap(GrExt[HGrTerrain].Mask, x, y + yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 842 842 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 843 843 if Conn and 8 <> 0 then 844 BitBlt (GrExt[HGrTerrain].Mask, x, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1),844 BitBltBitmap(GrExt[HGrTerrain].Mask, x, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 845 845 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 846 846 end; … … 876 876 end 877 877 else if Tile and fDeadLands <> 0 then 878 TSprite(x, y, sp DeadLands);878 TSprite(x, y, spRow2); 879 879 880 880 if ShowObjects then … … 898 898 for Dir := 0 to 3 do 899 899 if Conn and (1 shl Dir) <> 0 then { river mouths } 900 TSprite(x, y, 15 * TerrainIconCols + Dir);900 TSprite(x, y, spRiverMouths + Dir); 901 901 if ShowObjects then 902 902 begin … … 904 904 for Dir := 0 to 7 do 905 905 if Conn and (1 shl Dir) <> 0 then { canal mouths } 906 TSprite(x, y, 20 * TerrainIconCols + 1 + Dir);906 TSprite(x, y, spCanalMouths + 1 + Dir); 907 907 end 908 908 end; … … 1007 1007 if BordersOK and (1 shl p1) = 0 then 1008 1008 begin 1009 // Clearing before bitbltSRCCOPY shouldn't be neccesary but for some1009 // Clearing before BitBltBitmap SRCCOPY shouldn't be neccesary but for some 1010 1010 // reason without it code works different then under Delphi 1011 1011 Borders.Canvas.FillRect(Bounds(0, p1 * (yyt * 2), xxt * 2, yyt * 2)); 1012 1012 1013 DpiBit Blt(Borders.Canvas.Handle, 0, p1 * (yyt * 2), xxt * 2,1014 yyt * 2, GrExt[HGrTerrain].Data.Canvas .Handle,1015 1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1) , SRCCOPY);1013 DpiBitCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2, 1014 yyt * 2, GrExt[HGrTerrain].Data.Canvas, 1015 1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1)); 1016 1016 Borders.BeginUpdate; 1017 1017 for dy := 0 to yyt * 2 - 1 do 1018 1018 begin 1019 PixelPtr .Init(Borders, 0, p1 * (yyt * 2) + dy);1019 PixelPtr := PixelPointer(Borders, 0, p1 * (yyt * 2) + dy); 1020 1020 for dx := 0 to xxt * 2 - 1 do begin 1021 1021 if PixelPtr.Pixel^.B = 99 then begin … … 1043 1043 if p2 <> p1 then 1044 1044 begin 1045 BitBlt (GrExt[HGrTerrain].Mask, x + dx * xxt, y + dy * yyt, xxt,1045 BitBltBitmap(GrExt[HGrTerrain].Mask, x + dx * xxt, y + dy * yyt, xxt, 1046 1046 yyt, 1 + 8 * (xxt * 2 + 1) + dx * xxt, 1047 1047 1 + yyt + 16 * (yyt * 3 + 1) + dy * yyt, SRCAND); 1048 BitBlt (Borders, x + dx * xxt, y + dy * yyt, xxt, yyt, dx * xxt,1048 BitBltBitmap(Borders, x + dx * xxt, y + dy * yyt, xxt, yyt, dx * xxt, 1049 1049 p1 * (yyt * 2) + dy * yyt, SRCPAINT); 1050 1050 end … … 1112 1112 end; 1113 1113 end; 1114 if Tile and fDeadLands<> 0 then1115 TSprite(x, y, (12 + Tile shr 25 and 3) * TerrainIconCols + 8);1114 if (Tile and fDeadLands) <> 0 then 1115 TSprite(x, y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols); 1116 1116 1117 1117 if Options and (1 shl moEditMode) <> 0 then … … 1131 1131 1 + yyt + 15 * (yyt * 3 + 1)) 1132 1132 else 1133 TSprite(x, y, 6 + TerrainIconCols * 15, xxt <> 33);1133 TSprite(x, y, spGrid, xxt <> 33); 1134 1134 1135 1135 if FoW and (Tile and fObserved = 0) then … … 1340 1340 FOutput.BeginUpdate; 1341 1341 for y := y0 to y1 - 1 do begin 1342 Line .Init(FOutput, 0, y);1342 Line := PixelPointer(FOutput, 0, y); 1343 1343 y_n := (y - ym) / yyt; 1344 1344 if abs(y_n) < rShade then begin … … 1487 1487 bix := 0 1488 1488 end; 1489 BitBlt (OceanPatch, x + dx * xxt, y + dy * yyt, xxt, yyt,1489 BitBltBitmap(OceanPatch, x + dx * xxt, y + dy * yyt, xxt, yyt, 1490 1490 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY) 1491 1491 end … … 1535 1535 bix := Aix; 1536 1536 if Aix = -1 then 1537 BitBlt (GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt,1537 BitBltBitmap(GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt, 1538 1538 yyt, 1 + 6 * (xxt * 2 + 1) + (dx + dy + 1) and 1 * xxt, 1 + yyt, 1539 1539 SRCCOPY) // arctic <-> ocean 1540 1540 else if bix = -1 then 1541 BitBlt (GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt,1541 BitBltBitmap(GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt, 1542 1542 yyt, 1 + 6 * (xxt * 2 + 1) + xxt - (dx + dy + 1) and 1 * xxt, 1543 1543 1 + yyt * 2, SRCCOPY) // arctic <-> ocean 1544 1544 else 1545 BitBlt (LandPatch, x + dx * xxt, y + dy * yyt, xxt, yyt,1545 BitBltBitmap(LandPatch, x + dx * xxt, y + dy * yyt, xxt, yyt, 1546 1546 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY) 1547 1547 end 1548 1548 end; 1549 1549 1550 Data DC := GrExt[HGrTerrain].Data.Canvas.Handle;1551 Mask DC := GrExt[HGrTerrain].Mask.Canvas.Handle;1550 DataCanvas := GrExt[HGrTerrain].Data.Canvas; 1551 MaskCanvas := GrExt[HGrTerrain].Mask.Canvas; 1552 1552 for dy := -2 to ny + 1 do 1553 1553 for dx := -1 to nx do
Note:
See TracChangeset
for help on using the changeset viewer.