From a7c74c114ed50261567149118c3558124b657aaf Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 21 Dec 2009 00:55:19 +0100 Subject: [PATCH] - Fixed light source placement - Removed unnecessary texturemanager reference --- Client/ULightManager.pas | 13 +++---------- Client/UfrmMain.pas | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Client/ULightManager.pas b/Client/ULightManager.pas index aed5884..6add2ec 100644 --- a/Client/ULightManager.pas +++ b/Client/ULightManager.pas @@ -83,8 +83,7 @@ type { TLightManager } TLightManager = class - constructor Create(ACalculateOffset: TCalculateOffset; - ALandTextureManager: TLandTextureManager); + constructor Create(ACalculateOffset: TCalculateOffset); destructor Destroy; override; protected FLightSources: TLightSources; @@ -94,7 +93,6 @@ type FValid: Boolean; FCalculateOffset: TCalculateOffset; FLightCache: TLightCache; - FLandTextureManager: TLandTextureManager; function GetLight(AID: Integer): TLightMaterial; procedure UpdateOverlay(AScreenRect: TRect); public @@ -110,14 +108,12 @@ uses { TLightManager } -constructor TLightManager.Create(ACalculateOffset: TCalculateOffset; - ALandTextureManager: TLandTextureManager); +constructor TLightManager.Create(ACalculateOffset: TCalculateOffset); begin FCalculateOffset := ACalculateOffset; FLightSources := TLightSources.Create(True); FLightLevel := 15; //TODO : 0 ... FLightCache := TLightCache.Create(32); - FLandTextureManager := ALandTextureManager; end; destructor TLightManager.Destroy; @@ -262,17 +258,14 @@ end; constructor TLightSource.Create(AManager: TLightManager; AWorldItem: TWorldItem); var lightID: Byte; - itemMaterial: TMaterial; begin lightID := ResMan.Tiledata.StaticTiles[AWorldItem.TileID].Quality; FMaterial := AManager.GetLight(lightID); if FMaterial <> nil then begin - itemMaterial := AManager.FLandTextureManager.GetStaticMaterial( - TStaticItem(AWorldItem)); AManager.FCalculateOffset(AWorldItem.X, AWorldItem.Y, FX, FY); FZ := AWorldItem.Z * 4; - FY := FY + 44 - FZ - itemMaterial.RealHeight div 2; + FY := FY + 22 - FZ; FMaterial.AddRef; end; end; diff --git a/Client/UfrmMain.pas b/Client/UfrmMain.pas index 12b3055..40cfd5a 100644 --- a/Client/UfrmMain.pas +++ b/Client/UfrmMain.pas @@ -892,7 +892,7 @@ begin edX.MaxValue := FLandscape.CellWidth; edY.MaxValue := FLandscape.CellHeight; FOverlayUI := TOverlayUI.Create; - FLightManager := TLightManager.Create(@GetDrawOffset, FTextureManager); + FLightManager := TLightManager.Create(@GetDrawOffset); ProcessAccessLevel;