mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
DECORATE Scale actor property is now taken into account when rendering models.
Fixed several bugs in Engine selector dialog ("Game configurations -> Testing").
This commit is contained in:
parent
640b874bd3
commit
f419db1518
8 changed files with 23 additions and 5 deletions
|
@ -143,6 +143,8 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
info.TestSkill = General.Settings.ReadSetting(path + ".testskill", 3);
|
info.TestSkill = General.Settings.ReadSetting(path + ".testskill", 3);
|
||||||
testEngines.Add(info);
|
testEngines.Add(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(currentEngineIndex >= testEngines.Count) currentEngineIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd. read custom linedef colors
|
//mxd. read custom linedef colors
|
||||||
|
|
|
@ -28,9 +28,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data {
|
||||||
public void CheckProgramName(bool forced) {
|
public void CheckProgramName(bool forced) {
|
||||||
if ((forced || TestProgramName == DEFAULT_ENGINE_NAME) && !String.IsNullOrEmpty(TestProgram)) {
|
if ((forced || TestProgramName == DEFAULT_ENGINE_NAME) && !String.IsNullOrEmpty(TestProgram)) {
|
||||||
//get engine name from folder name
|
//get engine name from folder name
|
||||||
string n = Path.GetDirectoryName(TestProgram);
|
TestProgramName = Path.GetFileNameWithoutExtension(TestProgram);
|
||||||
int pos = n.LastIndexOf(Path.DirectorySeparatorChar);
|
|
||||||
TestProgramName = n.Substring(pos + 1, n.Length - pos - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
private int tag;
|
private int tag;
|
||||||
private int action;
|
private int action;
|
||||||
private int[] args;
|
private int[] args;
|
||||||
|
protected float scale; //mxd. Used in model rendering
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
private float size;
|
private float size;
|
||||||
|
@ -70,6 +71,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public MapSet Map { get { return map; } }
|
public MapSet Map { get { return map; } }
|
||||||
public int Type { get { return type; } set { BeforePropsChange(); type = value; } }
|
public int Type { get { return type; } set { BeforePropsChange(); type = value; } }
|
||||||
public Vector3D Position { get { return pos; } }
|
public Vector3D Position { get { return pos; } }
|
||||||
|
public float Scale { get { return scale; } } //mxd
|
||||||
public float Angle { get { return anglerad; } }
|
public float Angle { get { return anglerad; } }
|
||||||
public int AngleDoom { get { return angledoom; } }
|
public int AngleDoom { get { return angledoom; } }
|
||||||
internal Dictionary<string, bool> Flags { get { return flags; } }
|
internal Dictionary<string, bool> Flags { get { return flags; } }
|
||||||
|
@ -96,6 +98,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
this.listindex = listindex;
|
this.listindex = listindex;
|
||||||
this.flags = new Dictionary<string, bool>();
|
this.flags = new Dictionary<string, bool>();
|
||||||
this.args = new int[NUM_ARGS];
|
this.args = new int[NUM_ARGS];
|
||||||
|
this.scale = 1.0f; //mxd
|
||||||
|
|
||||||
if(map == General.Map.Map)
|
if(map == General.Map.Map)
|
||||||
General.Map.UndoRedo.RecAddThing(this);
|
General.Map.UndoRedo.RecAddThing(this);
|
||||||
|
@ -415,6 +418,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
// Apply size
|
// Apply size
|
||||||
size = ti.Radius;
|
size = ti.Radius;
|
||||||
fixedsize = ti.FixedSize;
|
fixedsize = ti.FixedSize;
|
||||||
|
scale = ti.SpriteScale.Width; //mxd
|
||||||
|
|
||||||
// Color valid?
|
// Color valid?
|
||||||
if((ti.Color >= 0) && (ti.Color < ColorCollection.NUM_THING_COLORS))
|
if((ti.Color >= 0) && (ti.Color < ColorCollection.NUM_THING_COLORS))
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
graphics.Shaders.Things2D.FillColor = group.Value.Selected ? General.Colors.Selection.ToColorValue() : General.Colors.ModelWireframe.ToColorValue();
|
graphics.Shaders.Things2D.FillColor = group.Value.Selected ? General.Colors.Selection.ToColorValue() : General.Colors.ModelWireframe.ToColorValue();
|
||||||
|
|
||||||
for (int i = 0; i < mde.Model.Meshes.Count; i++) {
|
for (int i = 0; i < mde.Model.Meshes.Count; i++) {
|
||||||
graphics.Shaders.Things2D.SetTransformSettings(group.Key, group.Value.Angle, scale);
|
graphics.Shaders.Things2D.SetTransformSettings(group.Key, group.Value.Angle, scale * group.Value.Scale);
|
||||||
graphics.Shaders.Things2D.ApplySettings();
|
graphics.Shaders.Things2D.ApplySettings();
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
|
|
@ -1066,6 +1066,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
|
|
||||||
// Create the matrix for positioning / rotation
|
// Create the matrix for positioning / rotation
|
||||||
world = Matrix.Multiply(t.Orientation, Matrix.RotationZ(t.Thing.Angle));
|
world = Matrix.Multiply(t.Orientation, Matrix.RotationZ(t.Thing.Angle));
|
||||||
|
world = Matrix.Multiply(world, t.Scale);
|
||||||
world = Matrix.Multiply(world, t.Position);
|
world = Matrix.Multiply(world, t.Position);
|
||||||
ApplyMatrices3D();
|
ApplyMatrices3D();
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
//mxd
|
//mxd
|
||||||
private int cameraDistance3D;
|
private int cameraDistance3D;
|
||||||
private int thingHeight;
|
private int thingHeight;
|
||||||
|
protected Matrix scale; //mxd. Used in model rendering
|
||||||
|
|
||||||
//mxd. light properties
|
//mxd. light properties
|
||||||
private int lightType;
|
private int lightType;
|
||||||
|
@ -103,6 +104,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
|
|
||||||
//mxd
|
//mxd
|
||||||
internal int VertexColor { get { return vertices.Length > 0 ? vertices[0].c : 0;} }
|
internal int VertexColor { get { return vertices.Length > 0 ? vertices[0].c : 0;} }
|
||||||
|
internal Matrix Scale { get { return scale; } }
|
||||||
public int CameraDistance3D { get { return cameraDistance3D; } }
|
public int CameraDistance3D { get { return cameraDistance3D; } }
|
||||||
public bool Sizeless { get { return sizeless; } }
|
public bool Sizeless { get { return sizeless; } }
|
||||||
public Vector3 Center {
|
public Vector3 Center {
|
||||||
|
@ -166,6 +168,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
this.orientation = Matrix.Identity;
|
this.orientation = Matrix.Identity;
|
||||||
this.position = Matrix.Identity;
|
this.position = Matrix.Identity;
|
||||||
this.cagescales = Matrix.Identity;
|
this.cagescales = Matrix.Identity;
|
||||||
|
this.scale = Matrix.Identity; //mxd
|
||||||
|
|
||||||
//mxd
|
//mxd
|
||||||
lightType = -1;
|
lightType = -1;
|
||||||
|
@ -287,6 +290,11 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
updategeo = true;
|
updategeo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mxd
|
||||||
|
protected void SetScale(float scaleX, float scaleY) {
|
||||||
|
scale = Matrix.Scaling(scaleX, scaleX, scaleY);
|
||||||
|
}
|
||||||
|
|
||||||
// This updates the visual thing
|
// This updates the visual thing
|
||||||
public virtual void Update()
|
public virtual void Update()
|
||||||
{
|
{
|
||||||
|
|
|
@ -624,6 +624,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
private void btnRemoveEngine_Click(object sender, EventArgs e) {
|
private void btnRemoveEngine_Click(object sender, EventArgs e) {
|
||||||
//remove params
|
//remove params
|
||||||
int index = cbEngineSelector.SelectedIndex;
|
int index = cbEngineSelector.SelectedIndex;
|
||||||
|
cbEngineSelector.SelectedIndex = -1;
|
||||||
configinfo.TestEngines.RemoveAt(index);
|
configinfo.TestEngines.RemoveAt(index);
|
||||||
|
|
||||||
//refresh engines list
|
//refresh engines list
|
||||||
|
@ -642,6 +643,8 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
|
|
||||||
//mxd
|
//mxd
|
||||||
private void cbEngineSelector_SelectedIndexChanged(object sender, EventArgs e) {
|
private void cbEngineSelector_SelectedIndexChanged(object sender, EventArgs e) {
|
||||||
|
if(cbEngineSelector.SelectedIndex == -1) return;
|
||||||
|
|
||||||
//set new values
|
//set new values
|
||||||
configinfo.CurrentEngineIndex = cbEngineSelector.SelectedIndex;
|
configinfo.CurrentEngineIndex = cbEngineSelector.SelectedIndex;
|
||||||
cbEngineSelector.Tag = cbEngineSelector.SelectedIndex; //store for later use
|
cbEngineSelector.Tag = cbEngineSelector.SelectedIndex; //store for later use
|
||||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Geometry;
|
||||||
using CodeImp.DoomBuilder.VisualModes;
|
using CodeImp.DoomBuilder.VisualModes;
|
||||||
using CodeImp.DoomBuilder.Config;
|
using CodeImp.DoomBuilder.Config;
|
||||||
using CodeImp.DoomBuilder.Data;
|
using CodeImp.DoomBuilder.Data;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -259,6 +260,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
SetPosition(pos);
|
SetPosition(pos);
|
||||||
SetCageSize(infoRadius, infoHeight);
|
SetCageSize(infoRadius, infoHeight);
|
||||||
SetCageColor(Thing.Color);
|
SetCageColor(Thing.Color);
|
||||||
|
SetScale(info.SpriteScale.Width, info.SpriteScale.Height); //mxd
|
||||||
|
|
||||||
// Keep info for object picking
|
// Keep info for object picking
|
||||||
cageradius2 = infoRadius * Angle2D.SQRT2;
|
cageradius2 = infoRadius * Angle2D.SQRT2;
|
||||||
|
|
Loading…
Reference in a new issue