- added curve lines code (by Anders Åstrand)

- updated logo images
This commit is contained in:
codeimp 2008-05-18 20:03:09 +00:00
parent 747a8929a9
commit 5d5b9d1c33
21 changed files with 73 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 KiB

BIN
Resources/Splash3.cpt Normal file

Binary file not shown.

BIN
Resources/Splash3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
Resources/Splash3_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
Resources/Splash3_trans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

View file

@ -431,7 +431,6 @@
<None Include="Resources\SaveMap.png" />
<None Include="Resources\OpenMap.png" />
<None Include="Resources\NewMap.png" />
<None Include="Resources\Splash2small.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Interface\ActionBrowserForm.resx">
@ -522,7 +521,6 @@
<EmbeddedResource Include="Resources\display2d.fx" />
<EmbeddedResource Include="Resources\Thing2D_1.png" />
<EmbeddedResource Include="Resources\things2d.fx" />
<None Include="Resources\Splash2.png" />
<EmbeddedResource Include="Resources\world3d.fx" />
</ItemGroup>
<ItemGroup>
@ -531,6 +529,8 @@
</ItemGroup>
<ItemGroup>
<Content Include="Resources\DB2.ico" />
<None Include="Resources\Splash3_trans.png" />
<None Include="Resources\Splash3_small.png" />
<EmbeddedResource Include="Interface\AngleControl.resx">
<SubType>Designer</SubType>
<DependentUpon>AngleControl.cs</DependentUpon>
@ -548,7 +548,5 @@
<EmbeddedResource Include="Resources\Thing2D_2.png" />
<EmbeddedResource Include="Resources\White.png" />
<EmbeddedResource Include="Resources\Font.cfg" />
<None Include="Resources\Splash2_small.png" />
<None Include="Resources\Splash2_trans.png" />
</ItemGroup>
</Project>

View file

@ -175,20 +175,52 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Make list
List<Vector2D> points = new List<Vector2D>(vertices);
// Anders Astrand, this is where your code goes.
// "line" is the original linedef to create a curve from
// "vertices" is the number of points to generate evenly along
// the curve (excluding line start and end)
// "distance" is the curve distance from the line (same as in Doom Builder 1)
// "angle" is the delta angle (same as in Doom Builder 1)
// "fixedcurve" is true when the curve must be forced circular (same as in Doom Builder 1)
// "backwards" is true, then the curve should go towards the back side of the line
// otherwise the curve goes to the front side of the line (like Doom Builder 1 did)
// Return value should be a list of Vector2D points
// TEST:
points.Add(line.GetCenterPoint());
//Added by Anders Åstrand 2008-05-18
//The formulas used are taken from http://mathworld.wolfram.com/CircularSegment.html
//c and theta are known (length of line and angle parameter). d, R and h are
//calculated from those two
//If the curve is not supposed to be a circular segment it's simply deformed to fit
//the value set for distance.
//The vertices are generated to be evenly distributed (by angle) along the curve
//and lastly they are rotated and moved to fit with the original line
//calculate some identities of a circle segment (refer to the graph in the url above)
double c = line.Length;
double theta = angle;
double d = (c / Math.Tan(theta / 2)) / 2;
double R = d / Math.Cos(theta / 2);
double h = R - d;
double yDeform = fixedcurve ? 1 : distance / h;
if (backwards)
yDeform = -yDeform;
double a, x, y;
Vector2D vertex;
for (int v = 1; v <= vertices; v++)
{
//calculate the angle for this vertex
//the curve starts at PI/2 - theta/2 and is segmented into vertices+1 segments
//this assumes the line is horisontal and on y = 0, the point is rotated and moved later
a = (Math.PI - theta)/2 + v * (theta / (vertices + 1));
//calculate the coordinates of the point, and distort the y coordinate
//using the deform factor calculated above
x = Math.Cos(a) * R;
y = (Math.Sin(a) * R - d) * yDeform;
//rotate and transform to fit original line
vertex = new Vector2D((float)x, (float)y).GetRotated(line.Angle + Angle2D.PIHALF);
vertex = vertex.GetTransformed(line.GetCenterPoint().x, line.GetCenterPoint().y, 1, 1);
points.Add(vertex);
}
// Done
return points;

View file

@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
private int MIN_DISTANCE = 0;
private int MAX_DISTANCE = 10000;
private int MIN_ANGLE = 0;
private int MAX_ANGLE = 180;
private int MAX_ANGLE = 350;
#endregion

View file

@ -302,6 +302,13 @@ namespace CodeImp.DoomBuilder.Geometry
return new Vector2D((x * invscalex) + invoffsetx, (y * invscaley) + invoffsety);
}
// Rotate (Added by Anders Åstrand 2008-05-18)
public unsafe Vector2D GetRotated(float theta)
{
double rx = Math.Cos(theta) * x - Math.Sin(theta) * y;
double ry = Math.Sin(theta) * x + Math.Cos(theta) * y;
return new Vector2D((float)rx, (float)ry);
}
#endregion
}
}

View file

@ -38,19 +38,19 @@ namespace CodeImp.DoomBuilder.Interface
//
// pictureBox1
//
pictureBox1.Image = global::CodeImp.DoomBuilder.Properties.Resources.Splash2_small;
pictureBox1.Image = global::CodeImp.DoomBuilder.Properties.Resources.Splash3_small;
pictureBox1.Location = new System.Drawing.Point(12, 12);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(102, 106);
pictureBox1.Size = new System.Drawing.Size(226, 80);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
//
// label1
//
this.label1.Location = new System.Drawing.Point(129, 21);
this.label1.Location = new System.Drawing.Point(12, 93);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(342, 50);
this.label1.Size = new System.Drawing.Size(318, 50);
this.label1.TabIndex = 2;
this.label1.Text = "Doom Builder is designed and programmed by Pascal vd Heiden.\r\nSeveral game config" +
"urations were written by various members of the Doom community.";
@ -58,7 +58,7 @@ namespace CodeImp.DoomBuilder.Interface
// close
//
this.close.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.close.Location = new System.Drawing.Point(355, 93);
this.close.Location = new System.Drawing.Point(214, 139);
this.close.Name = "close";
this.close.Size = new System.Drawing.Size(116, 25);
this.close.TabIndex = 3;
@ -68,7 +68,7 @@ namespace CodeImp.DoomBuilder.Interface
// builderlink
//
this.builderlink.AutoSize = true;
this.builderlink.Location = new System.Drawing.Point(129, 71);
this.builderlink.Location = new System.Drawing.Point(12, 144);
this.builderlink.Name = "builderlink";
this.builderlink.Size = new System.Drawing.Size(121, 14);
this.builderlink.TabIndex = 5;
@ -81,7 +81,7 @@ namespace CodeImp.DoomBuilder.Interface
this.AcceptButton = this.close;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.close;
this.ClientSize = new System.Drawing.Size(482, 126);
this.ClientSize = new System.Drawing.Size(337, 172);
this.Controls.Add(this.builderlink);
this.Controls.Add(this.close);
this.Controls.Add(this.label1);

View file

@ -117,7 +117,7 @@ namespace CodeImp.DoomBuilder.Interface
this.SetStyle(ControlStyles.Opaque, false);
this.UpdateStyles();
this.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash2_trans;
this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash3_trans;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
//this.Image = null;
}

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -165,16 +165,16 @@ namespace CodeImp.DoomBuilder.Properties {
}
}
internal static System.Drawing.Bitmap Splash2_small {
internal static System.Drawing.Bitmap Splash3_small {
get {
object obj = ResourceManager.GetObject("Splash2_small", resourceCulture);
object obj = ResourceManager.GetObject("Splash3_small", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Splash2_trans {
internal static System.Drawing.Bitmap Splash3_trans {
get {
object obj = ResourceManager.GetObject("Splash2_trans", resourceCulture);
object obj = ResourceManager.GetObject("Splash3_trans", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

View file

@ -184,10 +184,10 @@
<data name="UnknownImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UnknownImage.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Splash2_trans" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Splash2_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Splash3_small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Splash3_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Splash2_small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Splash2_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Splash3_trans" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Splash3_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB