Unstatic GlobalFileSystem and rename it to FileSystem

Add a ModFiles field on ModData and move all access to the file system to go through that.
This commit is contained in:
Pavel Penev
2015-10-09 13:55:08 +03:00
parent 5684bcec1c
commit 1b88d24cfa
46 changed files with 154 additions and 172 deletions

View File

@@ -12,7 +12,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using OpenRA.FileSystem;
using OpenTK.Graphics.OpenGL;
namespace OpenRA.Platforms.Default
@@ -28,7 +27,7 @@ namespace OpenRA.Platforms.Default
string ext = type == ShaderType.VertexShader ? "vert" : "frag";
string filename = "glsl{0}{1}.{2}".F(Path.DirectorySeparatorChar, name, ext);
string code;
using (var file = new StreamReader(GlobalFileSystem.Open(filename)))
using (var file = new StreamReader(Game.ModData.ModFiles.Open(filename)))
code = file.ReadToEnd();
var shader = GL.CreateShader(type);