@ Fixed raising/lowering of floor/ceiling on Vavoom type 3D floors (they were reversed)

This commit is contained in:
codeimp 2010-09-16 12:09:17 +00:00
parent 7be6466f80
commit 5f1a5df50b
4 changed files with 19 additions and 16 deletions

View file

@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
protected bool changed; protected bool changed;
protected SectorLevel level; protected SectorLevel level;
protected Effect3DFloor extrafloor;
#endregion #endregion
@ -62,6 +63,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
new public BaseVisualSector Sector { get { return (BaseVisualSector)base.Sector; } } new public BaseVisualSector Sector { get { return (BaseVisualSector)base.Sector; } }
public bool Changed { get { return changed; } set { changed = value; } } public bool Changed { get { return changed; } set { changed = value; } }
public SectorLevel Level { get { return level; } } public SectorLevel Level { get { return level; } }
public Effect3DFloor ExtraFloor { get { return extrafloor; } }
#endregion #endregion
@ -102,10 +104,11 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
public virtual void ApplyLowerUnpegged(bool set) { } public virtual void ApplyLowerUnpegged(bool set) { }
// Setup this plane // Setup this plane
public bool Setup() { return this.Setup(this.level); } public bool Setup() { return this.Setup(this.level, this.extrafloor); }
public virtual bool Setup(SectorLevel level) public virtual bool Setup(SectorLevel level, Effect3DFloor extrafloor)
{ {
this.level = level; this.level = level;
this.extrafloor = extrafloor;
return false; return false;
} }

View file

@ -182,12 +182,12 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// Create floor // Create floor
floor = floor ?? new VisualFloor(mode, this); floor = floor ?? new VisualFloor(mode, this);
if(floor.Setup(data.Floor)) if(floor.Setup(data.Floor, null))
base.AddGeometry(floor); base.AddGeometry(floor);
// Create ceiling // Create ceiling
ceiling = ceiling ?? new VisualCeiling(mode, this); ceiling = ceiling ?? new VisualCeiling(mode, this);
if(ceiling.Setup(data.Ceiling)) if(ceiling.Setup(data.Ceiling, null))
base.AddGeometry(ceiling); base.AddGeometry(ceiling);
// Create 3D floors // Create 3D floors
@ -197,14 +197,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// Create a floor // Create a floor
VisualFloor vf = (i < extrafloors.Count) ? extrafloors[i] : new VisualFloor(mode, this); VisualFloor vf = (i < extrafloors.Count) ? extrafloors[i] : new VisualFloor(mode, this);
if(vf.Setup(ef.Floor)) if(vf.Setup(ef.Floor, ef))
base.AddGeometry(vf); base.AddGeometry(vf);
if(i >= extrafloors.Count) if(i >= extrafloors.Count)
extrafloors.Add(vf); extrafloors.Add(vf);
// Create a ceiling // Create a ceiling
VisualCeiling vc = (i < extraceilings.Count) ? extraceilings[i] : new VisualCeiling(mode, this); VisualCeiling vc = (i < extraceilings.Count) ? extraceilings[i] : new VisualCeiling(mode, this);
if(vc.Setup(ef.Ceiling)) if(vc.Setup(ef.Ceiling, ef))
base.AddGeometry(vc); base.AddGeometry(vc);
if(i >= extraceilings.Count) if(i >= extraceilings.Count)
extraceilings.Add(vc); extraceilings.Add(vc);

View file

@ -65,15 +65,15 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
} }
// This builds the geometry. Returns false when no geometry created. // This builds the geometry. Returns false when no geometry created.
public override bool Setup(SectorLevel level) public override bool Setup(SectorLevel level, Effect3DFloor extrafloor)
{ {
WorldVertex[] verts; WorldVertex[] verts;
WorldVertex v; WorldVertex v;
Sector s = level.sector; Sector s = level.sector;
Vector2D texscale; Vector2D texscale;
base.Setup(level); base.Setup(level, extrafloor);
// Fetch ZDoom fields // Fetch ZDoom fields
float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationceiling", 0.0f)); float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationceiling", 0.0f));
Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningceiling", 0.0f), Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningceiling", 0.0f),
@ -165,7 +165,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// This changes the height // This changes the height
protected override void ChangeHeight(int amount) protected override void ChangeHeight(int amount)
{ {
if(level.sector == Sector.Sector) if((extrafloor == null) || extrafloor.VavoomType)
{ {
mode.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, level.sector.FixedIndex); mode.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, level.sector.FixedIndex);
level.sector.CeilHeight += amount; level.sector.CeilHeight += amount;

View file

@ -65,14 +65,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
} }
// This builds the geometry. Returns false when no geometry created. // This builds the geometry. Returns false when no geometry created.
public override bool Setup(SectorLevel level) public override bool Setup(SectorLevel level, Effect3DFloor extrafloor)
{ {
WorldVertex[] verts; WorldVertex[] verts;
Sector s = level.sector; Sector s = level.sector;
Vector2D texscale; Vector2D texscale;
base.Setup(level); base.Setup(level, extrafloor);
// Fetch ZDoom fields // Fetch ZDoom fields
float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationfloor", 0.0f)); float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationfloor", 0.0f));
Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningfloor", 0.0f), Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningfloor", 0.0f),
@ -152,7 +152,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// This changes the height // This changes the height
protected override void ChangeHeight(int amount) protected override void ChangeHeight(int amount)
{ {
if(level.sector == Sector.Sector) if((extrafloor == null) || extrafloor.VavoomType)
{ {
mode.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, level.sector.FixedIndex); mode.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, level.sector.FixedIndex);
level.sector.FloorHeight += amount; level.sector.FloorHeight += amount;