diff --git a/Source/Core/Config/ThingTypeInfo.cs b/Source/Core/Config/ThingTypeInfo.cs index a0a8834..1dafd51 100644 --- a/Source/Core/Config/ThingTypeInfo.cs +++ b/Source/Core/Config/ThingTypeInfo.cs @@ -412,7 +412,7 @@ namespace CodeImp.DoomBuilder.Config for (int i = 0; i < Linedef.NUM_ARGS; i++) this.args[i] = new ArgumentInfo(i); // Read properties - this.sprite = cat.Sprite; + this.sprite = o.sprite; this.color = cat.Color; this.alpha = cat.Alpha; //mxd this.alphabyte = (byte)(this.alpha * 255); //mxd diff --git a/Source/Core/SRB2/SOCObjectParser.cs b/Source/Core/SRB2/SOCObjectParser.cs index 063234d..f1110d1 100644 --- a/Source/Core/SRB2/SOCObjectParser.cs +++ b/Source/Core/SRB2/SOCObjectParser.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.IO; using System.Text; using CodeImp.DoomBuilder.Compilers; +using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.ZDoom; using CodeImp.DoomBuilder.GZBuilder.Data; @@ -137,6 +138,7 @@ namespace CodeImp.DoomBuilder.SRB2 private bool ParseObject(string name) { if (name == null) return false; + string sprite = DataManager.INTERNAL_PREFIX + "unknownthing"; string[] states = new string[8]; int mapThingNum = -1; int radius = 0; @@ -146,6 +148,11 @@ namespace CodeImp.DoomBuilder.SRB2 string line = streamreader.ReadLine(); linenumber++; if (String.IsNullOrEmpty(line) || line.StartsWith("\n")) break; + if (line.StartsWith("#$Sprite ")) + { + sprite = line.Substring(9); + continue; + } if (line.StartsWith("#")) continue; line = RemoveComments(line); string[] tokens = line.Split(new char[] { '=' }); @@ -210,7 +217,7 @@ namespace CodeImp.DoomBuilder.SRB2 } if (mapThingNum > 0) { - SRB2Object o = new SRB2Object(name, states, mapThingNum, radius, height); + SRB2Object o = new SRB2Object(name, sprite, states, mapThingNum, radius, height); if (objects.ContainsKey(name)) objects[name] = o; else diff --git a/Source/Core/SRB2/SRB2Object.cs b/Source/Core/SRB2/SRB2Object.cs index 42fa8c6..67d36e7 100644 --- a/Source/Core/SRB2/SRB2Object.cs +++ b/Source/Core/SRB2/SRB2Object.cs @@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.SRB2 #region ================== Variables public readonly string name; + public readonly string sprite; public readonly string[] states; public readonly int mapThingNum; public readonly int radius; @@ -43,9 +44,10 @@ namespace CodeImp.DoomBuilder.SRB2 #region ================== Constructor / Disposer // Constructor - internal SRB2Object(string name, string[] states, int mapThingNum, int radius, int height) + internal SRB2Object(string name, string sprite, string[] states, int mapThingNum, int radius, int height) { this.name = name; + this.sprite = sprite; this.states = states; this.mapThingNum = mapThingNum; this.radius = radius;