Commit 238a21ec authored by Jesse Freeman's avatar Jesse Freeman

Modifications to TextureData x axis calculation (issue #1) and replace...

Modifications to TextureData x axis calculation (issue #1) and replace Array.ConvertAll for Windows UAP support (issue #2).
parent 5dfa71dc
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
// //
using System; using System;
using System.Linq;
using System.Text; using System.Text;
using PixelVisionSDK.Engine.Utils; using PixelVisionSDK.Engine.Utils;
...@@ -228,7 +229,7 @@ namespace PixelVisionSDK.Engine.Chips.Data ...@@ -228,7 +229,7 @@ namespace PixelVisionSDK.Engine.Chips.Data
return; return;
} }
var index = x + width * y; var index = (x % width) + (width * y);
if (index < 0) if (index < 0)
return; return;
...@@ -400,7 +401,8 @@ namespace PixelVisionSDK.Engine.Chips.Data ...@@ -400,7 +401,8 @@ namespace PixelVisionSDK.Engine.Chips.Data
sb.Append(Convert.ToInt32(wrapMode)); sb.Append(Convert.ToInt32(wrapMode));
sb.Append(","); sb.Append(",");
sb.Append("\"spriteIDs\":[" + string.Join(",", Array.ConvertAll(pixels, x => x.ToString())) + "]"); sb.Append("\"spriteIDs\":[" + string.Join(",", pixels.Select (x => x.ToString()).ToArray()) + "]");
} }
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using PixelVisionSDK.Engine.Utils; using PixelVisionSDK.Engine.Utils;
...@@ -95,7 +96,7 @@ namespace PixelVisionSDK.Engine.Chips.Data ...@@ -95,7 +96,7 @@ namespace PixelVisionSDK.Engine.Chips.Data
sb.Append("\"notes\":["); sb.Append("\"notes\":[");
sb.Append(string.Join(",", Array.ConvertAll(notes, i => i.ToString()))); sb.Append(string.Join(",", notes.Select(x => x.ToString()).ToArray()));
sb.Append("]"); sb.Append("]");
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using PixelVisionSDK.Engine.Chips.Data; using PixelVisionSDK.Engine.Chips.Data;
using PixelVisionSDK.Engine.Utils; using PixelVisionSDK.Engine.Utils;
...@@ -97,9 +98,10 @@ namespace PixelVisionSDK.Engine.Chips.Graphics.Sprites ...@@ -97,9 +98,10 @@ namespace PixelVisionSDK.Engine.Chips.Graphics.Sprites
sb.Append(","); sb.Append(",");
sb.Append("\"spriteIDs\":[" + string.Join(",", Array.ConvertAll(spriteIDs, x => x.ToString())) + "],"); sb.Append("\"spriteIDs\":[" + string.Join(",", spriteIDs.Select(x => x.ToString()).ToArray()) + "],");
sb.Append("\"paletteIDs\":[" + string.Join(",", Array.ConvertAll(paletteIDs, x => x.ToString())) + "],"); sb.Append("\"paletteIDs\":[" + string.Join(",", paletteIDs.Select(x => x.ToString()).ToArray()) + "],");
sb.Append("\"flags\":[" + string.Join(",", Array.ConvertAll(flags, x => x.ToString())) + "]"); sb.Append("\"flags\":[" + string.Join(",", flags.Select(x => x.ToString()).ToArray()) + "]");
} }
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
// //
using System; using System;
using System.Linq;
using PixelVisionSDK.Engine.Chips; using PixelVisionSDK.Engine.Chips;
using PixelVisionSDK.Engine.Chips.Data; using PixelVisionSDK.Engine.Chips.Data;
...@@ -164,7 +165,7 @@ namespace PixelVisionSDK.Engine.Utils ...@@ -164,7 +165,7 @@ namespace PixelVisionSDK.Engine.Utils
/// </returns> /// </returns>
public static string SpriteDataToString(int[] data) public static string SpriteDataToString(int[] data)
{ {
return string.Join(",", Array.ConvertAll(data, x => x.ToString())); return string.Join(",", data.Select(x => x.ToString()).ToArray());
} }
public static void ShiftPixelData(ref int[] pixelData, int offset, int emptyColorID = -1) public static void ShiftPixelData(ref int[] pixelData, int offset, int emptyColorID = -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment