mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
Added actions to move the camera up and down in 3D visual modes (no default keys bound)
@ more fixes for auto-aligning hi-res textures: now takes the WorldPanning flag into account
This commit is contained in:
parent
b1d34b1af5
commit
72d688f8d0
10 changed files with 63 additions and 9 deletions
|
@ -42,13 +42,14 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Constructor / Disposer
|
||||
|
||||
// Constructor
|
||||
public HighResImage(string name, int width, int height, float scalex, float scaley)
|
||||
public HighResImage(string name, int width, int height, float scalex, float scaley, bool worldpanning)
|
||||
{
|
||||
// Initialize
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.scale.x = scalex;
|
||||
this.scale.y = scaley;
|
||||
this.worldpanning = worldpanning;
|
||||
this.patches = new List<TexturePatch>();
|
||||
SetName(name);
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
protected int width;
|
||||
protected int height;
|
||||
protected Vector2D scale;
|
||||
protected bool worldpanning;
|
||||
protected bool usecolorcorrection;
|
||||
|
||||
// Loading
|
||||
|
@ -96,6 +97,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public float ScaledWidth { get { return width * scale.x; } }
|
||||
public float ScaledHeight { get { return height * scale.y; } }
|
||||
public Vector2D Scale { get { return scale; } }
|
||||
public bool WorldPanning { get { return worldpanning; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1548,8 +1548,8 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
public static void AutoAlignTextures(Sidedef start, ImageData texture, bool alignx, bool aligny, bool resetsidemarks)
|
||||
{
|
||||
Stack<SidedefAlignJob> todo = new Stack<SidedefAlignJob>(50);
|
||||
float scalex = General.Map.Config.ScaledTextureOffsets ? texture.Scale.x : 1.0f;
|
||||
float scaley = General.Map.Config.ScaledTextureOffsets ? texture.Scale.y : 1.0f;
|
||||
float scalex = (General.Map.Config.ScaledTextureOffsets && !texture.WorldPanning) ? texture.Scale.x : 1.0f;
|
||||
float scaley = (General.Map.Config.ScaledTextureOffsets && !texture.WorldPanning) ? texture.Scale.y : 1.0f;
|
||||
|
||||
// Mark all sidedefs false (they will be marked true when the texture is aligned)
|
||||
if(resetsidemarks) General.Map.Map.ClearMarkedSidedefs(false);
|
||||
|
|
|
@ -419,6 +419,28 @@ moveright
|
|||
disregardshift = true;
|
||||
}
|
||||
|
||||
moveup
|
||||
{
|
||||
title = "Move Up";
|
||||
category = "visual";
|
||||
description = "Moves the camera up in 3D Visual Mode.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
disregardshift = true;
|
||||
}
|
||||
|
||||
movedown
|
||||
{
|
||||
title = "Move Down";
|
||||
category = "visual";
|
||||
description = "Moves the camera down in 3D Visual Mode.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
disregardshift = true;
|
||||
}
|
||||
|
||||
movedoublespeed
|
||||
{
|
||||
title = "Double Speed";
|
||||
|
|
|
@ -67,6 +67,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
private bool keybackward;
|
||||
private bool keyleft;
|
||||
private bool keyright;
|
||||
private bool keyup;
|
||||
private bool keydown;
|
||||
private bool doublespeed;
|
||||
|
||||
// Map
|
||||
|
@ -274,6 +276,30 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
keyright = false;
|
||||
}
|
||||
|
||||
[BeginAction("moveup", BaseAction = true)]
|
||||
public virtual void BeginMoveUp()
|
||||
{
|
||||
keyup = true;
|
||||
}
|
||||
|
||||
[EndAction("moveup", BaseAction = true)]
|
||||
public virtual void EndMoveUp()
|
||||
{
|
||||
keyup = false;
|
||||
}
|
||||
|
||||
[BeginAction("movedown", BaseAction = true)]
|
||||
public virtual void BeginMoveDown()
|
||||
{
|
||||
keydown = true;
|
||||
}
|
||||
|
||||
[EndAction("movedown", BaseAction = true)]
|
||||
public virtual void EndMoveDown()
|
||||
{
|
||||
keydown = false;
|
||||
}
|
||||
|
||||
[BeginAction("movedoublespeed", BaseAction = true)]
|
||||
public virtual void BeginDoubleSpeed()
|
||||
{
|
||||
|
@ -795,13 +821,16 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
Vector3D camvecstrafe = Vector3D.FromAngleXY(General.Map.VisualCamera.AngleXY + Angle2D.PIHALF);
|
||||
Vector3D cammovemul = General.Map.VisualCamera.MoveMultiplier;
|
||||
Vector3D camdeltapos = new Vector3D();
|
||||
|
||||
Vector3D upvec = new Vector3D(0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Move the camera
|
||||
if(doublespeed) multiplier = MOVE_SPEED_MULTIPLIER * 2.0f; else multiplier = MOVE_SPEED_MULTIPLIER;
|
||||
if(keyforward) camdeltapos += camvec * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
if(keybackward) camdeltapos -= camvec * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
if(keyleft) camdeltapos -= camvecstrafe * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
if(keyright) camdeltapos += camvecstrafe * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
if(keyup) camdeltapos += upvec * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
if(keydown) camdeltapos += -upvec * cammovemul * (float)((double)General.Settings.MoveSpeed * multiplier * deltatime);
|
||||
|
||||
// Move the camera
|
||||
General.Map.VisualCamera.ProcessMovement(camdeltapos);
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(yscale == 0.0f) scaley = defaultscale; else scaley = 1f / yscale;
|
||||
|
||||
// Make texture
|
||||
HighResImage tex = new HighResImage(name, width, height, scalex, scaley);
|
||||
HighResImage tex = new HighResImage(name, width, height, scalex, scaley, worldpanning);
|
||||
|
||||
// Add patches
|
||||
foreach(PatchStructure p in patches)
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
t2.y = t1.y + geoheight;
|
||||
|
||||
// Apply texture offset
|
||||
if (General.Map.Config.ScaledTextureOffsets)
|
||||
if (General.Map.Config.ScaledTextureOffsets && !base.Texture.WorldPanning)
|
||||
{
|
||||
t1 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
t2 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
t1.y = cliptop;
|
||||
t2.y = tsz.y - clipbottom;
|
||||
|
||||
if (General.Map.Config.ScaledTextureOffsets)
|
||||
if (General.Map.Config.ScaledTextureOffsets && !base.Texture.WorldPanning)
|
||||
{
|
||||
t1.x = Sidedef.OffsetX * base.Texture.Scale.x;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
t2.y = t1.y + geoheight;
|
||||
|
||||
// Apply texture offset
|
||||
if (General.Map.Config.ScaledTextureOffsets)
|
||||
if (General.Map.Config.ScaledTextureOffsets && !base.Texture.WorldPanning)
|
||||
{
|
||||
t1 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
t2 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
t2.y = t1.y + geoheight;
|
||||
|
||||
// Apply texture offset
|
||||
if (General.Map.Config.ScaledTextureOffsets)
|
||||
if (General.Map.Config.ScaledTextureOffsets && !base.Texture.WorldPanning)
|
||||
{
|
||||
t1 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
t2 += new Vector2D(Sidedef.OffsetX * base.Texture.Scale.x, Sidedef.OffsetY * base.Texture.Scale.y);
|
||||
|
|
Loading…
Reference in a new issue