- Added static ghost tiles

This commit is contained in:
Andreas Schneider 2009-12-04 01:27:06 +01:00
parent be9d56f7c9
commit fda2be2b8c
1 changed files with 20 additions and 9 deletions

View File

@ -2280,6 +2280,7 @@ procedure TfrmMain.UpdateSelection;
tileInfo: PTileInfo; tileInfo: PTileInfo;
node: PVirtualNode; node: PVirtualNode;
cell: TMapCell; cell: TMapCell;
ghostTile: TGhostTile;
i: Integer; i: Integer;
begin begin
tileInfo := nil; tileInfo := nil;
@ -2308,12 +2309,6 @@ procedure TfrmMain.UpdateSelection;
begin begin
cell.IsGhost := True; cell.IsGhost := True;
cell.GhostID := tileInfo^.ID; cell.GhostID := tileInfo^.ID;
{if (FGhostTile is TStaticItem) and (not frmDrawSettings.cbForceAltitude.Checked) then
begin
FGhostTile.Z := CurrentTile.Z;
if CurrentTile is TStaticItem then
Inc(FGhostTile.Z, ResMan.Tiledata.StaticTiles[CurrentTile.TileID].Height);
end else}
if frmDrawSettings.cbForceAltitude.Checked then if frmDrawSettings.cbForceAltitude.Checked then
cell.GhostZ := frmDrawSettings.seForceAltitude.Value cell.GhostZ := frmDrawSettings.seForceAltitude.Value
else else
@ -2323,9 +2318,25 @@ procedure TfrmMain.UpdateSelection;
end; end;
end else end else
begin begin
{FGhostTile := TStaticItem.Create(nil, nil, 0, 0); ghostTile := TGhostTile.Create(nil, nil, 0, 0);
FGhostTile.TileID := tileInfo^.ID - $4000; ghostTile.TileID := tileInfo^.ID - $4000;
TStaticItem(FGhostTile).Hue := frmHueSettings.lbHue.ItemIndex;} ghostTile.Hue := frmHueSettings.lbHue.ItemIndex;
ghostTile.X := AX;
ghostTile.Y := AY;
if not frmDrawSettings.cbForceAltitude.Checked then
begin
ghostTile.Z := CurrentTile.Z;
if CurrentTile is TStaticItem then
ghostTile.Z := ghostTile.Z +
ResMan.Tiledata.StaticTiles[CurrentTile.TileID].Height;
end else
ghostTile.Z := frmDrawSettings.seForceAltitude.Value;
ghostTile.PrioritySolver := MaxInt;
FVirtualTiles.Add(ghostTile);
blockInfo := FScreenBuffer.Insert(ghostTile);
blockInfo^.State := ssGhost;
PrepareScreenBlock(blockInfo);
end; end;
end; end;