GZDoom Builder 1.12d:

TEXTURES patches can now be loaded from anywhere inside resource.
Configs: things from "Cameras and Interpolation" and "Boom Items" categories weren't rendered in Visual modes.
Configs: several new icons are now used for things.
Reverted sectors rendering from 1.12b, because it was done in too hackish way and was causing more and more problems. Models rendered height is now 25% lower instead.
Models rendering height can be toggled between normal and 85% in Preferences->Appearance->"Scale models in Visual modes"
Fixed several small bugs here and there.
This commit is contained in:
MaxED 2012-08-10 12:08:08 +00:00
parent 508a3f2772
commit eb86ab60af
26 changed files with 1703 additions and 1679 deletions

View file

@ -4,9 +4,11 @@ boom
color = 8; // Grey color = 8; // Grey
arrow = 1; arrow = 1;
title = "Boom Items"; title = "Boom Items";
width = 0; width = 8;
height = 16;
sort = 1; sort = 1;
fixedsize = true; fixedsize = true;
sprite = "internal:action";
5001 = "Pusher"; 5001 = "Pusher";
5002 = "Puller"; 5002 = "Puller";

View file

@ -273,6 +273,7 @@ zdoom
hangs = 0; hangs = 0;
blocking = 0; blocking = 0;
error = 1; error = 1;
sprite = "internal:bridge";
5064 5064
{ {
@ -331,13 +332,14 @@ zdoom
color = 7; // Light Grey color = 7; // Light Grey
arrow = 1; arrow = 1;
title = "Cameras and Interpolation"; title = "Cameras and Interpolation";
width = 16; width = 8;
height = 16;
sort = 1; sort = 1;
height = 0;
hangs = 0; hangs = 0;
blocking = 0; blocking = 0;
error = 1; error = 1;
fixedsize = true; fixedsize = true;
sprite = "internal:camera";
9025 9025
{ {
@ -595,10 +597,11 @@ zdoom
title = "Slopes"; title = "Slopes";
width = 8; width = 8;
sort = 1; sort = 1;
height = 0; height = 16;
hangs = 0; hangs = 0;
blocking = 0; blocking = 0;
fixedsize = true; fixedsize = true;
sprite = "internal:slope";
9511 9511
{ {
@ -793,9 +796,9 @@ zdoom
color = 7; color = 7;
arrow = 0; arrow = 0;
title = "Portals"; title = "Portals";
width = 0; width = 8;
sort = 1; sort = 1;
height = 0; height = 16;
hangs = 0; hangs = 0;
blocking = 0; blocking = 0;
fixedsize = true; fixedsize = true;
@ -803,6 +806,7 @@ zdoom
9077 9077
{ {
title = "Upper Sector"; title = "Upper Sector";
sprite = "internal:portal_upper";
arg0 arg0
{ {
title = "Flat Transparency"; title = "Flat Transparency";
@ -813,6 +817,7 @@ zdoom
9078 9078
{ {
title = "Lower Sector"; title = "Lower Sector";
sprite = "internal:portal_lower";
arg0 arg0
{ {
title = "Flat Transparency"; title = "Flat Transparency";

View file

@ -346,6 +346,7 @@ keywords
StartConversation = "StartConversation(tid, facing)"; StartConversation = "StartConversation(tid, facing)";
Str = "Str expression"; Str = "Str expression";
strlen = "strlen(string)"; strlen = "strlen(string)";
StrParam = "int StrParam(item(s))";
Suspend = "Suspend"; Suspend = "Suspend";
Switch = "Switch(expression)"; Switch = "Switch(expression)";
TagWait = "TagWait(tag)"; TagWait = "TagWait(tag)";

BIN
Build/Sprites/Bridge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

BIN
Build/Sprites/Camera.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

BIN
Build/Sprites/Slope.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

View file

@ -107,6 +107,7 @@ namespace CodeImp.DoomBuilder.Config
private float gzDynamicLightRadius; private float gzDynamicLightRadius;
private float gzDynamicLightIntensity; private float gzDynamicLightIntensity;
private bool gzTestFromCurrentPosition; private bool gzTestFromCurrentPosition;
private bool gzStretchModels;
// These are not stored in the configuration, only used at runtime // These are not stored in the configuration, only used at runtime
private string defaulttexture; private string defaulttexture;
@ -183,6 +184,7 @@ namespace CodeImp.DoomBuilder.Config
public int GZMaxDynamicLights { get { return gzMaxDynamicLights; } internal set { gzMaxDynamicLights = value; } } public int GZMaxDynamicLights { get { return gzMaxDynamicLights; } internal set { gzMaxDynamicLights = value; } }
public float GZDynamicLightRadius { get { return gzDynamicLightRadius; } internal set { gzDynamicLightRadius = value; } } public float GZDynamicLightRadius { get { return gzDynamicLightRadius; } internal set { gzDynamicLightRadius = value; } }
public float GZDynamicLightIntensity { get { return gzDynamicLightIntensity; } internal set { gzDynamicLightIntensity = value; } } public float GZDynamicLightIntensity { get { return gzDynamicLightIntensity; } internal set { gzDynamicLightIntensity = value; } }
public bool GZStretchModels { get { return gzStretchModels; } internal set { gzStretchModels = value; } }
public string DefaultTexture { get { return defaulttexture; } set { defaulttexture = value; } } public string DefaultTexture { get { return defaulttexture; } set { defaulttexture = value; } }
public string DefaultFloorTexture { get { return defaultfloortexture; } set { defaultfloortexture = value; } } public string DefaultFloorTexture { get { return defaultfloortexture; } set { defaultfloortexture = value; } }
@ -275,6 +277,7 @@ namespace CodeImp.DoomBuilder.Config
gzMaxDynamicLights = cfg.ReadSetting("gzmaxdynamiclights", 16); gzMaxDynamicLights = cfg.ReadSetting("gzmaxdynamiclights", 16);
gzDynamicLightRadius = cfg.ReadSetting("gzdynamiclightradius", 1.0f); gzDynamicLightRadius = cfg.ReadSetting("gzdynamiclightradius", 1.0f);
gzDynamicLightIntensity = cfg.ReadSetting("gzdynamiclightintensity", 1.0f); gzDynamicLightIntensity = cfg.ReadSetting("gzdynamiclightintensity", 1.0f);
gzStretchModels = cfg.ReadSetting("gzstretchmodels", true);
// Success // Success
return true; return true;
@ -349,6 +352,7 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("gzmaxdynamiclights", gzMaxDynamicLights); cfg.WriteSetting("gzmaxdynamiclights", gzMaxDynamicLights);
cfg.WriteSetting("gzdynamiclightradius", gzDynamicLightRadius); cfg.WriteSetting("gzdynamiclightradius", gzDynamicLightRadius);
cfg.WriteSetting("gzdynamiclightintensity", gzDynamicLightIntensity); cfg.WriteSetting("gzdynamiclightintensity", gzDynamicLightIntensity);
cfg.WriteSetting("gzstretchmodels", gzStretchModels);
// Save settings configuration // Save settings configuration
General.WriteLogLine("Saving program configuration..."); General.WriteLogLine("Saving program configuration...");

View file

@ -88,8 +88,11 @@ namespace CodeImp.DoomBuilder.Data
try try
{ {
// Find in patches directory // Find in patches directory
string path = Path.Combine(PATCHES_DIR, Path.GetDirectoryName(pname)); //string path = Path.Combine(PATCHES_DIR, Path.GetDirectoryName(pname));
string filename = FindFirstFile(path, Path.GetFileName(pname), true); //string filename = FindFirstFile(path, Path.GetFileName(pname), true);
//mxd. ZDoom can load them from anywhere, so shall we
string filename = FindFirstFile(Path.GetDirectoryName(pname), Path.GetFileName(pname), true);
if((filename != null) && FileExists(filename)) if((filename != null) && FileExists(filename))
{ {
return LoadFile(filename); return LoadFile(filename);

View file

@ -128,7 +128,8 @@ namespace CodeImp.DoomBuilder.Data
} }
// Find in patches directory // Find in patches directory
string filename = FindFirstFile(PATCHES_DIR, pname, true); //string filename = FindFirstFile(PATCHES_DIR, pname, true);
string filename = FindFirstFile("", pname, true); //mxd. ZDoom can load them from anywhere, so shall we
if((filename != null) && FileExists(filename)) if((filename != null) && FileExists(filename))
{ {
return LoadFile(filename); return LoadFile(filename);

View file

@ -270,7 +270,8 @@ namespace CodeImp.DoomBuilder.Data
//no need to search in wads... //no need to search in wads...
// Find in patches directory // Find in patches directory
string filename = FindFirstFile(PATCHES_DIR, pname, true); //string filename = FindFirstFile(PATCHES_DIR, pname, true);
string filename = FindFirstFile("", pname, true); //mxd. ZDoom can load them from anywhere, so shall we
if ((filename != null) && FileExists(filename)) if ((filename != null) && FileExists(filename))
return filename; return filename;
@ -419,8 +420,14 @@ namespace CodeImp.DoomBuilder.Data
if(filename.IndexOf('.') > -1) if(filename.IndexOf('.') > -1)
{ {
allfilenames = new string[1]; string fullName = Path.Combine(pathname, filename);
allfilenames[0] = Path.Combine(pathname, filename); if(FileExists(fullName)) {
allfilenames = new string[1];
allfilenames[0] = Path.Combine(pathname, filename);
} else {
allfilenames = new string[0];
General.ErrorLogger.Add(ErrorType.Warning, "Unable to load DECORATE file '" + fullName + "'");
}
} }
else else
allfilenames = GetAllFilesWithTitle(pathname, filename, false); allfilenames = GetAllFilesWithTitle(pathname, filename, false);

View file

@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.GZBuilder
//version //version
public const float Version = 1.12f; public const float Version = 1.12f;
public const char Revision = 'b'; public const char Revision = 'd';
//debug console //debug console
#if DEBUG #if DEBUG

View file

@ -20,7 +20,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
{ {
internal static class ModelReader internal static class ModelReader
{ {
public static void Parse(ref ModeldefEntry mde, PK3StructuredReader reader, Device D3DDevice) { private const float VERTICAL_STRETCH = 1 / 1.2f;
public static void Parse(ref ModeldefEntry mde, PK3StructuredReader reader, Device D3DDevice) {
string[] modelNames = new string[mde.ModelNames.Count]; string[] modelNames = new string[mde.ModelNames.Count];
string[] textureNames = new string[mde.TextureNames.Count]; string[] textureNames = new string[mde.TextureNames.Count];
@ -234,7 +236,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
//scale it //scale it
v.y *= mde.Scale.X; v.y *= mde.Scale.X;
v.x *= mde.Scale.Y; v.x *= mde.Scale.Y;
v.z *= mde.Scale.Z; v.z *= mde.Scale.Z;
if(General.Settings.GZStretchModels) v.z *= VERTICAL_STRETCH; //GZDoom vertical stretch hack
//add zOffset //add zOffset
v.z += mde.zOffset; v.z += mde.zOffset;
@ -362,7 +365,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
//scale it //scale it
v.x *= mde.Scale.X; v.x *= mde.Scale.X;
v.y *= mde.Scale.Y; v.y *= mde.Scale.Y;
v.z *= mde.Scale.Z; v.z *= mde.Scale.Z;
if(General.Settings.GZStretchModels) v.z *= VERTICAL_STRETCH; //GZDoom vertical stretch hack
//add zOffset //add zOffset
v.z += mde.zOffset; v.z += mde.zOffset;

View file

@ -216,29 +216,6 @@ namespace CodeImp.DoomBuilder.Map
{ {
//mxd //mxd
sector = map.GetSectorByCoordinates(pos); sector = map.GetSectorByCoordinates(pos);
/*Linedef nl;
// Find the nearest linedef on the map
nl = map.NearestLinedef(pos);
if(nl != null)
{
// Check what side of line we are at
if(nl.SideOfLine(pos) < 0f)
{
// Front side
if(nl.Front != null) sector = nl.Front.Sector; else sector = null;
}
else
{
// Back side
if(nl.Back != null) sector = nl.Back.Sector; else sector = null;
}
}
else
{
sector = null;
}*/
} }
// This determines which sector the thing is in and links it // This determines which sector the thing is in and links it

View file

@ -513,7 +513,7 @@ namespace CodeImp.DoomBuilder.Rendering
// This ends rendering world geometry // This ends rendering world geometry
public void FinishGeometry() public void FinishGeometry()
{ {
//mxd. sort lights //mxd. sort lights
if (General.Settings.GZDrawLights && !fullbrightness && thingsWithLight.Count > 0) if (General.Settings.GZDrawLights && !fullbrightness && thingsWithLight.Count > 0)
updateLights(); updateLights();
@ -527,8 +527,7 @@ namespace CodeImp.DoomBuilder.Rendering
graphics.Shaders.World3D.Begin(); graphics.Shaders.World3D.Begin();
// SOLID PASS // SOLID PASS
//world = Matrix.Identity; world = Matrix.Identity;
world = Matrix.Scaling(new Vector3(1.0f, 1.0f, 1.2f)); //mxd. GZDoom vertical scale hack
ApplyMatrices3D(); ApplyMatrices3D();
RenderSinglePass((int)RenderPass.Solid); RenderSinglePass((int)RenderPass.Solid);
@ -539,14 +538,12 @@ namespace CodeImp.DoomBuilder.Rendering
graphics.Device.SetRenderState(RenderState.CullMode, Cull.Counterclockwise); graphics.Device.SetRenderState(RenderState.CullMode, Cull.Counterclockwise);
// MASK PASS // MASK PASS
//world = Matrix.Identity; world = Matrix.Identity;
world = Matrix.Scaling(new Vector3(1.0f, 1.0f, 1.2f)); //mxd. GZDoom vertical scale hack
ApplyMatrices3D(); ApplyMatrices3D();
RenderSinglePass((int)RenderPass.Mask); RenderSinglePass((int)RenderPass.Mask);
// ALPHA PASS // ALPHA PASS
//world = Matrix.Identity; world = Matrix.Identity;
world = Matrix.Scaling(new Vector3(1.0f, 1.0f, 1.2f)); //mxd. GZDoom vertical scale hack
ApplyMatrices3D(); ApplyMatrices3D();
graphics.Device.SetRenderState(RenderState.AlphaBlendEnable, true); graphics.Device.SetRenderState(RenderState.AlphaBlendEnable, true);
graphics.Device.SetRenderState(RenderState.AlphaTestEnable, false); graphics.Device.SetRenderState(RenderState.AlphaTestEnable, false);
@ -559,15 +556,13 @@ namespace CodeImp.DoomBuilder.Rendering
if(renderthingcages) RenderThingCages(); if(renderthingcages) RenderThingCages();
// ADDITIVE PASS // ADDITIVE PASS
//world = Matrix.Identity; world = Matrix.Identity;
world = Matrix.Scaling(new Vector3(1.0f, 1.0f, 1.2f)); //mxd. GZDoom vertical scale hack
ApplyMatrices3D(); ApplyMatrices3D();
graphics.Device.SetRenderState(RenderState.DestinationBlend, Blend.One); graphics.Device.SetRenderState(RenderState.DestinationBlend, Blend.One);
RenderSinglePass((int)RenderPass.Additive); RenderSinglePass((int)RenderPass.Additive);
//mxd. LIGHT PASS //mxd. LIGHT PASS
if (General.Settings.GZDrawLights && !fullbrightness && thingsWithLight.Count > 0 && litGeometry.Count > 0) { if (General.Settings.GZDrawLights && !fullbrightness && thingsWithLight.Count > 0 && litGeometry.Count > 0) {
world = Matrix.Scaling(new Vector3(1.0f, 1.0f, 1.2f)); //mxd. GZDoom vertical scale hack
RenderLights(litGeometry, thingsWithLight); RenderLights(litGeometry, thingsWithLight);
} }
@ -629,7 +624,7 @@ namespace CodeImp.DoomBuilder.Rendering
foreach (VisualThing t in thingsbydistance) { foreach (VisualThing t in thingsbydistance) {
// Setup matrix // Setup matrix
world = Matrix.Multiply(t.CageScales, t.ScaledPosition); //mxd. GZDoom vertical scale hack world = Matrix.Multiply(t.CageScales, t.Position);
ApplyMatrices3D(); ApplyMatrices3D();
// Setup color // Setup color
@ -650,7 +645,7 @@ namespace CodeImp.DoomBuilder.Rendering
//and arrow //and arrow
float sx = t.CageScales.M11; float sx = t.CageScales.M11;
Matrix arrowScaler = Matrix.Scaling(sx, sx, sx); //scale arrow evenly based on thing width\depth Matrix arrowScaler = Matrix.Scaling(sx, sx, sx); //scale arrow evenly based on thing width\depth
world = Matrix.Multiply(arrowScaler, t.ScaledPosition * Matrix.Translation(0.0f, 0.0f, t.CageScales.M33 / 2)); //mxd. GZDoom vertical scale hack world = Matrix.Multiply(arrowScaler, t.Position * Matrix.Translation(0.0f, 0.0f, t.CageScales.M33 / 2));
Matrix rot = Matrix.RotationZ(t.Thing.Angle - Angle2D.PI / 2); Matrix rot = Matrix.RotationZ(t.Thing.Angle - Angle2D.PI / 2);
world = Matrix.Multiply(rot, world); world = Matrix.Multiply(rot, world);
ApplyMatrices3D(); ApplyMatrices3D();
@ -860,7 +855,7 @@ namespace CodeImp.DoomBuilder.Rendering
// Create the matrix for positioning / rotation // Create the matrix for positioning / rotation
world = t.Orientation; world = t.Orientation;
if (t.Billboard) world = Matrix.Multiply(world, billboard); if (t.Billboard) world = Matrix.Multiply(world, billboard);
world = Matrix.Multiply(world, t.ScaledPosition); //mxd. GZDoom vertical scale hack world = Matrix.Multiply(world, t.Position);
ApplyMatrices3D(); ApplyMatrices3D();
//mxd. set variables for fog rendering //mxd. set variables for fog rendering
@ -896,7 +891,7 @@ namespace CodeImp.DoomBuilder.Rendering
//mxd. Dynamic lights pass! //mxd. Dynamic lights pass!
private void RenderLights(Dictionary<Texture, List<VisualGeometry>> geometry_to_lit, List<VisualThing> lights) { private void RenderLights(Dictionary<Texture, List<VisualGeometry>> geometry_to_lit, List<VisualThing> lights) {
graphics.Shaders.World3D.World = world; graphics.Shaders.World3D.World = Matrix.Identity;
graphics.Shaders.World3D.BeginPass(17); graphics.Shaders.World3D.BeginPass(17);
int i, count; int i, count;
@ -921,7 +916,7 @@ namespace CodeImp.DoomBuilder.Rendering
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (checkBBoxIntersection(g.BoundingBox, lights[i].BoundingBox)) { if (checkBBoxIntersection(g.BoundingBox, lights[i].BoundingBox)) {
lpr = new Vector4(lights[i].Center,lights[i].LightRadius) ; lpr = new Vector4(lights[i].Center, lights[i].LightRadius);
if (lpr.W == 0) if (lpr.W == 0)
continue; continue;
graphics.Shaders.World3D.LightColor = lights[i].LightColor; graphics.Shaders.World3D.LightColor = lights[i].LightColor;
@ -1023,7 +1018,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.ScaledPosition); //mxd. GZDoom vertical scale hack world = Matrix.Multiply(world, t.Position);
ApplyMatrices3D(); ApplyMatrices3D();
//mxd. set variables for fog rendering //mxd. set variables for fog rendering
@ -1160,7 +1155,7 @@ namespace CodeImp.DoomBuilder.Rendering
//t.CameraDistance3D is actually squared distance, hence (t.LightRadius * t.LightRadius) //t.CameraDistance3D is actually squared distance, hence (t.LightRadius * t.LightRadius)
if (t.CameraDistance3D < (t.LightRadius * t.LightRadius) || isThingOnScreen(t.BoundingBox)) { //always render light if camera is within it's radius if (t.CameraDistance3D < (t.LightRadius * t.LightRadius) || isThingOnScreen(t.BoundingBox)) { //always render light if camera is within it's radius
if (Array.IndexOf(GZBuilder.GZGeneral.GZ_ANIMATED_LIGHT_TYPES, t.LightType) != -1) if (Array.IndexOf(GZBuilder.GZGeneral.GZ_ANIMATED_LIGHT_TYPES, t.LightType) != -1)
t.UpdateBoundingBox();//t.UpdateBoundingBox(t.LightRadius, t.LightRadius * 2); t.UpdateBoundingBox();
thingsWithLight.Add(t); thingsWithLight.Add(t);
} }
} }

View file

@ -45,6 +45,7 @@ namespace CodeImp.DoomBuilder.Types
private EnumList list; private EnumList list;
private int value; private int value;
private int defaultValue; //mxd
#endregion #endregion
@ -61,6 +62,7 @@ namespace CodeImp.DoomBuilder.Types
// When set up for an argument // When set up for an argument
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo) public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
{ {
defaultValue = (int)arginfo.DefaultValue;//mxd
base.SetupArgument(attr, arginfo); base.SetupArgument(attr, arginfo);
// Keep enum list reference // Keep enum list reference
@ -105,6 +107,11 @@ namespace CodeImp.DoomBuilder.Types
} }
} }
//mxd
public override void SetDefaultValue() {
value = defaultValue;
}
public override object GetValue() public override object GetValue()
{ {
return this.value; return this.value;

View file

@ -42,6 +42,7 @@ namespace CodeImp.DoomBuilder.Types
private EnumList list; private EnumList list;
private EnumItem value; private EnumItem value;
private EnumItem defaultValue; //mxd
#endregion #endregion
@ -57,6 +58,7 @@ namespace CodeImp.DoomBuilder.Types
// When set up for an argument // When set up for an argument
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo) public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
{ {
defaultValue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString());//mxd
base.SetupArgument(attr, arginfo); base.SetupArgument(attr, arginfo);
// Keep enum list reference // Keep enum list reference
@ -144,6 +146,11 @@ namespace CodeImp.DoomBuilder.Types
} }
} }
//mxd
public override void SetDefaultValue() {
value = defaultValue;
}
public override object GetValue() public override object GetValue()
{ {
return GetIntValue(); return GetIntValue();

View file

@ -42,6 +42,7 @@ namespace CodeImp.DoomBuilder.Types
private EnumList list; private EnumList list;
private EnumItem value; private EnumItem value;
private EnumItem defaultValue; //mxd
#endregion #endregion
@ -57,6 +58,7 @@ namespace CodeImp.DoomBuilder.Types
// When set up for an argument // When set up for an argument
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo) public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
{ {
defaultValue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString()); //mxd
base.SetupArgument(attr, arginfo); base.SetupArgument(attr, arginfo);
// Keep enum list reference // Keep enum list reference
@ -126,6 +128,11 @@ namespace CodeImp.DoomBuilder.Types
} }
} }
//mxd
public override void SetDefaultValue() {
value = defaultValue;
}
public override object GetValue() public override object GetValue()
{ {
if(this.value != null) return this.value.Value; else return ""; if(this.value != null) return this.value.Value; else return "";

View file

@ -91,6 +91,7 @@ namespace CodeImp.DoomBuilder.Types
} }
} }
//mxd
public override void SetDefaultValue() { public override void SetDefaultValue() {
value = defaultValue; value = defaultValue;
} }

View file

@ -46,7 +46,6 @@ namespace CodeImp.DoomBuilder.VisualModes
#region ================== Constants #region ================== Constants
private const float MOVE_SPEED_MULTIPLIER = 0.001f; private const float MOVE_SPEED_MULTIPLIER = 0.001f;
private const float SCALE_OFFSET = 1f / 1.2f; //mxd GZDoom vertical scale hack
#endregion #endregion
@ -645,23 +644,9 @@ namespace CodeImp.DoomBuilder.VisualModes
#region ================== Object Picking #region ================== Object Picking
//mxd
public VisualPickResult PickObject(Vector3D from, Vector3D to) {
return PickObject(from, to, true);
}
// This picks an object from the scene // This picks an object from the scene
public VisualPickResult PickObject(Vector3D from, Vector3D to, bool scaleHack) public VisualPickResult PickObject(Vector3D from, Vector3D to)
{ {
//mxd GZDoom vertical scale hack
Vector3D from_orig = from;
Vector3D to_orig = to;
if(scaleHack) {
to.z *= SCALE_OFFSET;
from.z *= SCALE_OFFSET;
}
VisualPickResult result = new VisualPickResult(); VisualPickResult result = new VisualPickResult();
Line2D ray2d = new Line2D(from, to); Line2D ray2d = new Line2D(from, to);
Vector3D delta = to - from; Vector3D delta = to - from;
@ -823,10 +808,6 @@ namespace CodeImp.DoomBuilder.VisualModes
// Setup final result // Setup final result
result.hitpos = from + to * result.u_ray; result.hitpos = from + to * result.u_ray;
//mxd. Hackish way to select Things correctly
if(scaleHack && result.picked is VisualThing)
return PickObject(from_orig, to_orig, false);
// Done // Done
return result; return result;
} }
@ -1035,8 +1016,7 @@ namespace CodeImp.DoomBuilder.VisualModes
delta = delta.GetFixedLength(General.Settings.ViewDistance * 0.98f); delta = delta.GetFixedLength(General.Settings.ViewDistance * 0.98f);
VisualPickResult target = PickObject(start, start + delta); VisualPickResult target = PickObject(start, start + delta);
//not appropriate way to do this, but... if(target.picked != null && target.picked is VisualGeometry) {
if (target.picked != null && target.picked.GetType().Name.IndexOf("Thing") == -1) {
VisualGeometry vg = (VisualGeometry)target.picked; VisualGeometry vg = (VisualGeometry)target.picked;
if (vg.Sector != null) if (vg.Sector != null)
return vg; return vg;

View file

@ -83,7 +83,6 @@ namespace CodeImp.DoomBuilder.VisualModes
//mxd //mxd
private int cameraDistance3D; private int cameraDistance3D;
private int thingHeight; private int thingHeight;
private Matrix scaledPosition; //mxd GZDoom vertical scale hack
//mxd. light properties //mxd. light properties
private int lightType; private int lightType;
@ -125,7 +124,6 @@ namespace CodeImp.DoomBuilder.VisualModes
} }
} }
public Vector3 PositionV3 { get { return position_v3; } } public Vector3 PositionV3 { get { return position_v3; } }
public Matrix ScaledPosition { get { return scaledPosition; } } //mxd GZDoom vertical scale hack
public Vector3[] BoundingBox { get { return boundingBox; } } public Vector3[] BoundingBox { get { return boundingBox; } }
//mxd. light properties //mxd. light properties
public int LightType { get { return lightType; } } public int LightType { get { return lightType; } }
@ -187,7 +185,6 @@ namespace CodeImp.DoomBuilder.VisualModes
lightInterval = -1; lightInterval = -1;
lightColor = new Color4(); lightColor = new Color4();
boundingBox = new Vector3[9]; boundingBox = new Vector3[9];
scaledPosition = position; //mxd GZDoom vertical scale hack
// Register as resource // Register as resource
General.Map.Graphics.RegisterResource(this); General.Map.Graphics.RegisterResource(this);
@ -223,7 +220,7 @@ namespace CodeImp.DoomBuilder.VisualModes
//mxd //mxd
internal void CalculateCameraDistance3D(Vector3 campos) { internal void CalculateCameraDistance3D(Vector3 campos) {
cameraDistance3D = (int)Vector3.DistanceSquared(D3DDevice.V3(thing.Position), campos); cameraDistance3D = (int)Vector3.DistanceSquared(PositionV3, campos);
} }
// This is called before a device is reset // This is called before a device is reset
@ -271,7 +268,6 @@ namespace CodeImp.DoomBuilder.VisualModes
//mxd //mxd
position_v3 = D3DDevice.V3(pos); position_v3 = D3DDevice.V3(pos);
position = Matrix.Translation(position_v3); position = Matrix.Translation(position_v3);
scaledPosition = Matrix.Translation(position_v3.X, position_v3.Y, position_v3.Z * 1.2f); //mxd GZDoom vertical scale hack
//mxd. update bounding box //mxd. update bounding box
if (thing.IsModel) { if (thing.IsModel) {

View file

@ -2344,6 +2344,9 @@ namespace CodeImp.DoomBuilder.Windows
[BeginAction("preferences")] [BeginAction("preferences")]
internal void ShowPreferences() internal void ShowPreferences()
{ {
//mxd
bool stretchModels = General.Settings.GZStretchModels;
// Show preferences dialog // Show preferences dialog
PreferencesForm prefform = new PreferencesForm(); PreferencesForm prefform = new PreferencesForm();
if(prefform.ShowDialog(this) == DialogResult.OK) if(prefform.ShowDialog(this) == DialogResult.OK)
@ -2363,6 +2366,8 @@ namespace CodeImp.DoomBuilder.Windows
General.Map.Graphics.SetupSettings(); General.Map.Graphics.SetupSettings();
General.Map.UpdateConfiguration(); General.Map.UpdateConfiguration();
if(prefform.ReloadResources) General.Actions.InvokeAction("builder_reloadresources"); if(prefform.ReloadResources) General.Actions.InvokeAction("builder_reloadresources");
//mxd
if(stretchModels != General.Settings.GZStretchModels) General.Map.Data.ReloadModeldef();
} }
// Redraw display // Redraw display

File diff suppressed because it is too large Load diff

View file

@ -103,6 +103,7 @@ namespace CodeImp.DoomBuilder.Windows
labelDynLightSize.Text = General.Settings.GZDynamicLightRadius.ToString(); labelDynLightSize.Text = General.Settings.GZDynamicLightRadius.ToString();
tbDynLightIntensity.Value = General.Clamp((int)(General.Settings.GZDynamicLightIntensity * 10), tbDynLightIntensity.Minimum, tbDynLightIntensity.Maximum); tbDynLightIntensity.Value = General.Clamp((int)(General.Settings.GZDynamicLightIntensity * 10), tbDynLightIntensity.Minimum, tbDynLightIntensity.Maximum);
labelDynLightIntensity.Text = General.Settings.GZDynamicLightIntensity.ToString(); labelDynLightIntensity.Text = General.Settings.GZDynamicLightIntensity.ToString();
cbStretchModels.Checked = General.Settings.GZStretchModels;
// Fill fonts list // Fill fonts list
scriptfontname.BeginUpdate(); scriptfontname.BeginUpdate();
@ -274,6 +275,7 @@ namespace CodeImp.DoomBuilder.Windows
General.Settings.GZMaxDynamicLights = tbDynLightCount.Value; General.Settings.GZMaxDynamicLights = tbDynLightCount.Value;
General.Settings.GZDynamicLightRadius = ((float)tbDynLightSize.Value / 10.0f); General.Settings.GZDynamicLightRadius = ((float)tbDynLightSize.Value / 10.0f);
General.Settings.GZDynamicLightIntensity = ((float)tbDynLightIntensity.Value / 10.0f); General.Settings.GZDynamicLightIntensity = ((float)tbDynLightIntensity.Value / 10.0f);
General.Settings.GZStretchModels = cbStretchModels.Checked;
// Paste options // Paste options
General.Settings.PasteOptions = pasteoptions.GetOptions(); General.Settings.PasteOptions = pasteoptions.GetOptions();

View file

@ -141,4 +141,7 @@
<metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>