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:
@@ -8,12 +8,10 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Mods.Common.Widgets.Logic;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -40,7 +41,9 @@ namespace OpenRA.Mods.Common.LoadScreens
|
||||
|
||||
if (info.ContainsKey("Image"))
|
||||
{
|
||||
sheet = new Sheet(SheetType.BGRA, Platform.ResolvePath(info["Image"]));
|
||||
using (var stream = File.OpenRead(Platform.ResolvePath(info["Image"])))
|
||||
sheet = new Sheet(SheetType.BGRA, stream);
|
||||
|
||||
logo = new Sprite(sheet, new Rectangle(0, 0, 256, 256), TextureChannel.Alpha);
|
||||
stripe = new Sprite(sheet, new Rectangle(256, 0, 256, 256), TextureChannel.Alpha);
|
||||
stripeRect = new Rectangle(0, r.Resolution.Height / 2 - 128, r.Resolution.Width, 256);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -22,10 +23,14 @@ namespace OpenRA.Mods.Common.LoadScreens
|
||||
|
||||
public void Init(Manifest m, Dictionary<string, string> info)
|
||||
{
|
||||
var sheet = new Sheet(SheetType.BGRA, info["Image"]);
|
||||
var res = Game.Renderer.Resolution;
|
||||
bounds = new Rectangle(0, 0, res.Width, res.Height);
|
||||
sprite = new Sprite(sheet, new Rectangle(0, 0, 1024, 480), TextureChannel.Alpha);
|
||||
|
||||
using (var stream = File.OpenRead(info["Image"]))
|
||||
{
|
||||
var sheet = new Sheet(SheetType.BGRA, stream);
|
||||
sprite = new Sprite(sheet, new Rectangle(0, 0, 1024, 480), TextureChannel.Alpha);
|
||||
}
|
||||
}
|
||||
|
||||
public void Display()
|
||||
|
||||
Reference in New Issue
Block a user