@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileSystem;
|
||||
@@ -41,7 +42,8 @@ namespace OpenRA.Graphics
|
||||
if (sequences.NodesDict.ContainsKey("ShadowIndex"))
|
||||
{
|
||||
Array.Resize(ref shadowIndex, shadowIndex.Length + 1);
|
||||
int.TryParse(sequences.NodesDict["ShadowIndex"].Value, out shadowIndex[shadowIndex.Length - 1]);
|
||||
int.TryParse(sequences.NodesDict["ShadowIndex"].Value, NumberStyles.Any, NumberFormatInfo.InvariantInfo,
|
||||
out shadowIndex[shadowIndex.Length - 1]);
|
||||
}
|
||||
|
||||
palette = new HardwarePalette();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Globalization;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
@@ -30,22 +31,22 @@ namespace OpenRA.Graphics
|
||||
sprites = Game.modData.SpriteLoader.LoadAllSprites(cursorSrc);
|
||||
var d = info.NodesDict;
|
||||
|
||||
start = int.Parse(d["start"].Value);
|
||||
start = int.Parse(d["start"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
this.palette = palette;
|
||||
|
||||
if ((d.ContainsKey("length") && d["length"].Value == "*") || (d.ContainsKey("end") && d["end"].Value == "*"))
|
||||
length = sprites.Length - start;
|
||||
else if (d.ContainsKey("length"))
|
||||
length = int.Parse(d["length"].Value);
|
||||
length = int.Parse(d["length"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
else if (d.ContainsKey("end"))
|
||||
length = int.Parse(d["end"].Value) - start;
|
||||
length = int.Parse(d["end"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo) - start;
|
||||
else
|
||||
length = 1;
|
||||
|
||||
if (d.ContainsKey("x"))
|
||||
int.TryParse(d["x"].Value, out Hotspot.X);
|
||||
int.TryParse(d["x"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out Hotspot.X);
|
||||
if (d.ContainsKey("y"))
|
||||
int.TryParse(d["y"].Value, out Hotspot.Y);
|
||||
int.TryParse(d["y"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out Hotspot.Y);
|
||||
}
|
||||
|
||||
public Sprite GetSprite(int frame)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
@@ -40,7 +41,7 @@ namespace OpenRA.Graphics
|
||||
try
|
||||
{
|
||||
if (d.ContainsKey("Start"))
|
||||
Start = int.Parse(d["Start"].Value);
|
||||
Start = int.Parse(d["Start"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
|
||||
if (d.ContainsKey("Offset"))
|
||||
offset = FieldLoader.GetValue<float2>("Offset", d["Offset"].Value);
|
||||
@@ -58,16 +59,16 @@ namespace OpenRA.Graphics
|
||||
else if (d["Length"].Value == "*")
|
||||
Length = sprites.Length - Start;
|
||||
else
|
||||
Length = int.Parse(d["Length"].Value);
|
||||
Length = int.Parse(d["Length"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
|
||||
if (d.ContainsKey("Stride"))
|
||||
Stride = int.Parse(d["Stride"].Value);
|
||||
Stride = int.Parse(d["Stride"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
else
|
||||
Stride = Length;
|
||||
|
||||
if (d.ContainsKey("Facings"))
|
||||
{
|
||||
var f = int.Parse(d["Facings"].Value);
|
||||
var f = int.Parse(d["Facings"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
Facings = Math.Abs(f);
|
||||
reverseFacings = f < 0;
|
||||
}
|
||||
@@ -75,7 +76,7 @@ namespace OpenRA.Graphics
|
||||
Facings = 1;
|
||||
|
||||
if (d.ContainsKey("Tick"))
|
||||
Tick = int.Parse(d["Tick"].Value);
|
||||
Tick = int.Parse(d["Tick"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
else
|
||||
Tick = 40;
|
||||
|
||||
@@ -83,10 +84,10 @@ namespace OpenRA.Graphics
|
||||
transpose = bool.Parse(d["Transpose"].Value);
|
||||
|
||||
if (d.ContainsKey("Frames"))
|
||||
Frames = Array.ConvertAll<string, int>(d["Frames"].Value.Split(','), int.Parse);
|
||||
Frames = Array.ConvertAll<string, int>(d["Frames"].Value.Split(','), (s) => int.Parse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo));
|
||||
|
||||
if (d.ContainsKey("ShadowStart"))
|
||||
ShadowStart = int.Parse(d["ShadowStart"].Value);
|
||||
ShadowStart = int.Parse(d["ShadowStart"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
else
|
||||
ShadowStart = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user