mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-01-30 20:50:41 +00:00
Revert "Fix geometry constantly being rebuilt in some situations"
This reverts commit 4f4f074c3f
.
This commit is contained in:
parent
a74ce69297
commit
8c12299583
3 changed files with 35 additions and 49 deletions
|
@ -55,11 +55,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
internal List<VisualGeometry> FixedGeometry { get { return fixedgeometry; } }
|
internal List<VisualGeometry> FixedGeometry { get { return fixedgeometry; } }
|
||||||
internal List<VisualGeometry> AllGeometry { get { return allgeometry; } }
|
internal List<VisualGeometry> AllGeometry { get { return allgeometry; } }
|
||||||
internal VertexBuffer GeometryBuffer { get { return geobuffer; } }
|
internal VertexBuffer GeometryBuffer { get { return geobuffer; } }
|
||||||
internal bool NeedsUpdateGeo
|
internal bool NeedsUpdateGeo { get { return updategeo; } set { updategeo |= value; } }
|
||||||
{
|
|
||||||
get { return updategeo; }
|
|
||||||
set { updategeo |= value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsDisposed { get { return isdisposed; } }
|
public bool IsDisposed { get { return isdisposed; } }
|
||||||
public Sector Sector { get { return sector; } }
|
public Sector Sector { get { return sector; } }
|
||||||
|
@ -111,7 +107,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
// Trash geometry buffer
|
// Trash geometry buffer
|
||||||
if(geobuffer != null) geobuffer.Dispose();
|
if(geobuffer != null) geobuffer.Dispose();
|
||||||
geobuffer = null;
|
geobuffer = null;
|
||||||
NeedsUpdateGeo = true;
|
updategeo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called resets when the device is reset
|
// This is called resets when the device is reset
|
||||||
|
@ -173,7 +169,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AddGeometry(VisualGeometry geo)
|
public void AddGeometry(VisualGeometry geo)
|
||||||
{
|
{
|
||||||
NeedsUpdateGeo = true;
|
updategeo = true;
|
||||||
allgeometry.Add(geo);
|
allgeometry.Add(geo);
|
||||||
if(geo.Sidedef != null)
|
if(geo.Sidedef != null)
|
||||||
{
|
{
|
||||||
|
@ -195,7 +191,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
allgeometry.Clear();
|
allgeometry.Clear();
|
||||||
fixedgeometry.Clear();
|
fixedgeometry.Clear();
|
||||||
sidedefgeometry.Clear();
|
sidedefgeometry.Clear();
|
||||||
NeedsUpdateGeo = true;
|
updategeo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This gets the geometry list for the specified sidedef
|
// This gets the geometry list for the specified sidedef
|
||||||
|
|
|
@ -44,12 +44,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
protected readonly BaseVisualMode mode;
|
protected readonly BaseVisualMode mode;
|
||||||
protected long setuponloadedtexture;
|
protected long setuponloadedtexture;
|
||||||
private long lastsetuponloadedtexture;
|
|
||||||
|
|
||||||
// This is only used to see if this object has already received a change
|
// This is only used to see if this object has already received a change
|
||||||
// in a multiselection. The Changed property on the BaseVisualSector is
|
// in a multiselection. The Changed property on the BaseVisualSector is
|
||||||
// used to indicate a rebuild is needed.
|
// used to indicate a rebuild is needed.
|
||||||
protected bool changed;
|
protected bool changed;
|
||||||
|
|
||||||
protected SectorLevel level;
|
protected SectorLevel level;
|
||||||
protected Effect3DFloor extrafloor;
|
protected Effect3DFloor extrafloor;
|
||||||
|
@ -611,21 +610,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnProcess(long deltatime)
|
public virtual void OnProcess(long deltatime)
|
||||||
{
|
{
|
||||||
// If the texture was not loaded, but is loaded now, then re-setup geometry
|
// If the texture was not loaded, but is loaded now, then re-setup geometry
|
||||||
if(setuponloadedtexture != lastsetuponloadedtexture)
|
if(setuponloadedtexture != 0)
|
||||||
{
|
{
|
||||||
if (setuponloadedtexture != 0)
|
ImageData t = General.Map.Data.GetFlatImage(setuponloadedtexture);
|
||||||
{
|
if(t != null)
|
||||||
ImageData t = General.Map.Data.GetFlatImage(setuponloadedtexture);
|
{
|
||||||
if (t != null && t.IsImageLoaded)
|
if(t.IsImageLoaded)
|
||||||
{
|
{
|
||||||
lastsetuponloadedtexture = setuponloadedtexture;
|
setuponloadedtexture = 0;
|
||||||
Setup();
|
Setup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
lastsetuponloadedtexture = setuponloadedtexture;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,10 +48,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
protected Plane top;
|
protected Plane top;
|
||||||
protected Plane bottom;
|
protected Plane bottom;
|
||||||
protected long setuponloadedtexture;
|
protected long setuponloadedtexture;
|
||||||
private long lastsetuponloadedtexture;
|
|
||||||
|
// UV dragging
|
||||||
// UV dragging
|
private float dragstartanglexy;
|
||||||
private float dragstartanglexy;
|
|
||||||
private float dragstartanglez;
|
private float dragstartanglez;
|
||||||
private Vector3D dragorigin;
|
private Vector3D dragorigin;
|
||||||
private Vector3D deltaxy;
|
private Vector3D deltaxy;
|
||||||
|
@ -835,24 +834,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Processing
|
// Processing
|
||||||
public virtual void OnProcess(long deltatime)
|
public virtual void OnProcess(long deltatime)
|
||||||
{
|
{
|
||||||
// If the texture was not loaded, but is loaded now, then re-setup geometry
|
// If the texture was not loaded, but is loaded now, then re-setup geometry
|
||||||
if (setuponloadedtexture != lastsetuponloadedtexture)
|
if(setuponloadedtexture != 0)
|
||||||
{
|
{
|
||||||
if (setuponloadedtexture != 0)
|
ImageData t = General.Map.Data.GetTextureImage(setuponloadedtexture);
|
||||||
{
|
if(t != null)
|
||||||
ImageData t = General.Map.Data.GetTextureImage(setuponloadedtexture);
|
{
|
||||||
if (t != null && t.IsImageLoaded)
|
if(t.IsImageLoaded)
|
||||||
{
|
{
|
||||||
lastsetuponloadedtexture = setuponloadedtexture;
|
setuponloadedtexture = 0;
|
||||||
Setup();
|
Setup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
lastsetuponloadedtexture = setuponloadedtexture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change target height
|
// Change target height
|
||||||
public virtual void OnChangeTargetHeight(int amount)
|
public virtual void OnChangeTargetHeight(int amount)
|
||||||
|
|
Loading…
Reference in a new issue