This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new display partial classes for MonoGame and MonoVision and mod…
…ified PV8 Lite project to support change.
- Loading branch information
1 parent
8c36859
commit 4e64795
Showing
7 changed files
with
82 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace PixelVision8.Runner | ||
{ | ||
public partial class DisplayTarget | ||
{ | ||
public virtual void Render(int[] pixels, int defaultColor) | ||
{ | ||
|
||
// We can only update the display if the pixel lengths match up | ||
if (pixels.Length != _totalPixels) | ||
return; | ||
|
||
SpriteBatch.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp); | ||
|
||
for (_i = 0; _i < _totalPixels; _i++) | ||
{ | ||
_colorId = pixels[_i]; | ||
_pixelData[_i] = CachedColors[_colorId < 0 ? defaultColor : _colorId]; | ||
} | ||
|
||
RenderTexture.SetData(_pixelData); | ||
SpriteBatch.Draw(RenderTexture, Offset, VisibleRect, Color.White, 0f, Vector2.Zero, Scale, SpriteEffects.None, 1f); | ||
SpriteBatch.End(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Microsoft.Xna.Framework; | ||
namespace PixelVision8.Runner | ||
{ | ||
public partial class DisplayTarget | ||
{ | ||
public virtual void Render(int[] pixels, int defaultColor) | ||
{ | ||
|
||
// We can only update the display if the pixel lengths match up | ||
if (pixels.Length != _totalPixels) | ||
return; | ||
|
||
SpriteBatch.Begin(); //SpriteSortMode.Immediate | ||
|
||
for (_i = 0; _i < _totalPixels; _i++) | ||
{ | ||
_colorId = pixels[_i]; | ||
_pixelData[_i] = CachedColors[_colorId < 0 ? defaultColor : _colorId]; | ||
} | ||
|
||
RenderTexture.SetData(_pixelData); | ||
SpriteBatch.Draw(RenderTexture, Offset, VisibleRect, Color.White, Vector2.Zero, Scale); | ||
SpriteBatch.End(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.