Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Cleaning up the max sprite API and NewCanvas API().
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed Dec 14, 2019
1 parent b41d9cc commit d94b952
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Runners/PixelVision8/Runner/Editors/GameEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public int ColorsPerSprite()
/// <returns></returns>
public int MaxSpriteCount(int? total)
{
if (total.HasValue) gameChip.MaxSpriteCount(total.Value);
if (total.HasValue) targetGame.spriteChip.maxSpriteCount = total.Value;

return gameChip.MaxSpriteCount();
}
Expand Down
4 changes: 2 additions & 2 deletions SDK/Engine/Chips/Game/GameChip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,9 +1502,9 @@ public int TotalSprites(bool ignoreEmpty = true)
/// </summary>
/// <param name="total"></param>
/// <returns>Returns an int representing the total number of sprites on the screen at once.</returns>
public int MaxSpriteCount(int? total = null)
public int MaxSpriteCount()
{
if (total.HasValue) spriteChip.maxSpriteCount = total.Value;
// if (total.HasValue) spriteChip.maxSpriteCount = total.Value;

return spriteChip.maxSpriteCount;
}
Expand Down
2 changes: 2 additions & 0 deletions SDK/Engine/Chips/Game/LuaGameChip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public override void Reset()
luaScript.Globals["PlaySound"] = new Action<int, int>(PlaySound);
luaScript.Globals["PlayRawSound"] = new Action<string, int, float>(soundChip.PlayRawSound);

luaScript.Globals["IsChannelPlaying"] = new Func<int, bool>(IsChannelPlaying);
luaScript.Globals["PlayPattern"] = new Action<int, bool>(PlayPattern);
luaScript.Globals["PlayPatterns"] = new Action<int[], bool>(PlayPatterns);
luaScript.Globals["PlaySong"] = new Action<int, bool, int>(PlaySong);
Expand All @@ -189,6 +190,7 @@ public override void Reset()
luaScript.Globals["Sprites"] = new Func<int[], int, int[]>(Sprites);
luaScript.Globals["SpriteSize"] = new Func<int?, int?, Point>(SpriteSize);
luaScript.Globals["TotalSprites"] = new Func<bool, int>(TotalSprites);
luaScript.Globals["MaxSpriteCount"] = new Func<int>(MaxSpriteCount);

#endregion

Expand Down
6 changes: 3 additions & 3 deletions SDK/Engine/Data/Canvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public Canvas(int width, int height, GameChip gameChip = null) : base(width, hei
spriteSize = gameChip.SpriteSize();
}

public void LinePattern(int a, int b)
public void LinePattern(int x, int y)
{
linePattern.X = a;
linePattern.Y = b;
linePattern.X = x;
linePattern.Y = y;
}

public bool DrawCentered(bool? newValue = null)
Expand Down

0 comments on commit d94b952

Please sign in to comment.