Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
csinkers committed Nov 29, 2023
1 parent 617839d commit 8ab4645
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Config/AssetNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public T GetProperty<T>(IAssetProperty<T> assetProperty, T defaultValue)
}

/// <summary>
/// Set's a property by name
/// Sets a property by name
/// </summary>
/// <param name="assetProperty">The property</param>
/// <param name="value">The value to set the property to</param>
Expand Down Expand Up @@ -148,4 +148,4 @@ public void SetProperties(IReadOnlyDictionary<string, JsonElement> dict, TypeCon
public int Width => GetProperty(AssetProps.Width); // The default width, in pixels, of frames in images inside the file. For sprites only.
public int Height => GetProperty(AssetProps.Height); // The default height, in pixels, of frames in images inside the file. For sprites only.
public AssetId PaletteId => GetProperty(AssetProps.Palette); // for providing context when exporting 8-bit images to true-colour PNGs
}
}
2 changes: 1 addition & 1 deletion src/Config/PathResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void RegisterPath(string name, string path)
if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException(nameof(path));
Paths[name] = path;
}

public string ResolvePathAbsolute(string relative)
{
var path = ResolvePath(relative);
Expand Down
5 changes: 3 additions & 2 deletions src/Game/PaletteManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public float Blend
if (state == null || Night == null)
return 0;

return MathF.Cos((float)state.Time.TimeOfDay.TotalDays * MathF.PI * 2 * 60) * 0.5f + 0.5f;
var daysElapsed = (float)state.Time.TimeOfDay.TotalDays; // how far through the day we are (0..1)
return MathF.Cos(daysElapsed * MathF.PI * 2) * 0.5f + 0.5f;
}
}

Expand Down Expand Up @@ -71,4 +72,4 @@ void SetPalette(PaletteId paletteId)
$"Night palette {Night.Id} had entries [ {string.Join(", ", Night.AnimatedEntries)} ]");
}
}
}
}
2 changes: 1 addition & 1 deletion src/UAlbion/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CommandLineOptions(string[] args)
if (arg is "--ISO" or "-ISO") Mode = ExecutionMode.BakeIsometric;
if (arg is "--CONVERT" or "--BUILD" or "-B")
{
if (i +2 >= args.Length)
if (i + 2 >= args.Length)
throw new FormatException("\"--convert\" requires two parameters: the mod to convert from and the mod to convert to");
ConvertFrom = args[++i].Split(' ', StringSplitOptions.RemoveEmptyEntries);
ConvertTo = args[++i];
Expand Down

0 comments on commit 8ab4645

Please sign in to comment.