mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
UDMF vertex offsets ("zfloor" and "zceiling") were rendered incorrectly.
Rendering of (G)ZDoom rendering effects (slopes, 3D-floors etc.) can now be toggled in GZDoom Visual mode (default key is "Tab", action is Visual modes -> Toggle GZDoom rendering effects)
This commit is contained in:
parent
323c098b17
commit
c018e05805
3 changed files with 35 additions and 5 deletions
|
@ -33,4 +33,14 @@ ceilingalignmode
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglegzdoomrenderingeffects
|
||||||
|
{
|
||||||
|
title = "Toggle GZDoom rendering effects";
|
||||||
|
category = "visual";
|
||||||
|
description = "Toggles rendering of GZDoom rendering effects (slopes, 3D-floors etc.) in GZDoom Visual mode.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = false;
|
||||||
|
default = 9; //Tab
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
||||||
private List<IVisualEventReceiver> selectedobjects;
|
private List<IVisualEventReceiver> selectedobjects;
|
||||||
//mxd. Used in Cut/PasteSelection actions
|
//mxd. Used in Cut/PasteSelection actions
|
||||||
private List<ThingCopyData> copyBuffer;
|
private List<ThingCopyData> copyBuffer;
|
||||||
|
private static bool gzdoomRenderingEffects = true; //mxd
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -561,9 +562,18 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
||||||
// This requires that the blockmap is up-to-date!
|
// This requires that the blockmap is up-to-date!
|
||||||
internal void RebuildElementData()
|
internal void RebuildElementData()
|
||||||
{
|
{
|
||||||
Dictionary<int, List<Sector>> sectortags = new Dictionary<int, List<Sector>>();
|
//mxd
|
||||||
sectordata = new Dictionary<Sector, SectorData>(General.Map.Map.Sectors.Count);
|
if (!gzdoomRenderingEffects && sectordata != null && sectordata.Count > 0) {
|
||||||
thingdata = new Dictionary<Thing,ThingData>(General.Map.Map.Things.Count);
|
//rebuild sectors with effects
|
||||||
|
foreach (KeyValuePair<Sector, SectorData> group in sectordata)
|
||||||
|
group.Value.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<int, List<Sector>> sectortags = new Dictionary<int, List<Sector>>();
|
||||||
|
sectordata = new Dictionary<Sector, SectorData>(General.Map.Map.Sectors.Count);
|
||||||
|
thingdata = new Dictionary<Thing, ThingData>(General.Map.Map.Things.Count);
|
||||||
|
|
||||||
|
if (!gzdoomRenderingEffects) return; //mxd
|
||||||
|
|
||||||
// Find all sector who's tag is not 0 and hash them so that we can find them quicly
|
// Find all sector who's tag is not 0 and hash them so that we can find them quicly
|
||||||
foreach(Sector s in General.Map.Map.Sectors)
|
foreach(Sector s in General.Map.Map.Sectors)
|
||||||
|
@ -1832,6 +1842,15 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
||||||
|
|
||||||
PostAction();
|
PostAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mxd
|
||||||
|
[BeginAction("togglegzdoomrenderingeffects")]
|
||||||
|
public void ToggleGZDoomRenderingEffects() {
|
||||||
|
gzdoomRenderingEffects = !gzdoomRenderingEffects;
|
||||||
|
RebuildElementData();
|
||||||
|
UpdateChangedObjects();
|
||||||
|
General.Interface.DisplayStatus(StatusType.Info, "(G)ZDoom rendering effects are " + (gzdoomRenderingEffects ? "ENABLED" : "DISABLED"));
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,13 +45,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing {
|
||||||
//check ceiling
|
//check ceiling
|
||||||
if (vertices[index].Fields.ContainsKey("zceiling")) {
|
if (vertices[index].Fields.ContainsKey("zceiling")) {
|
||||||
//yes, some things work in strange and mysterious ways in zdoom...
|
//yes, some things work in strange and mysterious ways in zdoom...
|
||||||
ceilingVerts[index].z = floorVerts[index].z + (float)vertices[index].Fields["zceiling"].Value;
|
ceilingVerts[index].z = (float)vertices[index].Fields["zceiling"].Value;
|
||||||
ceilingChanged = true;
|
ceilingChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//and floor ceiling
|
//and floor ceiling
|
||||||
if (vertices[index].Fields.ContainsKey("zfloor")) {
|
if (vertices[index].Fields.ContainsKey("zfloor")) {
|
||||||
floorVerts[index].z += (float)vertices[index].Fields["zfloor"].Value;
|
//yes, some things work in strange and mysterious ways in zdoom...
|
||||||
|
floorVerts[index].z = (float)vertices[index].Fields["zfloor"].Value;
|
||||||
floorChanged = true;
|
floorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue