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

Commit

Permalink
Continuing to seporate our core PV8 classes from MonoGame to be indpe…
Browse files Browse the repository at this point in the history
…ndant.
  • Loading branch information
jessefreeman committed Mar 21, 2021
1 parent 2d2e449 commit 7d2c5e4
Show file tree
Hide file tree
Showing 39 changed files with 343 additions and 404 deletions.
20 changes: 9 additions & 11 deletions Projects/PixelVision8/PixelVision8.CoreDesktop.csproj
Expand Up @@ -180,6 +180,9 @@
<Compile Include="..\..\SDK\Runner\Parsers\SystemParser.TilemapChip.cs">
<Link>SDK\Runner\Parsers\SystemParser.TilemapChip.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Runner\Utils\ColorUtils.MonoGame.cs">
<Link>SDK\Runner\Utils\ColorUtils.MonoGame.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="..\..\SDK\Editor\Audio\SfxrMusicGeneratorChip.cs">
<Link>SDK\Editor\Audio\SfxrMusicGeneratorChip.cs</Link>
Expand Down Expand Up @@ -358,17 +361,17 @@
<Compile Include="..\..\SDK\Player\Chips\IDraw.cs">
<Link>SDK\Player\Chips\IDraw.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\ControllerChip.cs">
<Link>SDK\Player\Chips\Input\ControllerChip.cs</Link>
<Compile Include="..\..\SDK\Player\Chips\Input\ControllerChip.MonogGame.cs">
<Link>SDK\Player\Chips\Input\ControllerChip.MonogGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\InputMap.cs">
<Link>SDK\Player\Chips\Input\InputMap.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\KeyboardInputChip.cs">
<Link>SDK\Player\Chips\Input\KeyboardInputChip.cs</Link>
<Compile Include="..\..\SDK\Player\Chips\Input\KeyboardInputChip.MonoGame.cs">
<Link>SDK\Player\Chips\Input\KeyboardInputChip.MonoGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\MouseInputChip.cs">
<Link>SDK\Player\Chips\Input\MouseInputChip.cs</Link>
<Compile Include="..\..\SDK\Player\Chips\Input\MouseInputChip.MonoGame.cs">
<Link>SDK\Player\Chips\Input\MouseInputChip.MonoGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\IUpdate.cs">
<Link>SDK\Player\Chips\IUpdate.cs</Link>
Expand Down Expand Up @@ -1244,10 +1247,5 @@
<None Remove="..\..\SDK\MonoVision\Platform\Graphics\Effect\Resources\**" />
<None Remove="..\..\SDK\MonoVision\Dependencies\**" />
</ItemGroup>
<ItemGroup>
<Folder Include="..\..\SDK\Player\Chips\Audio\Sfxr">
<Link>SDK\Player\Chips\Audio\Sfxr</Link>
</Folder>
</ItemGroup>

</Project>
21 changes: 12 additions & 9 deletions Projects/PixelVision8Lite/PixelVision8Lite.CoreDesktop.csproj
Expand Up @@ -145,6 +145,15 @@
<Compile Include="..\..\SDK\Player\Chips\Audio\SoundChannel.MonoGame.cs">
<Link>SDK\Player\Chips\Audio\SoundChannel.MonoGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\ControllerChip.MonogGame.cs">
<Link>SDK\Player\Chips\Input\ControllerChip.MonogGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\KeyboardInputChip.MonoGame.cs">
<Link>SDK\Player\Chips\Input\KeyboardInputChip.MonoGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\MouseInputChip.MonoGame.cs">
<Link>SDK\Player\Chips\Input\MouseInputChip.MonoGame.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Data\Point.cs">
<Link>SDK\Player\Data\Point.cs</Link>
</Compile>
Expand Down Expand Up @@ -252,15 +261,6 @@
<Compile Include="../../SDK/Player/Chips/IDraw.cs">
<Link>SDK/Player/Chips/IDraw.cs</Link>
</Compile>
<Compile Include="../../SDK/Player/Chips/Input/ControllerChip.cs">
<Link>SDK/Player/Chips/Input/ControllerChip.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\KeyboardInputChip.cs">
<Link>SDK/Player/Chips/Input/KeyboardInputChip.cs</Link>
</Compile>
<Compile Include="..\..\SDK\Player\Chips\Input\MouseInputChip.cs">
<Link>SDK/Player/Chips/Input/MouseInputChip.cs</Link>
</Compile>

<Compile Include="../../SDK/Player/Chips/IUpdate.cs">
<Link>SDK/Player/Chips/IUpdate.cs</Link>
Expand Down Expand Up @@ -325,6 +325,9 @@

<!-- Core Classes -->
<ItemGroup>
<Compile Include="..\..\SDK\Runner\Utils\ColorUtils.MonoGame.cs">
<Link>SDK\Runner\Utils\ColorUtils.MonoGame.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="../../SDK/Runner/Data/DisplayTarget.cs">
<Link>SDK/Runner/Data/DisplayTarget.cs</Link>
Expand Down
2 changes: 1 addition & 1 deletion SDK/Editor/Exporters/ColorPaletteExporter.cs
Expand Up @@ -101,7 +101,7 @@ public void Dispose()

public virtual void ConfigureColors()
{
colors = DisplayTarget.ConvertColors(colorChip.HexColors, colorChip.MaskColor, true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();
colors = ColorUtils.ConvertColors(colorChip.HexColors, colorChip.MaskColor, true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();
//
// colorChip.colors;
total = colors.Length;
Expand Down
2 changes: 1 addition & 1 deletion SDK/Editor/Exporters/GifExporter.cs
Expand Up @@ -102,7 +102,7 @@ public ColorData[] VisiblePixels()
// TODO there might be a better way to do this like grabbing the pixel data from somewhere else?
var pixels = DisplayChip.Pixels;

var cachedColors = DisplayTarget.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor,
var cachedColors = ColorUtils.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor,
engine.ColorChip.DebugMode, engine.ColorChip.BackgroundColor).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();

// var cachedColors = engine.ColorChip.colors;
Expand Down
2 changes: 1 addition & 1 deletion SDK/Editor/Exporters/SpriteExporter.cs
Expand Up @@ -48,7 +48,7 @@ public class SpriteExporter : IExporter

// var colorMapChip = engine.GetChip(ColorMapParser.chipName, false) as ColorChip;

colors = DisplayTarget.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor, true).Select(c=>new ColorData(c.R, c.G, c.B)).ToArray();
colors = ColorUtils.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor, true).Select(c=>new ColorData(c.R, c.G, c.B)).ToArray();

// TODO removing the color map chip dependency when exporting moving forward
// colors = colorMapChip == null ? engine.ColorChip.colors : colorMapChip.colors;
Expand Down
2 changes: 1 addition & 1 deletion SDK/Editor/Services/GameDataExportService.cs
Expand Up @@ -137,7 +137,7 @@ public void ExportImage(string path, int[] pixelData, PixelVision engine, int wi
var imageExporter = new PNGWriter();

// TODO need to double check that we should force this into debug so transparent images have the mask color in them by default
var colors = DisplayTarget.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor, true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();
var colors = ColorUtils.ConvertColors(engine.ColorChip.HexColors, engine.ColorChip.MaskColor, true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();


AddExporter(new PixelDataExporter(path, pixelData, width, height, colors, imageExporter,
Expand Down
2 changes: 1 addition & 1 deletion SDK/Editor/Services/ScreenshotService.cs
Expand Up @@ -100,7 +100,7 @@ public bool TakeScreenshot(PixelVision engine)
{
// var cachedColors = engine.ColorChip.colors;

var cachedColors = DisplayTarget.ConvertColors(engine.ColorChip.HexColors, "#FF00FF", true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();
var cachedColors = ColorUtils.ConvertColors(engine.ColorChip.HexColors, "#FF00FF", true).Select(c=> new ColorData(c.R, c.G, c.B)).ToArray();

var pixels = engine.DisplayChip.Pixels;

Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Chips/Game/LuaGameChip.Debug.cs
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;

namespace PixelVision8.Player
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Chips/Game/LuaGameChip.Math.cs
@@ -1,5 +1,4 @@
using System;
using Microsoft.Xna.Framework.Input;

namespace PixelVision8.Player
{
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Chips/Game/LuaGameChip.Sound.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;
using MoonSharp.Interpreter;
using PixelVision8.Player;

namespace PixelVision8.Player
{
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Chips/Game/LuaGameChip.Sprites.cs
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;
using MoonSharp.Interpreter;

namespace PixelVision8.Player
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Chips/Game/LuaGameChip.Tilemap.cs
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;
using MoonSharp.Interpreter;

namespace PixelVision8.Player
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Chips/Game/LuaGameChip.Utils.cs
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;

namespace PixelVision8.Player
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Boot.cs
@@ -1,6 +1,5 @@
using System;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Debug.cs
@@ -1,6 +1,5 @@
using System;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Disks.cs
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Services/LuaService.Editor.cs
@@ -1,7 +1,5 @@
using System;
using MoonSharp.Interpreter;
using PixelVision8.Editor;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Export.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Services/LuaService.Input.cs
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Load.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using MoonSharp.Interpreter;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
2 changes: 0 additions & 2 deletions SDK/Lua/Services/LuaService.Preload.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using MoonSharp.Interpreter;
using PixelVision8.Player;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.SystemIO.cs
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Xna.Framework;
using MoonSharp.Interpreter;
using PixelVision8.Editor;
using PixelVision8.Player;
Expand Down
1 change: 0 additions & 1 deletion SDK/Lua/Services/LuaService.Threading.cs
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using MoonSharp.Interpreter;
using PixelVision8.Editor;
using PixelVision8.Workspace;

namespace PixelVision8.Runner
{
Expand Down
7 changes: 1 addition & 6 deletions SDK/Player/Chips/Game/GameChip.Sound.cs
Expand Up @@ -41,12 +41,7 @@ public void PlaySound(int id, int channel = 0)
{
SoundChip.PlaySound(id, channel);
}

public void PlaySample(string name, int channel = 0)
{
SoundChip.PlaySound(name, channel);
}


/// <summary>
/// Use StopSound() to stop any sound playing on a specific channel.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion SDK/Player/Data/SoundData.Sfxr.cs
Expand Up @@ -19,7 +19,6 @@
//

using System;
using PixelVision8.Workspace;

namespace PixelVision8.Player
{
Expand Down
1 change: 0 additions & 1 deletion SDK/Player/Data/TrackerData.cs
Expand Up @@ -19,7 +19,6 @@
//

using System;
using System.Text;

namespace PixelVision8.Player
{
Expand Down

0 comments on commit 7d2c5e4

Please sign in to comment.