Skip to content

Commit

Permalink
Fix bugs related to lighting
Browse files Browse the repository at this point in the history
- Fix light posts affecting cell lighting even in "No Lighting" state
- Fix lighting affecting refreshed cells in marble madness mode
  • Loading branch information
Rampastring committed Jun 23, 2024
1 parent 6a02c64 commit fd2f4e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TSMapEditor/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace TSMapEditor
{
public static class Constants
{
public const string ReleaseVersion = "1.1.2";
public const string ReleaseVersion = "1.1.3";

public static int CellSizeX = 48;
public static int CellSizeY = 24;
Expand Down
6 changes: 6 additions & 0 deletions src/TSMapEditor/Models/MapTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public MapTile(byte[] data) : base(data) { }

public void RefreshLighting(Lighting lighting, LightingPreviewMode lightingPreviewMode)
{
if (lightingPreviewMode == LightingPreviewMode.NoLighting)
{
CellLighting = new MapColor(1.0, 1.0, 1.0);
return;
}

double globalAmbient = lighting.GetAmbientComponent(lightingPreviewMode);
double globalLevel = lighting.GetLevelComponent(lightingPreviewMode);
double globalGround = lighting.GetGroundComponent(lightingPreviewMode);
Expand Down
2 changes: 1 addition & 1 deletion src/TSMapEditor/Rendering/MapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public MapView(WindowManager windowManager, Map map, TheaterGraphics theaterGrap
public BrushSize BrushSize { get => EditorState.BrushSize; set => EditorState.BrushSize = value; }
public bool Is2DMode => EditorState.Is2DMode;
public DeletionMode DeletionMode => EditorState.DeletionMode;
public LightingPreviewMode LightingPreviewState => EditorState.LightingPreviewState;
public LightingPreviewMode LightingPreviewState => EditorState.IsLighting ? LightingPreviewMode.NoLighting : EditorState.LightingPreviewState;
public Randomizer Randomizer => EditorState.Randomizer;
public bool AutoLATEnabled => EditorState.AutoLATEnabled;
public bool OnlyPaintOnClearGround => EditorState.OnlyPaintOnClearGround;
Expand Down

0 comments on commit fd2f4e0

Please sign in to comment.