From 8a9453f31ea62464728e4cf0806d18ddb81d2441 Mon Sep 17 00:00:00 2001 From: codeimp Date: Sun, 1 Aug 2010 18:23:41 +0000 Subject: [PATCH] @ Thing sprite scale can now also be set in Game Configurations. Use 'spritescale' property in things or thing categories. --- Source/Core/Config/ThingCategory.cs | 6 +++++- Source/Core/Config/ThingTypeInfo.cs | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/Config/ThingCategory.cs b/Source/Core/Config/ThingCategory.cs index d90aef97..082bd9e2 100644 --- a/Source/Core/Config/ThingCategory.cs +++ b/Source/Core/Config/ThingCategory.cs @@ -59,7 +59,8 @@ namespace CodeImp.DoomBuilder.Config private int errorcheck; private bool fixedsize; private bool absolutez; - + private float spritescale; + // Disposing private bool isdisposed = false; @@ -81,6 +82,7 @@ namespace CodeImp.DoomBuilder.Config public bool FixedSize { get { return fixedsize; } } public bool IsDisposed { get { return isdisposed; } } public bool AbsoluteZ { get { return absolutez; } } + public float SpriteScale { get { return spritescale; } } public List Things { get { return things; } } #endregion @@ -107,6 +109,7 @@ namespace CodeImp.DoomBuilder.Config this.errorcheck = 1; this.fixedsize = false; this.absolutez = false; + this.spritescale = 1.0f; // We have no destructor GC.SuppressFinalize(this); @@ -135,6 +138,7 @@ namespace CodeImp.DoomBuilder.Config this.errorcheck = cfg.ReadSetting("thingtypes." + name + ".error", 1); this.fixedsize = cfg.ReadSetting("thingtypes." + name + ".fixedsize", false); this.absolutez = cfg.ReadSetting("thingtypes." + name + ".absolutez", false); + this.spritescale = cfg.ReadSetting("thingtypes." + name + ".spritescale", 1.0f); // Safety if(this.radius < 4f) this.radius = 8f; diff --git a/Source/Core/Config/ThingTypeInfo.cs b/Source/Core/Config/ThingTypeInfo.cs index db97c5c4..a5a8ec36 100644 --- a/Source/Core/Config/ThingTypeInfo.cs +++ b/Source/Core/Config/ThingTypeInfo.cs @@ -144,6 +144,7 @@ namespace CodeImp.DoomBuilder.Config this.errorcheck = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".error", cat.ErrorCheck); this.fixedsize = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".fixedsize", cat.FixedSize); this.absolutez = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".absolutez", cat.AbsoluteZ); + this.spritescale = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".spritescale", cat.SpriteScale); // Read the args for(int i = 0; i < Linedef.NUM_ARGS; i++) @@ -187,7 +188,8 @@ namespace CodeImp.DoomBuilder.Config this.errorcheck = cat.ErrorCheck; this.fixedsize = cat.FixedSize; this.absolutez = cat.AbsoluteZ; - + this.spritescale = cat.SpriteScale; + // Safety if(this.radius < 4f) this.radius = 8f; @@ -224,7 +226,8 @@ namespace CodeImp.DoomBuilder.Config this.errorcheck = cat.ErrorCheck; this.fixedsize = cat.FixedSize; this.absolutez = cat.AbsoluteZ; - + this.spritescale = cat.SpriteScale; + // Safety if(this.radius < 4f) this.radius = 8f;