From 446e10403111d4eda7f1e388b4698dbb61310dad Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 8 Dec 2009 15:30:53 +0100 Subject: [PATCH] - Made ULandscape.GetID inline - Removed some constraints on TileIDs and map coordinates - Removed another unnecessary typecast --- Client/ULandscape.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index 82e639b..330ad84 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -271,9 +271,9 @@ implementation uses UGameResources, UdmNetwork, UPackets, UPacketHandlers, Logging; -function GetID(AX, AY: Word): Integer; +function GetID(AX, AY: Word): Integer; inline; begin - Result := ((AX and $7FFF) shl 15) or (AY and $7FFF); + Result := (AX shl 16) or AY; end; { TLandTextureManager } @@ -321,7 +321,7 @@ begin Result := GetArtMaterial(ATileID); end else begin - id := ATileID or ((AHue.ID and $3FFF) shl 15) or (Byte(APartialHue) shl 29); + id := ATileID or ((AHue.ID and $3FFF) shl 16) or (Byte(APartialHue) shl 30); if not FArtCache.QueryID(id, Result) then begin artEntry := ResMan.Art.GetArt(ATileID, 0, AHue, APartialHue); @@ -511,7 +511,7 @@ begin for i := 0 to FStaticBlock.Items.Count - 1 do begin - staticItem := TStaticItem(FStaticBlock.Items[i]); + staticItem := FStaticBlock.Items[i]; staticItem.CanBeEdited := ALandscape.CanWrite(staticItem.X, staticItem.Y); end;