Fixed, Classic modes, UDMF: grid size didn't go below 1 mu. when zooming in when "Dynamic grid size" option was enabled.

Internal: restored GridSetup DB2 compatibility.
Updated ZDoom_ACS.cfg (SetFogDensity, SetSectorGlow).
This commit is contained in:
MaxED 2017-01-06 13:01:59 +03:00
parent bd74d1d35e
commit cd854779e8
17 changed files with 66 additions and 61 deletions

View file

@ -367,6 +367,7 @@ keywords
SetCVar = "bool SetCVar(str cvar, int value)\nSets the value of a particular console variable.\nOnly mod-defined console variables through CVARINFO can be changed by using this function.\nReturns FALSE if cvar is invalid, or it is not writable."; SetCVar = "bool SetCVar(str cvar, int value)\nSets the value of a particular console variable.\nOnly mod-defined console variables through CVARINFO can be changed by using this function.\nReturns FALSE if cvar is invalid, or it is not writable.";
SetCVarString = "bool SetCVarString(str cvar, str value)\nSets the value of a particular console variable.\nOnly mod-defined console variables through CVARINFO can be changed by using this function.\nReturns FALSE if cvar is invalid, or it is not writable."; SetCVarString = "bool SetCVarString(str cvar, str value)\nSets the value of a particular console variable.\nOnly mod-defined console variables through CVARINFO can be changed by using this function.\nReturns FALSE if cvar is invalid, or it is not writable.";
SetFloorTrigger = "SetFloorTrigger(tag, height, special, arg1, arg2, arg3, arg4, arg5)"; SetFloorTrigger = "SetFloorTrigger(tag, height, special, arg1, arg2, arg3, arg4, arg5)";
SetFogDensity = "void SetFogDensity(int tag, int density)";
SetFont = "void SetFont(str fontlump)\nSets the current font (only within the script) to fontlump"; SetFont = "void SetFont(str fontlump)\nSets the current font (only within the script) to fontlump";
SetGlobalFogParameter = "SetGlobalFogParameter(property, value)"; SetGlobalFogParameter = "SetGlobalFogParameter(property, value)";
SetGravity = "void SetGravity(fixed amount)\nThis function sets the global gravity of an entire level.\nDefault is 800.0"; SetGravity = "void SetGravity(fixed amount)\nThis function sets the global gravity of an entire level.\nDefault is 800.0";
@ -387,6 +388,7 @@ keywords
SetPointer = "bool SetPointer(int assign_slot, int tid[, int pointer_selector[, int flags]])\nSet the value of one of the caller's stored pointers."; SetPointer = "bool SetPointer(int assign_slot, int tid[, int pointer_selector[, int flags]])\nSet the value of one of the caller's stored pointers.";
SetResultValue = "void SetResultValue(int value)"; SetResultValue = "void SetResultValue(int value)";
SetSectorDamage = "fixed SetSectorDamage(int tag, int amount, str damagetype, int interval, int leaky)"; SetSectorDamage = "fixed SetSectorDamage(int tag, int amount, str damagetype, int interval, int leaky)";
SetSectorGlow = "void SetSectorGlow(int tag, int ceiling, int r, int g, int b, int height)";
SetSectorTerrain = "fixed SetSectorTerrain(int tag, int plane, str terraintype)"; SetSectorTerrain = "fixed SetSectorTerrain(int tag, int plane, str terraintype)";
SetSkyScrollSpeed = "void SetSkyScrollSpeed(int sky, fixed skyspeed)\nChanges the scrolling speed of a sky.\nThis is useful in conjunction with ChangeSky.\nsky: either 1 or 2.\nskyspeed: the desired scrolling speed."; SetSkyScrollSpeed = "void SetSkyScrollSpeed(int sky, fixed skyspeed)\nChanges the scrolling speed of a sky.\nThis is useful in conjunction with ChangeSky.\nsky: either 1 or 2.\nskyspeed: the desired scrolling speed.";
SetThingSpecial = "void SetThingSpecial(int tid, int special[, int arg0[, int arg1[, int arg2[, int arg3[, int arg4]]]]])\nSets the special for any things with the same TID.\nThis is similar to Thing_SetSpecial, except it can only be used from ACS,\nand it can set all of a thing's special arguments.\nIf tid is 0, then the activator is used."; SetThingSpecial = "void SetThingSpecial(int tid, int special[, int arg0[, int arg1[, int arg2[, int arg3[, int arg4]]]]])\nSets the special for any things with the same TID.\nThis is similar to Thing_SetSpecial, except it can only be used from ACS,\nand it can set all of a thing's special arguments.\nIf tid is 0, then the activator is used.";

View file

@ -304,7 +304,9 @@ namespace CodeImp.DoomBuilder.Editing
General.Map.Graphics.RenderTarget.ClientSize.Height); General.Map.Graphics.RenderTarget.ClientSize.Height);
Vector2D clientscale = clientsize / renderer2d.Scale; Vector2D clientscale = clientsize / renderer2d.Scale;
int targetsize = (int)Math.Ceiling(Math.Min(clientscale.x, clientscale.y) / 32) * 8;
// Aim for 32 grid lines on screen, multiplied by 8 to support integer representation of 0.125 grid size (clientscale / 32 * 8)
int targetsize = (int)Math.Ceiling(Math.Min(clientscale.x, clientscale.y) / 4);
// Convert to nearest power of 2 // Convert to nearest power of 2
targetsize--; targetsize--;

View file

@ -46,9 +46,9 @@ namespace CodeImp.DoomBuilder.Editing
#region ================== Variables #region ================== Variables
// Grid // Grid
private int gridsizei; private int gridsize;
private float gridsize; private float gridsizef;
private float gridsizeinv; private float gridsizefinv;
// Background // Background
private string background = ""; private string background = "";
@ -64,8 +64,8 @@ namespace CodeImp.DoomBuilder.Editing
#region ================== Properties #region ================== Properties
public int GridSizeI { get { return gridsizei; } } //mxd public int GridSize { get { return gridsize; } } //mxd
public float GridSize { get { return gridsize; } } public float GridSizeF { get { return gridsizef; } }
internal string BackgroundName { get { return background; } } internal string BackgroundName { get { return background; } }
internal int BackgroundSource { get { return backsource; } } internal int BackgroundSource { get { return backsource; } }
internal ImageData Background { get { return backimage; } } internal ImageData Background { get { return backimage; } }
@ -127,7 +127,7 @@ namespace CodeImp.DoomBuilder.Editing
cfg.WriteSetting(path + ".backoffsety", backoffsety); cfg.WriteSetting(path + ".backoffsety", backoffsety);
cfg.WriteSetting(path + ".backscalex", (int)(backscalex * 100.0f)); cfg.WriteSetting(path + ".backscalex", (int)(backscalex * 100.0f));
cfg.WriteSetting(path + ".backscaley", (int)(backscaley * 100.0f)); cfg.WriteSetting(path + ".backscaley", (int)(backscaley * 100.0f));
cfg.WriteSetting(path + ".gridsize", gridsize); cfg.WriteSetting(path + ".gridsize", gridsizef);
} }
// Read settings from configuration // Read settings from configuration
@ -140,10 +140,10 @@ namespace CodeImp.DoomBuilder.Editing
backoffsety = cfg.ReadSetting(path + ".backoffsety", 0); backoffsety = cfg.ReadSetting(path + ".backoffsety", 0);
backscalex = cfg.ReadSetting(path + ".backscalex", 100) / 100.0f; backscalex = cfg.ReadSetting(path + ".backscalex", 100) / 100.0f;
backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f; backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f;
gridsize = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE); gridsizef = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE);
// Setup // Setup
SetGridSize(gridsize); SetGridSize(gridsizef);
LinkBackground(); LinkBackground();
} }
@ -154,12 +154,12 @@ namespace CodeImp.DoomBuilder.Editing
size = Math.Max(size, ((General.Map != null && General.Map.UDMF) ? MINIMUM_GRID_SIZE_UDMF : MINIMUM_GRID_SIZE)); size = Math.Max(size, ((General.Map != null && General.Map.UDMF) ? MINIMUM_GRID_SIZE_UDMF : MINIMUM_GRID_SIZE));
// Change grid // Change grid
gridsize = size; gridsizef = size;
gridsizei = (int)Math.Max(1, Math.Round(gridsize)); //mxd gridsize = (int)Math.Max(1, Math.Round(gridsizef)); //mxd
gridsizeinv = 1f / gridsize; gridsizefinv = 1f / gridsizef;
// Update in main window // Update in main window
General.MainWindow.UpdateGrid(gridsize); General.MainWindow.UpdateGrid(gridsizef);
} }
// This sets the background // This sets the background
@ -214,19 +214,19 @@ namespace CodeImp.DoomBuilder.Editing
// This returns the next higher coordinate // This returns the next higher coordinate
public float GetHigher(float offset) public float GetHigher(float offset)
{ {
return (float)Math.Round((offset + (gridsize * 0.5f)) * gridsizeinv) * gridsize; return (float)Math.Round((offset + (gridsizef * 0.5f)) * gridsizefinv) * gridsizef;
} }
// This returns the next lower coordinate // This returns the next lower coordinate
public float GetLower(float offset) public float GetLower(float offset)
{ {
return (float)Math.Round((offset - (gridsize * 0.5f)) * gridsizeinv) * gridsize; return (float)Math.Round((offset - (gridsizef * 0.5f)) * gridsizefinv) * gridsizef;
} }
// This snaps to the nearest grid coordinate // This snaps to the nearest grid coordinate
public Vector2D SnappedToGrid(Vector2D v) public Vector2D SnappedToGrid(Vector2D v)
{ {
return SnappedToGrid(v, gridsize, gridsizeinv); return SnappedToGrid(v, gridsizef, gridsizefinv);
} }
// This snaps to the nearest grid coordinate // This snaps to the nearest grid coordinate
@ -270,13 +270,13 @@ namespace CodeImp.DoomBuilder.Editing
{ {
//mxd. Not lower than 0.125 in UDMF or 1 otherwise //mxd. Not lower than 0.125 in UDMF or 1 otherwise
float preminsize = (General.Map.UDMF ? MINIMUM_GRID_SIZE_UDMF * 2 : MINIMUM_GRID_SIZE * 2); float preminsize = (General.Map.UDMF ? MINIMUM_GRID_SIZE_UDMF * 2 : MINIMUM_GRID_SIZE * 2);
if(gridsize >= preminsize) if(gridsizef >= preminsize)
{ {
//mxd. Disable automatic grid resizing //mxd. Disable automatic grid resizing
General.MainWindow.DisableDynamicGridResize(); General.MainWindow.DisableDynamicGridResize();
// Change grid // Change grid
SetGridSize(gridsize / 2); SetGridSize(gridsizef / 2);
// Redraw display // Redraw display
General.MainWindow.RedrawDisplay(); General.MainWindow.RedrawDisplay();
@ -289,13 +289,13 @@ namespace CodeImp.DoomBuilder.Editing
internal void IncreaseGrid() internal void IncreaseGrid()
{ {
// Not higher than 1024 // Not higher than 1024
if(gridsize <= 512) if(gridsizef <= 512)
{ {
//mxd. Disable automatic grid resizing //mxd. Disable automatic grid resizing
General.MainWindow.DisableDynamicGridResize(); General.MainWindow.DisableDynamicGridResize();
// Change grid // Change grid
SetGridSize(gridsize * 2); SetGridSize(gridsizef * 2);
// Redraw display // Redraw display
General.MainWindow.RedrawDisplay(); General.MainWindow.RedrawDisplay();

View file

@ -936,7 +936,7 @@ namespace CodeImp.DoomBuilder.Map
float gx = General.Map.Grid.GetHigher(minx) + gridoffset.x; float gx = General.Map.Grid.GetHigher(minx) + gridoffset.x;
if(gx < maxx) if(gx < maxx)
{ {
for(; gx < maxx; gx += General.Map.Grid.GridSize) for(; gx < maxx; gx += General.Map.Grid.GridSizeF)
{ {
// Add intersection point at this x coordinate // Add intersection point at this x coordinate
float u = (gx - minx) / (maxx - minx); float u = (gx - minx) / (maxx - minx);
@ -951,7 +951,7 @@ namespace CodeImp.DoomBuilder.Map
float gy = General.Map.Grid.GetHigher(miny) + gridoffset.y; float gy = General.Map.Grid.GetHigher(miny) + gridoffset.y;
if(gy < maxy) if(gy < maxy)
{ {
for(; gy < maxy; gy += General.Map.Grid.GridSize) for(; gy < maxy; gy += General.Map.Grid.GridSizeF)
{ {
// Add intersection point at this y coordinate // Add intersection point at this y coordinate
float u = (gy - miny) / (maxy - miny); float u = (gy - miny) / (maxy - miny);

View file

@ -813,7 +813,7 @@ namespace CodeImp.DoomBuilder.Rendering
private unsafe void RenderBackgroundGrid() private unsafe void RenderBackgroundGrid()
{ {
// Do we need to redraw grid? // Do we need to redraw grid?
if(lastgridsize != General.Map.Grid.GridSize || lastgridscale != scale || if(lastgridsize != General.Map.Grid.GridSizeF || lastgridscale != scale ||
lastgridx != offsetx || lastgridy != offsety || drawmapcenter != lastdrawmapcenter) lastgridx != offsetx || lastgridy != offsety || drawmapcenter != lastdrawmapcenter)
{ {
// Lock background rendertarget memory // Lock background rendertarget memory
@ -826,10 +826,10 @@ namespace CodeImp.DoomBuilder.Rendering
if(General.Settings.RenderGrid) //mxd if(General.Settings.RenderGrid) //mxd
{ {
// Render normal grid // Render normal grid
RenderGrid(General.Map.Grid.GridSize, General.Colors.Grid, gridplotter); RenderGrid(General.Map.Grid.GridSizeF, General.Colors.Grid, gridplotter);
// Render 64 grid // Render 64 grid
if(General.Map.Grid.GridSize <= 64) RenderGrid(64f, General.Colors.Grid64, gridplotter); if(General.Map.Grid.GridSizeF <= 64) RenderGrid(64f, General.Colors.Grid64, gridplotter);
} }
else else
{ {
@ -858,7 +858,7 @@ namespace CodeImp.DoomBuilder.Rendering
backtex.UnlockRectangle(0); backtex.UnlockRectangle(0);
lockedrect.Data.Dispose(); lockedrect.Data.Dispose();
lastgridscale = scale; lastgridscale = scale;
lastgridsize = General.Map.Grid.GridSize; lastgridsize = General.Map.Grid.GridSizeF;
lastgridx = offsetx; lastgridx = offsetx;
lastgridy = offsety; lastgridy = offsety;
lastdrawmapcenter = drawmapcenter; //mxd lastdrawmapcenter = drawmapcenter; //mxd

View file

@ -438,25 +438,25 @@ namespace CodeImp.DoomBuilder.VisualModes
[BeginAction("movethingleft", BaseAction = true)] [BeginAction("movethingleft", BaseAction = true)]
protected void MoveSelectedThingsLeft() protected void MoveSelectedThingsLeft()
{ {
MoveSelectedThings(new Vector2D(0f, -General.Map.Grid.GridSize), false); MoveSelectedThings(new Vector2D(0f, -General.Map.Grid.GridSizeF), false);
} }
//mxd //mxd
[BeginAction("movethingright", BaseAction = true)] [BeginAction("movethingright", BaseAction = true)]
protected void MoveSelectedThingsRight() protected void MoveSelectedThingsRight()
{ {
MoveSelectedThings(new Vector2D(0f, General.Map.Grid.GridSize), false); MoveSelectedThings(new Vector2D(0f, General.Map.Grid.GridSizeF), false);
} }
//mxd //mxd
[BeginAction("movethingfwd", BaseAction = true)] [BeginAction("movethingfwd", BaseAction = true)]
protected void MoveSelectedThingsForward() protected void MoveSelectedThingsForward()
{ {
MoveSelectedThings(new Vector2D(-General.Map.Grid.GridSize, 0f), false); MoveSelectedThings(new Vector2D(-General.Map.Grid.GridSizeF, 0f), false);
} }
//mxd //mxd
[BeginAction("movethingback", BaseAction = true)] [BeginAction("movethingback", BaseAction = true)]
protected void MoveSelectedThingsBackward() protected void MoveSelectedThingsBackward()
{ {
MoveSelectedThings(new Vector2D(General.Map.Grid.GridSize, 0f), false); MoveSelectedThings(new Vector2D(General.Map.Grid.GridSizeF, 0f), false);
} }
//mxd //mxd

View file

@ -40,7 +40,7 @@ namespace CodeImp.DoomBuilder.Windows
InitializeComponent(); InitializeComponent();
// Show grid size // Show grid size
gridsize.Text = General.Map.Grid.GridSize.ToString(); gridsize.Text = General.Map.Grid.GridSizeF.ToString();
// Background image? // Background image?
if((General.Map.Grid.Background != null) && if((General.Map.Grid.Background != null) &&
@ -141,8 +141,8 @@ namespace CodeImp.DoomBuilder.Windows
private void apply_Click(object sender, EventArgs e) private void apply_Click(object sender, EventArgs e)
{ {
//mxd. Apply //mxd. Apply
float newgridsize = gridsize.GetResultFloat(General.Map.Grid.GridSize); float newgridsize = gridsize.GetResultFloat(General.Map.Grid.GridSizeF);
if(newgridsize != General.Map.Grid.GridSize) if(newgridsize != General.Map.Grid.GridSizeF)
{ {
//Disable automatic grid resizing //Disable automatic grid resizing
General.MainWindow.DisableDynamicGridResize(); General.MainWindow.DisableDynamicGridResize();

View file

@ -753,7 +753,7 @@ namespace CodeImp.DoomBuilder.Windows
configlabel.Text = General.Map.Config.Name; configlabel.Text = General.Map.Config.Name;
//mxd. Raise grid size to 1 if it was lower and the map isn't in UDMF //mxd. Raise grid size to 1 if it was lower and the map isn't in UDMF
if(!General.Map.UDMF && General.Map.Grid.GridSize < GridSetup.MINIMUM_GRID_SIZE) if(!General.Map.UDMF && General.Map.Grid.GridSizeF < GridSetup.MINIMUM_GRID_SIZE)
General.Map.Grid.SetGridSize(GridSetup.MINIMUM_GRID_SIZE); General.Map.Grid.SetGridSize(GridSetup.MINIMUM_GRID_SIZE);
} }
else else

View file

@ -173,9 +173,9 @@ namespace CodeImp.DoomBuilder.Windows
posX.Text = ((int)ft.Position.x).ToString(); posX.Text = ((int)ft.Position.x).ToString();
posY.Text = ((int)ft.Position.y).ToString(); posY.Text = ((int)ft.Position.y).ToString();
posZ.Text = (useabsoluteheight ? ((int)Math.Round(ft.Position.z + floorheight)).ToString() : ((int)ft.Position.z).ToString()); posZ.Text = (useabsoluteheight ? ((int)Math.Round(ft.Position.z + floorheight)).ToString() : ((int)ft.Position.z).ToString());
posX.ButtonStep = General.Map.Grid.GridSizeI; posX.ButtonStep = General.Map.Grid.GridSize;
posY.ButtonStep = General.Map.Grid.GridSizeI; posY.ButtonStep = General.Map.Grid.GridSize;
posZ.ButtonStep = General.Map.Grid.GridSizeI; posZ.ButtonStep = General.Map.Grid.GridSize;
//mxd //mxd
thinginfo = General.Map.Data.GetThingInfoEx(ft.Type); thinginfo = General.Map.Data.GetThingInfoEx(ft.Type);

View file

@ -197,9 +197,9 @@ namespace CodeImp.DoomBuilder.Windows
posX.Text = (ft.Position.x).ToString(); posX.Text = (ft.Position.x).ToString();
posY.Text = (ft.Position.y).ToString(); posY.Text = (ft.Position.y).ToString();
posZ.Text = (useabsoluteheight ? ((float)Math.Round(ft.Position.z + floorheight, General.Map.FormatInterface.VertexDecimals)).ToString() : (ft.Position.z).ToString()); posZ.Text = (useabsoluteheight ? ((float)Math.Round(ft.Position.z + floorheight, General.Map.FormatInterface.VertexDecimals)).ToString() : (ft.Position.z).ToString());
posX.ButtonStep = General.Map.Grid.GridSizeI; posX.ButtonStep = General.Map.Grid.GridSize;
posY.ButtonStep = General.Map.Grid.GridSizeI; posY.ButtonStep = General.Map.Grid.GridSize;
posZ.ButtonStep = General.Map.Grid.GridSizeI; posZ.ButtonStep = General.Map.Grid.GridSize;
//mxd. User vars. Should be done before adding regular fields //mxd. User vars. Should be done before adding regular fields
ThingTypeInfo fti = General.Map.Data.GetThingInfoEx(ft.Type); ThingTypeInfo fti = General.Map.Data.GetThingInfoEx(ft.Type);

View file

@ -282,7 +282,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
if(points.Count < 2 || currentbevelwidth == bevelwidth || bevelwidth < 0) if(points.Count < 2 || currentbevelwidth == bevelwidth || bevelwidth < 0)
{ {
bevelwidth = Math.Min(bevelwidth + General.Map.Grid.GridSizeI, panel.MaxSpikiness); bevelwidth = Math.Min(bevelwidth + General.Map.Grid.GridSize, panel.MaxSpikiness);
panel.Spikiness = bevelwidth; panel.Spikiness = bevelwidth;
Update(); Update();
} }
@ -292,7 +292,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
if(bevelwidth > 0 || currentbevelwidth <= bevelwidth + 1) if(bevelwidth > 0 || currentbevelwidth <= bevelwidth + 1)
{ {
bevelwidth = Math.Max(bevelwidth - General.Map.Grid.GridSizeI, panel.MinSpikiness); bevelwidth = Math.Max(bevelwidth - General.Map.Grid.GridSize, panel.MinSpikiness);
panel.Spikiness = bevelwidth; panel.Spikiness = bevelwidth;
Update(); Update();
} }

View file

@ -353,18 +353,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
break; break;
case GridLockMode.HORIZONTAL: case GridLockMode.HORIZONTAL:
slicesH = width / General.Map.Grid.GridSizeI; slicesH = width / General.Map.Grid.GridSize;
slicesV = verticalslices; slicesV = verticalslices;
break; break;
case GridLockMode.VERTICAL: case GridLockMode.VERTICAL:
slicesH = horizontalslices; slicesH = horizontalslices;
slicesV = height / General.Map.Grid.GridSizeI; slicesV = height / General.Map.Grid.GridSize;
break; break;
case GridLockMode.BOTH: case GridLockMode.BOTH:
slicesH = width / General.Map.Grid.GridSizeI; slicesH = width / General.Map.Grid.GridSize;
slicesV = height / General.Map.Grid.GridSizeI; slicesV = height / General.Map.Grid.GridSize;
break; break;
} }
@ -444,7 +444,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Triangulate? // Triangulate?
if(triangulate) if(triangulate)
{ {
bool startflip = ((int)Math.Round(((s.x + e.y) / General.Map.Grid.GridSize) % 2) == 0); bool startflip = ((int)Math.Round(((s.x + e.y) / General.Map.Grid.GridSizeF) % 2) == 0);
bool flip = startflip; bool flip = startflip;
for(int w = 0; w < slicesH; w++) for(int w = 0; w < slicesH; w++)

View file

@ -515,7 +515,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
if(points.Count < 2 || currentbevelwidth == bevelwidth || bevelwidth < 0) if(points.Count < 2 || currentbevelwidth == bevelwidth || bevelwidth < 0)
{ {
bevelwidth = Math.Min(bevelwidth + General.Map.Grid.GridSizeI, panel.MaxBevelWidth); bevelwidth = Math.Min(bevelwidth + General.Map.Grid.GridSize, panel.MaxBevelWidth);
panel.BevelWidth = bevelwidth; panel.BevelWidth = bevelwidth;
Update(); Update();
} }
@ -526,7 +526,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
if(currentbevelwidth == bevelwidth || bevelwidth > 0) if(currentbevelwidth == bevelwidth || bevelwidth > 0)
{ {
bevelwidth = Math.Max(bevelwidth - General.Map.Grid.GridSizeI, panel.MinBevelWidth); bevelwidth = Math.Max(bevelwidth - General.Map.Grid.GridSize, panel.MinBevelWidth);
panel.BevelWidth = bevelwidth; panel.BevelWidth = bevelwidth;
Update(); Update();
} }

View file

@ -191,9 +191,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
deltax = prevoffsetx - newoffsetx; deltax = prevoffsetx - newoffsetx;
deltay = prevoffsety - newoffsety; deltay = prevoffsety - newoffsety;
if(Math.Abs(deltax) >= General.Map.Grid.GridSizeI) if(Math.Abs(deltax) >= General.Map.Grid.GridSize)
{ {
deltax = General.Map.Grid.GridSizeI * Math.Sign(deltax); deltax = General.Map.Grid.GridSize * Math.Sign(deltax);
prevoffsetx = newoffsetx; prevoffsetx = newoffsetx;
} }
else else
@ -201,9 +201,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
deltax = 0; deltax = 0;
} }
if(Math.Abs(deltay) >= General.Map.Grid.GridSizeI) if(Math.Abs(deltay) >= General.Map.Grid.GridSize)
{ {
deltay = General.Map.Grid.GridSizeI * Math.Sign(deltay); deltay = General.Map.Grid.GridSize * Math.Sign(deltay);
prevoffsety = newoffsety; prevoffsety = newoffsety;
} }
else else

View file

@ -1359,9 +1359,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
int dx = prevoffsetx - newoffsetx; int dx = prevoffsetx - newoffsetx;
int dy = prevoffsety - newoffsety; int dy = prevoffsety - newoffsety;
if(Math.Abs(dx) >= General.Map.Grid.GridSizeI) if(Math.Abs(dx) >= General.Map.Grid.GridSize)
{ {
dx = General.Map.Grid.GridSizeI * Math.Sign(dx); dx = General.Map.Grid.GridSize * Math.Sign(dx);
prevoffsetx = newoffsetx; prevoffsetx = newoffsetx;
} }
else else
@ -1369,9 +1369,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
dx = 0; dx = 0;
} }
if(Math.Abs(dy) >= General.Map.Grid.GridSizeI) if(Math.Abs(dy) >= General.Map.Grid.GridSize)
{ {
dy = General.Map.Grid.GridSizeI * Math.Sign(dy); dy = General.Map.Grid.GridSize * Math.Sign(dy);
prevoffsety = newoffsety; prevoffsety = newoffsety;
} }
else else

View file

@ -2665,10 +2665,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
[BeginAction("movetextureright8")] public void MoveTextureRight8() { MoveTextureByOffset(8, 0); } [BeginAction("movetextureright8")] public void MoveTextureRight8() { MoveTextureByOffset(8, 0); }
[BeginAction("movetextureup8")] public void MoveTextureUp8() { MoveTextureByOffset(0, -8); } [BeginAction("movetextureup8")] public void MoveTextureUp8() { MoveTextureByOffset(0, -8); }
[BeginAction("movetexturedown8")] public void MoveTextureDown8() { MoveTextureByOffset(0, 8); } [BeginAction("movetexturedown8")] public void MoveTextureDown8() { MoveTextureByOffset(0, 8); }
[BeginAction("movetextureleftgs")] public void MoveTextureLeftGrid() { MoveTextureByOffset(-General.Map.Grid.GridSizeI, 0); } //mxd [BeginAction("movetextureleftgs")] public void MoveTextureLeftGrid() { MoveTextureByOffset(-General.Map.Grid.GridSize, 0); } //mxd
[BeginAction("movetexturerightgs")] public void MoveTextureRightGrid() { MoveTextureByOffset(General.Map.Grid.GridSizeI, 0); } //mxd [BeginAction("movetexturerightgs")] public void MoveTextureRightGrid() { MoveTextureByOffset(General.Map.Grid.GridSize, 0); } //mxd
[BeginAction("movetextureupgs")] public void MoveTextureUpGrid() { MoveTextureByOffset(0, -General.Map.Grid.GridSizeI); } //mxd [BeginAction("movetextureupgs")] public void MoveTextureUpGrid() { MoveTextureByOffset(0, -General.Map.Grid.GridSize); } //mxd
[BeginAction("movetexturedowngs")] public void MoveTextureDownGrid() { MoveTextureByOffset(0, General.Map.Grid.GridSizeI); } //mxd [BeginAction("movetexturedowngs")] public void MoveTextureDownGrid() { MoveTextureByOffset(0, General.Map.Grid.GridSize); } //mxd
//mxd //mxd
private void MoveTextureByOffset(int ox, int oy) private void MoveTextureByOffset(int ox, int oy)

View file

@ -145,6 +145,7 @@
<None Include="Resources\LinesMode.png" /> <None Include="Resources\LinesMode.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="ClassDiagram1.cd" />
<None Include="Resources\SectorsMode.png" /> <None Include="Resources\SectorsMode.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />