diff options
| author | Michael <[email protected]> | 2017-07-27 12:03:55 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-07-27 12:03:55 -0400 |
| commit | 89dfed83afbb8272388940cd0b4b46b8b066153f (patch) | |
| tree | 79e9e22d4c8a5d8274db55ed1c54dc17d58c5db5 /ShiftOS.Frontend/GraphicsSubsystem | |
| parent | cac4e1f9a7af1c92e4bd61a42fb48359df6eeaec (diff) | |
| download | shiftos_thereturn-89dfed83afbb8272388940cd0b4b46b8b066153f.tar.gz shiftos_thereturn-89dfed83afbb8272388940cd0b4b46b8b066153f.tar.bz2 shiftos_thereturn-89dfed83afbb8272388940cd0b4b46b8b066153f.zip | |
Hacking UI is coming in.
Diffstat (limited to 'ShiftOS.Frontend/GraphicsSubsystem')
| -rw-r--r-- | ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs | 10 | ||||
| -rw-r--r-- | ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs index e75b00d..d8e447c 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs @@ -105,22 +105,16 @@ namespace ShiftOS.Frontend.GraphicsSubsystem { x += _startx; y += _starty; - var tex2 = new Texture2D(_graphicsDevice, 1, 1, false, SurfaceFormat.Color); - byte[] colordata = new byte[] { color.B, color.G, color.R, color.A }; - tex2.SetData<byte>(colordata); int distance = (int)Vector2.Distance(new Vector2(x, y), new Vector2(x1, y1)); float rotation = getRotation(x, y, x1, y1); - _spritebatch.Draw(tex2, new Rectangle(x, y, distance, thickness), null, color, rotation, Vector2.Zero, SpriteEffects.None, 0); + _spritebatch.Draw(UIManager.SkinTextures["PureWhite"], new Rectangle(x, y, distance, thickness), null, color, rotation, Vector2.Zero, SpriteEffects.None, 0); } public void DrawRectangle(int x, int y, int width, int height, Color color) { x += _startx; y += _starty; - var tex2 = new Texture2D(_graphicsDevice, 1, 1, false, SurfaceFormat.Color); - byte[] colordata = new byte[] { 255, 255, 255, 255 }; - tex2.SetData<byte>(colordata); - _spritebatch.Draw(tex2, new Rectangle(x, y, width, height), color); + _spritebatch.Draw(UIManager.SkinTextures["PureWhite"], new Rectangle(x, y, width, height), color); } public void DrawRectangle(int x, int y, int width, int height, Texture2D tex2) diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs index 96ef3cb..43762cf 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs @@ -233,7 +233,9 @@ namespace ShiftOS.Frontend.GraphicsSubsystem SkinTextures.Add(colorfield.Name, tex2); } - + var pureWhite = new Texture2D(graphics, 1, 1); + pureWhite.SetData<byte>(new byte[] { 255, 255, 255, 255 }); + SkinTextures.Add("PureWhite", pureWhite); } |
