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

Commit

Permalink
Refactoring codebase, breaking up logic across multiple partial class…
Browse files Browse the repository at this point in the history
…es and restructuring to make pure C# projects easier to work with.
  • Loading branch information
jessefreeman committed Jan 25, 2021
1 parent 2729917 commit 92a2b17
Show file tree
Hide file tree
Showing 156 changed files with 10,201 additions and 10,111 deletions.
49 changes: 29 additions & 20 deletions Disks/APIExamples/BackgroundColor/code.cs
@@ -1,43 +1,52 @@
/**
Pixel Vision 8 - BackgroundColor Example
Pixel Vision 8 - BackgroundColor() Example
Copyright (C) 2017, Pixel Vision 8 (http://pixelvision8.com)
Created by Jesse Freeman (@jessefreeman)
Learn more about making Pixel Vision 8 games at
https://www.pixelvision8.com/getting-started
**/

using PixelVision8.Engine.Chips;
using PixelVision8.Player;

namespace PixelVision8.Examples
{

public class ExampleGameChip : GameChip
{
public override void Init()
{
// Example Title
DrawText("BackgroundColor()", 1, 1, DrawMode.Tile, "large", 15);
DrawText("C Sharp Example", 8, 16, DrawMode.TilemapCache, "medium", 15, -4);
{

// Get the current background color
var defaultColor = BackgroundColor();
// Example Title
DrawText("BackgroundColor()", 1, 1, DrawMode.Tile, "large", 15);
DrawText("C Sharp Example", 8, 16, DrawMode.TilemapCache, "medium", 15, -4);

// Draw the default background color ID to the display
DrawText("Default Color " + defaultColor, 1, 4, DrawMode.Tile, "large", 15);
// Get the current BackgroundColor
var defaultColor = BackgroundColor();

// Here we are manually changing the background color
var newColor = BackgroundColor(2);
// Draw the default background color ID to the display
DrawText("Default Color " + defaultColor, 1, 4, DrawMode.Tile, "large", 15);

// Draw the new color ID to the display
DrawText("New Color " + newColor, 1, 6, DrawMode.Tile, "large", 15);
}
// Here we are manually changing the background color
var newColor = BackgroundColor(2);

public override void Draw()
{
//Redraw the display
RedrawDisplay();
}
// Draw the new color ID to the display
DrawText("New Color " + newColor, 1, 6, DrawMode.Tile, "large", 15);

}

/// <summary>
/// Draw() is called once per frame after the Update() has completed. This is where all visual updates to
/// your game should take place such as clearing the display, drawing sprites, and pushing raw pixel data
/// into the display.
/// </summary>
public override void Draw()
{

//Redraw the display
RedrawDisplay();

}

}
}
2 changes: 1 addition & 1 deletion Disks/APIExamples/CalculateIndex/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class CalculateIndexExample : GameChip
class ExampleGameChip : GameChip
{

// A 1D array of example values
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/CalculatePosition/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class CalculatePositionExample : GameChip
class ExampleGameChip : GameChip
{
// A 1D array of example values
private string[] exampleGrid =
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/Clamp/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class ClampExample : GameChip
class ExampleGameChip : GameChip
{

private int counter;
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/Clear/code.cs
Expand Up @@ -17,7 +17,7 @@

namespace PixelVision8.Examples
{
class ClearExample : GameChip
class ExampleGameChip : GameChip
{
// Create a new random generator
Random random = new Random();
Expand Down
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class ColorExample : GameChip
class ExampleGameChip : GameChip
{

// Create a delay and set the time to that value so it triggers right away
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/ColorsPerSprite/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class ColorsPerSpriteExample : GameChip
class ExampleGameChip : GameChip
{

// Store the CPS value
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/DrawPixels/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class DrawPixelsExample : GameChip
class ExampleGameChip : GameChip
{
int[] pixelData = {
-1, -1, -1, 0, 0, 0, 0, -1,
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/DrawRect/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class DrawRectExample : GameChip
class ExampleGameChip : GameChip
{
public override void Init()
{
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/DrawSprite/code.cs
Expand Up @@ -17,7 +17,7 @@

namespace PixelVision8.Examples
{
class DrawSprite : GameChip
class ExampleGameChip : GameChip
{
// Use floats to store the subpixel position
private float speed = 5;
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/DrawText/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class DrawTextExample : GameChip
class ExampleGameChip : GameChip
{
public override void Init()
{
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/DrawTilemap/code.cs
Expand Up @@ -16,7 +16,7 @@

namespace PixelVision8.Examples
{
class DrawTilemapExample : GameChip
class ExampleGameChip : GameChip
{
// Use floats to store the subpixel position
private float speed = 5;
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/Flag/code.cs
Expand Up @@ -17,7 +17,7 @@

namespace PixelVision8.Examples
{
class FlagExample : GameChip
class ExampleGameChip : GameChip
{
// This point will store the current tile's position
private Point tilePosition;
Expand Down
2 changes: 1 addition & 1 deletion Disks/APIExamples/InputString/code.cs
Expand Up @@ -15,7 +15,7 @@

namespace PixelVision8.Examples
{
class InputStringExample : GameChip
class ExampleGameChip : GameChip
{
// Store the text between frames
private string inputText = "";
Expand Down
7 changes: 3 additions & 4 deletions Disks/PixelVisionOS/System/Tools/ChipEditor/code.lua
Expand Up @@ -25,7 +25,6 @@ local specsLocked = false
local DrawVersion, TuneVersion = "Pixel Vision 8 Draw", "Pixel Vision 8 Tune"
local runnerName = SystemName()


-- TODO for testing
-- runnerName = TuneVersion

Expand All @@ -49,7 +48,7 @@ local waveTypeIDs = {
5
}

local waveToolTips =
local waveToolTips =
{
"Support for square wave form on this channel",
"Support for saw tooth wave form on this channel",
Expand Down Expand Up @@ -153,7 +152,7 @@ function Init()
-- Find the json editor
textEditorPath = editorMapping["json"]

local menuOptions =
local menuOptions =
{
-- About ID 1
{name = "About", action = function() pixelVisionOS:ShowAboutModal(toolName) end, toolTip = "Learn about PV8."},
Expand Down Expand Up @@ -1171,7 +1170,7 @@ function OnSave()

table.insert(flags, SaveFlags.Colors)
invalidateColors = false
end
end

if(invalidateColorMap == true) then

Expand Down
136 changes: 84 additions & 52 deletions PixelVision8.CoreDesktop.csproj
Expand Up @@ -71,52 +71,84 @@
<Compile Include="SDK\Editor\Services\LuaPlatformAccessorService.cs" />
<Compile Include="SDK\Editor\Services\ScreenshotService.cs" />
<Compile Include="SDK\Editor\Services\WorkspaceServicePlus.cs" />
<Compile Include="SDK\Engine\Chips\AbstractChip.cs" />
<Compile Include="SDK\Engine\Chips\Audio\IChannel.cs" />
<Compile Include="SDK\Engine\Chips\Audio\ISoundChip.cs" />
<Compile Include="SDK\Engine\Chips\Audio\MusicChip.cs" />
<Compile Include="SDK\Engine\Chips\Audio\Sfxr\SfxrParams.cs" />
<Compile Include="SDK\Engine\Chips\Audio\Sfxr\SfxrSoundChip.cs" />
<Compile Include="SDK\Engine\Chips\Audio\Sfxr\SfxrSynthChannel.cs" />
<Compile Include="SDK\Engine\Chips\Audio\Sfxr\SfxSoundData.cs" />
<Compile Include="SDK\Engine\Chips\Audio\SoundChannel.cs" />
<Compile Include="SDK\Engine\Chips\Audio\SoundChip.cs" />
<Compile Include="SDK\Engine\Chips\Game\GameChip.cs" />
<Compile Include="SDK\Engine\Chips\Game\GameChipLite.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\ColorChip.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\DisplayChip.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\FontChip.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\IDisplay.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\SpriteChip.cs" />
<Compile Include="SDK\Engine\Chips\Graphics\TilemapChip.cs" />
<Compile Include="SDK\Engine\Chips\IDraw.cs" />
<Compile Include="SDK\Engine\Chips\IEngineChips.cs" />
<Compile Include="SDK\Engine\Chips\Input\ControllerChip.cs" />
<Compile Include="SDK\Engine\Chips\Input\IControllerChip.cs" />
<Compile Include="SDK\Engine\Chips\IUpdate.cs" />
<Compile Include="SDK\Engine\Data\AbstractData.cs" />
<Compile Include="SDK\Engine\Data\Canvas\Canvas.cs" />
<Compile Include="SDK\Engine\Data\Canvas\CanvasDrawRequest.cs" />
<Compile Include="SDK\Engine\Data\DrawRequestPixelData.cs" />
<Compile Include="SDK\Engine\Data\PixelData.cs" />
<Compile Include="SDK\Engine\Data\SongData.cs" />
<Compile Include="SDK\Engine\Data\SoundData.cs" />
<Compile Include="SDK\Engine\Data\SpriteCollection.cs" />
<Compile Include="SDK\Engine\Data\TileData.cs" />
<Compile Include="SDK\Engine\Data\TrackData.cs" />
<Compile Include="SDK\Engine\Data\TrackerData.cs" />
<Compile Include="SDK\Engine\IEngine.cs" />
<Compile Include="SDK\Engine\PixelVisionEngine.cs" />
<Compile Include="SDK\Engine\PixelVisionEngineLite.cs" />
<Compile Include="SDK\Engine\Services\AbstractService.cs" />
<Compile Include="SDK\Engine\Services\IService.cs" />
<Compile Include="SDK\Engine\Services\IServiceLocator.cs" />
<Compile Include="SDK\Engine\Services\ServiceManager.cs" />
<Compile Include="SDK\Engine\Utils\ColorUtils.cs" />
<Compile Include="SDK\Engine\Utils\MathUtil.cs" />
<Compile Include="SDK\Engine\Utils\PixelDataUtil.cs" />
<Compile Include="SDK\Engine\Utils\SpriteChipUtil.cs" />
<Compile Include="SDK\Lua\Chips\Game\LuaDebugGameChip.cs" />
<Compile Include="SDK\Player\Chips\AbstractChip.cs" />
<Compile Include="SDK\Player\Chips\Audio\IChannel.cs" />
<Compile Include="SDK\Player\Chips\Audio\ISoundChip.cs" />
<Compile Include="SDK\Player\Chips\Audio\MusicChip.cs" />
<Compile Include="SDK\Player\Chips\Audio\Sfxr\SfxrParams.cs" />
<Compile Include="SDK\Player\Chips\Audio\Sfxr\SfxrSoundChip.cs" />
<Compile Include="SDK\Player\Chips\Audio\Sfxr\SfxrSynthChannel.cs" />
<Compile Include="SDK\Player\Chips\Audio\Sfxr\SfxSoundData.cs" />
<Compile Include="SDK\Player\Chips\Audio\SoundChannel.cs" />
<Compile Include="SDK\Player\Chips\Audio\SoundChip.cs" />
<Compile Include="SDK\Player\Chips\Game\Buttons.cs" />
<Compile Include="SDK\Player\Chips\Game\DrawMode.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Color.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Debug.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Display.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Input.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Math.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Misc.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Sound.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Sprite.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Text.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Tilemap.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.TilemapCache.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Factories.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.MetaSprite.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Music.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Utils.cs" />
<Compile Include="SDK\Player\Chips\Game\GameChip.Workspace.cs" />
<Compile Include="SDK\Player\Chips\Game\InputMode.cs" />
<Compile Include="SDK\Player\Chips\Graphics\ColorChip.cs" />
<Compile Include="SDK\Player\Chips\Graphics\DisplayChip.cs" />
<Compile Include="SDK\Player\Chips\Graphics\FontChip.cs" />
<Compile Include="SDK\Player\Chips\Graphics\SpriteChip.cs" />
<Compile Include="SDK\Player\Chips\Graphics\TilemapChip.cs" />
<Compile Include="SDK\Player\Chips\IDraw.cs" />
<Compile Include="SDK\Player\Chips\IPlayerChips.cs" />
<Compile Include="SDK\Player\Chips\Input\ControllerChip.Controller.cs" />
<Compile Include="SDK\Player\Chips\Input\ControllerChip.cs" />
<Compile Include="SDK\Player\Chips\Input\ControllerChip.Keyboard.cs" />
<Compile Include="SDK\Player\Chips\Input\ControllerChip.Mouse.cs" />
<Compile Include="SDK\Player\Chips\Input\IControllerChip.cs" />
<Compile Include="SDK\Player\Chips\Input\InputMap.cs" />
<Compile Include="SDK\Player\Chips\IUpdate.cs" />
<Compile Include="SDK\Player\Data\AbstractData.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas.cs" />
<Compile Include="SDK\Player\Data\Canvas\CanvasDrawRequest.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Ellipse.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_FloodFill.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Layers.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Line.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Merge.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Pattern.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Rectangle.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Resize.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Sample.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Sprite.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Stroke.cs" />
<Compile Include="SDK\Player\Data\Canvas\Canvas_Text.cs" />
<Compile Include="SDK\Player\Data\DrawRequestPixelData.cs" />
<Compile Include="SDK\Player\Data\PixelData.cs" />
<Compile Include="SDK\Player\Data\SongData.cs" />
<Compile Include="SDK\Player\Data\SoundData.cs" />
<Compile Include="SDK\Player\Data\SpriteCollection.cs" />
<Compile Include="SDK\Player\Data\TileData.cs" />
<Compile Include="SDK\Player\Data\TrackData.cs" />
<Compile Include="SDK\Player\Data\TrackerData.cs" />
<Compile Include="SDK\Player\IPlay.cs" />
<Compile Include="SDK\Player\PixelVision.Plus.cs" />
<Compile Include="SDK\Player\PixelVision.cs" />
<Compile Include="SDK\Player\Services\AbstractService.cs" />
<Compile Include="SDK\Player\Services\IService.cs" />
<Compile Include="SDK\Player\Services\IServiceLocator.cs" />
<Compile Include="SDK\Player\Services\ServiceManager.cs" />
<Compile Include="SDK\Player\Utils\Utilities.Color.cs" />
<Compile Include="SDK\Player\Utils\Utilities.Calculations.cs" />
<Compile Include="SDK\Player\Utils\Utilities.PixelData.cs" />
<Compile Include="SDK\Player\Utils\Utilities.cs" />
<Compile Include="SDK\Lua\Chips\Game\LuaGameChip.cs" />
<Compile Include="SDK\Lua\Debugger\AsyncDebugger.cs" />
<Compile Include="SDK\Lua\Debugger\DebugSession.cs" />
Expand All @@ -127,19 +159,19 @@
<Compile Include="SDK\Lua\Debugger\Protocol.cs" />
<Compile Include="SDK\Lua\Debugger\Utilities.cs" />
<Compile Include="SDK\Lua\Debugger\VariableInspector.cs" />
<Compile Include="SDK\Lua\LuaRunner.cs" />
<Compile Include="SDK\Lua\Parsers\ScriptParser.cs" />
<Compile Include="SDK\Lua\Services\LuaService.cs" />
<Compile Include="SDK\Runner\CSharpRunner.cs" />
<Compile Include="SDK\Runner\Data\ShaderDisplayTarget.cs" />
<Compile Include="SDK\Runner\Data\DisplayTarget.cs" />
<Compile Include="SDK\Runner\Data\DisplayTargetLite.cs" />
<Compile Include="SDK\Engine\Data\Image.cs" />
<Compile Include="SDK\Player\Data\ImageData.cs" />
<Compile Include="SDK\Runner\DesktopRunner.cs" />
<Compile Include="SDK\Runner\Enums\ActionKeys.cs" />
<Compile Include="SDK\Runner\Enums\BiosSettings.cs" />
<Compile Include="SDK\Runner\Enums\CRTSettings.cs" />
<Compile Include="SDK\Runner\GameRunner.cs" />
<Compile Include="SDK\Runner\IDisplayTarget.cs" />
<Compile Include="SDK\Runner\Game\GameRunner.cs" />
<Compile Include="SDK\Runner\Game\GameRunner.Display.cs" />
<Compile Include="SDK\Runner\Game\GameRunner.Engine.cs" />
<Compile Include="SDK\Runner\Game\GameRunner.Sound.cs" />
<Compile Include="SDK\Runner\Parsers\AbstractParser.cs" />
<Compile Include="SDK\Runner\Parsers\ColorMapParser.cs" />
<Compile Include="SDK\Runner\Parsers\ColorParser.cs" />
Expand Down

0 comments on commit 92a2b17

Please sign in to comment.