Modified code to compile on Linux

This commit is contained in:
joonas
2015-08-19 23:34:20 +03:00
parent e19ac600ff
commit bb295a7444
18 changed files with 82 additions and 41 deletions

View File

@@ -4,6 +4,7 @@ using System.IO;
using Microsoft.Xna.Framework.Graphics;
using Color = Microsoft.Xna.Framework.Color;
using System;
using Microsoft.Xna.Framework;
namespace Subsurface
{
@@ -44,8 +45,15 @@ namespace Subsurface
{
try
{
#if WINDOWS
using (Stream fileStream = File.OpenRead(path))
return FromStream(fileStream, preMultiplyAlpha);
#endif
#if LINUX
using (Stream fileStream = File.OpenRead(path))
return Texture2D.FromFile(_graphicsDevice, fileStream);// .FromStream(fileStream, preMultiplyAlpha);
#endif
}
catch (Exception e)
{
@@ -55,7 +63,8 @@ namespace Subsurface
}
public Texture2D FromStream(Stream stream, bool preMultiplyAlpha = true)
#if WINDOWS
private Texture2D FromStream(Stream stream, bool preMultiplyAlpha = true)
{
Texture2D texture;
@@ -114,6 +123,8 @@ namespace Subsurface
return texture;
}
#endif
private static readonly BlendState BlendColorBlendState;
private static readonly BlendState BlendAlphaBlendState;