Attempted at fixing 2D camera system.
This commit is contained in:
@@ -10,12 +10,15 @@ namespace RecrownedAthenaeum.ContentReaders
|
||||
{
|
||||
class NinePatchDataReader : ContentTypeReader<NinePatch>
|
||||
{
|
||||
public static GraphicsDevice graphicsDevice;
|
||||
|
||||
protected override NinePatch Read(ContentReader input, NinePatch existingInstance)
|
||||
{
|
||||
if (graphicsDevice == null) graphicsDevice = Configuration.GraphicsDeviceManager.GraphicsDevice;
|
||||
Texture2D texture;
|
||||
using (MemoryStream stream = new MemoryStream(input.ReadBytes(input.ReadInt32())))
|
||||
{
|
||||
texture = Texture2D.FromStream(Configuration.GraphicsDeviceManager.GraphicsDevice, stream);
|
||||
texture = Texture2D.FromStream(graphicsDevice, stream);
|
||||
}
|
||||
NinePatchData ninePatchData = JsonConvert.DeserializeObject<NinePatchData>(Encoding.ASCII.GetString(input.ReadBytes(input.ReadInt32())));
|
||||
NinePatch ninePatch = new NinePatch(texture, ninePatchData.left, ninePatchData.right, ninePatchData.bottom, ninePatchData.top);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Newtonsoft.Json;
|
||||
using RecrownedAthenaeum.Data;
|
||||
@@ -10,13 +11,16 @@ namespace RecrownedAthenaeum.ContentReaders
|
||||
{
|
||||
class TextureAtlasDataReader : ContentTypeReader<TextureAtlas>
|
||||
{
|
||||
public static GraphicsDevice graphicsDevice;
|
||||
|
||||
protected override TextureAtlas Read(ContentReader input, TextureAtlas existingInstance)
|
||||
{
|
||||
if (graphicsDevice == null) graphicsDevice = Configuration.GraphicsDeviceManager.GraphicsDevice;
|
||||
TextureAtlasData atlasData;
|
||||
Texture2D atlasTexture;
|
||||
using (MemoryStream stream = new MemoryStream(input.ReadBytes(input.ReadInt32())))
|
||||
{
|
||||
atlasTexture = Texture2D.FromStream(Configuration.GraphicsDeviceManager.GraphicsDevice, stream);
|
||||
atlasTexture = Texture2D.FromStream(graphicsDevice, stream);
|
||||
}
|
||||
string serialized = Encoding.ASCII.GetString(input.ReadBytes(input.ReadInt32()));
|
||||
atlasData = JsonConvert.DeserializeObject<TextureAtlasData>(serialized);
|
||||
|
Reference in New Issue
Block a user