added "fixed size" things (these do not scale higher than their specified size in screen pixels)

This commit is contained in:
codeimp 2008-11-17 16:14:45 +00:00
parent f5c635a998
commit 53eff3002b
25 changed files with 103 additions and 6 deletions

View file

@ -2515,6 +2515,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3483,6 +3484,7 @@ thingtypes
title = "Boom Items";
width = 0;
sort = 1;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -1006,6 +1006,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -1235,6 +1235,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -2465,6 +2465,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -2783,6 +2783,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3764,6 +3765,7 @@ thingtypes
title = "Eternity Items";
width = 0;
sort = 1;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -2456,6 +2456,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3437,6 +3438,7 @@ thingtypes
title = "Eternity Items";
width = 0;
sort = 1;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -1061,6 +1061,7 @@ thingtypes
height = 56;
sort = 1;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -2228,6 +2228,7 @@ thingtypes
width = 16;
sort = 1;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3595,6 +3596,7 @@ thingtypes
title = "Sounds";
width = 0;
sort = 1;
fixedsize = true;
1403 = "Creak";
1408 = "Earth Crack";
@ -3616,11 +3618,13 @@ thingtypes
title = "Other";
width = 0;
sort = 1;
fixedsize = true;
118
{
title = "Glitter Bridge";
width = 32;
fixedsize = false;
}
3000 = "Polyobject Anchor";
3001 = "Polyobject Start Spot";

View file

@ -2595,6 +2595,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3568,6 +3569,7 @@ thingtypes
title = "Boom Items";
width = 0;
sort = 1;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -2568,6 +2568,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3660,7 +3661,8 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
6001
{
title = "Sound 1";
@ -3679,6 +3681,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
14001
{
@ -3760,6 +3763,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
14101
{
@ -3841,6 +3845,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
15001
{
@ -3922,6 +3927,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
24001
{
@ -4003,6 +4009,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
14201
{
@ -4119,6 +4126,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
14301
{
@ -4235,6 +4243,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
15500 = "Force Water Dynamics";
15501 = "Enable 3D Floors";
@ -4251,6 +4260,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -2518,6 +2518,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3954,6 +3955,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -4043,6 +4045,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";
@ -4061,6 +4064,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
5060 = "Exploding Bridge Thing";
5062 = "Breakable Glass Thing";

View file

@ -4528,6 +4528,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -4543,6 +4544,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025 = "Camera";
9073
@ -6155,6 +6157,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9082 = "Silent Sector";
9998 = "Actor enters sector";
@ -6180,6 +6183,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -6308,6 +6312,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9511
{
@ -6375,6 +6380,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9200
{
@ -6428,6 +6434,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
5060 = "Exploding Bridge Thing";
5062 = "Breakable Glass Thing";

View file

@ -1815,6 +1815,7 @@ thingtypes
title = "Editor Things";
width = 16;
sort = 1;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -1224,6 +1224,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -2591,6 +2591,7 @@ thingtypes
error = 0;
blocking = 0;
hangs = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -3559,6 +3560,7 @@ thingtypes
sort = 1;
blocking = 0;
hangs = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -3648,6 +3650,7 @@ thingtypes
sort = 1;
blocking = 0;
hangs = 0;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";

View file

@ -4824,6 +4824,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -4839,6 +4840,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025
{
@ -6133,6 +6135,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9082 = "Silent Sector";
9998 = "Actor enters sector";
@ -6158,6 +6161,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -6286,6 +6290,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9511
{
@ -6353,6 +6358,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9200
{
@ -6406,6 +6412,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9077
{

View file

@ -5067,6 +5067,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -5082,6 +5083,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025
{
@ -6376,6 +6378,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9082 = "Silent Sector";
9998 = "Actor enters sector";
@ -6401,6 +6404,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -6529,6 +6533,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9511
{
@ -6596,6 +6601,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9200
{
@ -6649,6 +6655,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9077
{

View file

@ -4812,6 +4812,7 @@ thingtypes
title = "Editor Things";
width = 16;
sort = 1;
fixedsize = true;
32000 = "3D Mode start";
}
@ -4827,6 +4828,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025
{
@ -5401,6 +5403,7 @@ thingtypes
title = "Sector Actions";
width = 16;
sort = 1;
fixedsize = true;
9082 = "Silent Sector";
9998 = "Actor enters sector";
@ -5426,6 +5429,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9511
{
@ -5493,6 +5497,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9200
{
@ -5546,6 +5551,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9077
{

View file

@ -4658,6 +4658,7 @@ thingtypes
width = 16;
sort = 1;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}
@ -4673,6 +4674,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025
{
@ -6252,6 +6254,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -6352,11 +6355,13 @@ thingtypes
title = "Other";
width = 0;
sort = 1;
fixedsize = true;
118
{
title = "Glitter Bridge";
width = 32;
fixedsize = false;
}
3000 = "Polyobject Anchor";
3001 = "Polyobject Start Spot";
@ -6459,6 +6464,7 @@ thingtypes
title = "ZDoom";
width = 0;
sort = 1;
fixedsize = true;
5001 = "Pusher";
5002 = "Puller";
@ -6503,6 +6509,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9077
{

View file

@ -4819,6 +4819,7 @@ thingtypes
title = "Editor Things";
width = 16;
sort = 1;
fixedsize = true;
32000 = "3D Mode start";
}
@ -4834,6 +4835,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 1;
fixedsize = true;
9025
{
@ -5687,6 +5689,7 @@ thingtypes
title = "Sector Actions";
width = 16;
sort = 1;
fixedsize = true;
9082 = "Silent Sector";
9998 = "Actor enters sector";
@ -5709,6 +5712,7 @@ thingtypes
title = "Sounds";
width = 0;
sort = 1;
fixedsize = true;
1400 = "Sound Sequence 0";
1401 = "Sound Sequence 1";
@ -5837,6 +5841,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9511
{
@ -5904,6 +5909,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9200
{
@ -5957,6 +5963,7 @@ thingtypes
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
9077
{

View file

@ -1258,6 +1258,7 @@ thingtypes
hangs = 0;
blocking = 0;
error = 0;
fixedsize = true;
32000 = "3D Mode start";
}

View file

@ -57,6 +57,7 @@ namespace CodeImp.DoomBuilder.Config
private int hangs;
private int blocking;
private int errorcheck;
private bool fixedsize;
// Disposing
private bool isdisposed = false;
@ -76,6 +77,7 @@ namespace CodeImp.DoomBuilder.Config
public int Hangs { get { return hangs; } }
public int Blocking { get { return blocking; } }
public int ErrorCheck { get { return errorcheck; } }
public bool FixedSize { get { return fixedsize; } }
public bool IsDisposed { get { return isdisposed; } }
public List<ThingTypeInfo> Things { get { return things; } }
@ -104,6 +106,7 @@ namespace CodeImp.DoomBuilder.Config
this.hangs = cfg.ReadSetting("thingtypes." + name + ".hangs", 0);
this.blocking = cfg.ReadSetting("thingtypes." + name + ".blocking", 0);
this.errorcheck = cfg.ReadSetting("thingtypes." + name + ".error", 1);
this.fixedsize = cfg.ReadSetting("thingtypes." + name + ".fixedsize", false);
// Safety
if(this.width < 8f) this.width = 8f;

View file

@ -58,6 +58,7 @@ namespace CodeImp.DoomBuilder.Config
private bool hangs;
private int blocking;
private int errorcheck;
private bool fixedsize;
private ThingCategory category;
#endregion
@ -75,6 +76,7 @@ namespace CodeImp.DoomBuilder.Config
public bool Hangs { get { return hangs; } }
public int Blocking { get { return blocking; } }
public int ErrorCheck { get { return errorcheck; } }
public bool FixedSize { get { return fixedsize; } }
public ThingCategory Category { get { return category; } }
#endregion
@ -96,7 +98,8 @@ namespace CodeImp.DoomBuilder.Config
this.hangs = false;
this.blocking = 0;
this.errorcheck = 0;
this.fixedsize = false;
// Make long name for sprite lookup
this.spritelongname = Lump.MakeLongName(this.sprite);
@ -123,7 +126,8 @@ namespace CodeImp.DoomBuilder.Config
this.hangs = (cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".hangs", cat.Hangs) != 0);
this.blocking = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".blocking", cat.Blocking);
this.errorcheck = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".error", cat.ErrorCheck);
this.fixedsize = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".fixedsize", cat.FixedSize);
// Safety
if(this.width < 8f) this.width = 8f;
if(this.height < 8f) this.height = 8f;
@ -154,6 +158,7 @@ namespace CodeImp.DoomBuilder.Config
this.hangs = (cat.Hangs != 0);
this.blocking = cat.Blocking;
this.errorcheck = cat.ErrorCheck;
this.fixedsize = cat.FixedSize;
// Make long name for sprite lookup
this.spritelongname = Lump.MakeLongName(this.sprite);

View file

@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.Map
// Configuration
private float size;
private PixelColor color;
private bool fixedsize;
private float iconoffset; // Arrow or dot coordinate offset on the texture
#endregion
@ -81,6 +82,7 @@ namespace CodeImp.DoomBuilder.Map
public float Size { get { return size; } }
public float IconOffset { get { return iconoffset; } }
public PixelColor Color { get { return color; } }
public bool FixedSize { get { return fixedsize; } }
public int Tag { get { return tag; } set { tag = value; if((tag < 0) || (tag > MapSet.HIGHEST_TAG)) throw new ArgumentOutOfRangeException("Tag", "Invalid tag number"); } }
public Sector Sector { get { return sector; } }
@ -145,6 +147,7 @@ namespace CodeImp.DoomBuilder.Map
t.size = size;
t.color = color;
t.iconoffset = iconoffset;
t.fixedsize = fixedsize;
args.CopyTo(t.args, 0);
base.CopyPropertiesTo(t);
}
@ -251,7 +254,8 @@ namespace CodeImp.DoomBuilder.Map
// Apply size
size = ti.Width;
fixedsize = ti.FixedSize;
// Color valid?
if((ti.Color >= 0) && (ti.Color < ColorCollection.NUM_THING_COLORS))
{

View file

@ -910,8 +910,16 @@ namespace CodeImp.DoomBuilder.Rendering
Vector2D screenpos = ((Vector2D)t.Position).GetTransformed(translatex, translatey, scale, -scale);
// Determine sizes
circlesize = (t.Size - THING_CIRCLE_SHRINK) * scale * THING_CIRCLE_SIZE;
arrowsize = (t.Size - THING_ARROW_SHRINK) * scale * THING_ARROW_SIZE;
if(t.FixedSize && (scale > 1.0f))
{
circlesize = (t.Size - THING_CIRCLE_SHRINK) * THING_CIRCLE_SIZE;
arrowsize = (t.Size - THING_ARROW_SHRINK) * THING_ARROW_SIZE;
}
else
{
circlesize = (t.Size - THING_CIRCLE_SHRINK) * scale * THING_CIRCLE_SIZE;
arrowsize = (t.Size - THING_ARROW_SHRINK) * scale * THING_ARROW_SIZE;
}
// Check if the thing is actually on screen
if(((screenpos.x + circlesize) > 0.0f) && ((screenpos.x - circlesize) < (float)windowsize.Width) &&