mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
//mxd. Used in Cut/PasteSelection actions
|
||||
private List<ThingCopyData> copyBuffer;
|
||||
private static bool gzdoomRenderingEffects = true; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -561,9 +562,18 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
// This requires that the blockmap is up-to-date!
|
||||
internal void RebuildElementData()
|
||||
{
|
||||
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);
|
||||
//mxd
|
||||
if (!gzdoomRenderingEffects && sectordata != null && sectordata.Count > 0) {
|
||||
//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
|
||||
foreach(Sector s in General.Map.Map.Sectors)
|
||||
|
@ -1832,6 +1842,15 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -45,13 +45,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing {
|
|||
//check ceiling
|
||||
if (vertices[index].Fields.ContainsKey("zceiling")) {
|
||||
//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;
|
||||
}
|
||||
|
||||
//and floor ceiling
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue