mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
my sincere excuses for previous commit, my compiler lied to me and said it all compiled fine.
This commit is contained in:
parent
efc1a88112
commit
b1c6c20714
10 changed files with 108 additions and 22 deletions
Binary file not shown.
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 906 B |
|
@ -111,6 +111,7 @@
|
|||
<Compile Include="Interface\ImageBrowser.Designer.cs">
|
||||
<DependentUpon>ImageBrowser.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Interface\ImageBrowserItem.cs" />
|
||||
<Compile Include="Interface\LinedefInfoPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -263,11 +264,11 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\Builder.ico" />
|
||||
<None Include="Resources\ThingsMode.png" />
|
||||
<None Include="Resources\Status1.png" />
|
||||
<None Include="Resources\Status2.png" />
|
||||
<None Include="Resources\Status0.png" />
|
||||
<None Include="Resources\UnknownImage.png" />
|
||||
<None Include="Resources\ThingsMode.png" />
|
||||
<None Include="Resources\VerticesMode.png" />
|
||||
<None Include="Resources\SectorsMode.png" />
|
||||
<None Include="Resources\LinesMode.png" />
|
||||
|
|
2
Source/Interface/ImageBrowser.Designer.cs
generated
2
Source/Interface/ImageBrowser.Designer.cs
generated
|
@ -60,7 +60,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.rendertarget.Location = new System.Drawing.Point(0, 0);
|
||||
this.rendertarget.Name = "rendertarget";
|
||||
this.rendertarget.Size = new System.Drawing.Size(518, 310);
|
||||
this.rendertarget.TabIndex = 0;
|
||||
this.rendertarget.TabIndex = 3;
|
||||
this.rendertarget.TabStop = false;
|
||||
//
|
||||
// ImageBrowser
|
||||
|
|
|
@ -27,6 +27,7 @@ using System.Diagnostics;
|
|||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -43,13 +44,18 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
// Number of items horizontally
|
||||
private int numitemswidth;
|
||||
// Graphics device for rendering
|
||||
private D3DDevice graphics;
|
||||
|
||||
// Items list
|
||||
private List<ImageBrowserItem> items;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public int Count { get { return items.Count; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
@ -57,7 +63,12 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// Constructor
|
||||
public ImageBrowser()
|
||||
{
|
||||
// Make graphics device
|
||||
graphics = new D3DDevice(rendertarget);
|
||||
graphics.Initialize();
|
||||
|
||||
// Make items list
|
||||
items = new List<ImageBrowserItem>();
|
||||
|
||||
// Initialize
|
||||
InitializeComponent();
|
||||
|
@ -70,6 +81,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// When resized
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
// Redraw
|
||||
Redraw();
|
||||
|
||||
// Call base
|
||||
base.OnResize(e);
|
||||
|
@ -77,19 +90,31 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Controls
|
||||
#region ================== Rendering
|
||||
|
||||
// This redraws the list
|
||||
public void Redraw()
|
||||
{
|
||||
int numitemswide;
|
||||
|
||||
// Calculate number of items wide
|
||||
numitemswide = (int)Math.Floor((float)ClientSize.Width / (float)ITEM_WIDTH);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This adds an item
|
||||
public void Add(string name, ImageData image, object tag)
|
||||
public void Add(string text, ImageData image, object tag)
|
||||
{
|
||||
ImageBrowserItem i;
|
||||
|
||||
// Make new item
|
||||
i = new ImageBrowserItem(text, image, tag);
|
||||
|
||||
// Add item to list
|
||||
|
||||
items.Add(i);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
52
Source/Interface/ImageBrowserItem.cs
Normal file
52
Source/Interface/ImageBrowserItem.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
|
||||
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
||||
* This program is released under GNU General Public License
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.Interface
|
||||
{
|
||||
internal struct ImageBrowserItem
|
||||
{
|
||||
// Variables
|
||||
public string text;
|
||||
public ImageData image;
|
||||
public object tag;
|
||||
|
||||
// Constructors
|
||||
public ImageBrowserItem(string text, ImageData image, object tag)
|
||||
{
|
||||
// Initialize
|
||||
this.text = text;
|
||||
this.image = image;
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
}
|
17
Source/Interface/MainForm.Designer.cs
generated
17
Source/Interface/MainForm.Designer.cs
generated
|
@ -91,6 +91,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.linedefinfo = new CodeImp.DoomBuilder.Interface.LinedefInfoPanel();
|
||||
this.redrawtimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.display = new CodeImp.DoomBuilder.Interface.RenderTargetControl();
|
||||
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -101,7 +102,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.toolbar.SuspendLayout();
|
||||
this.statusbar.SuspendLayout();
|
||||
this.panelinfo.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.display)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
|
@ -357,7 +357,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.buttonverticesmode,
|
||||
this.buttonlinedefsmode,
|
||||
this.buttonsectorsmode,
|
||||
this.buttonthingsmode});
|
||||
this.buttonthingsmode,
|
||||
this.toolStripSeparator7});
|
||||
this.toolbar.Location = new System.Drawing.Point(0, 24);
|
||||
this.toolbar.Name = "toolbar";
|
||||
this.toolbar.Size = new System.Drawing.Size(839, 25);
|
||||
|
@ -398,7 +399,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.toolStripSeparator3.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
|
@ -415,7 +416,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
// toolStripSeparator5
|
||||
//
|
||||
this.toolStripSeparator5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.toolStripSeparator5.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||
this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
|
@ -678,6 +679,12 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.display.MouseUp += new System.Windows.Forms.MouseEventHandler(this.display_MouseUp);
|
||||
this.display.MouseEnter += new System.EventHandler(this.display_MouseEnter);
|
||||
//
|
||||
// toolStripSeparator7
|
||||
//
|
||||
this.toolStripSeparator7.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.toolStripSeparator7.Name = "toolStripSeparator7";
|
||||
this.toolStripSeparator7.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
|
@ -708,7 +715,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.statusbar.ResumeLayout(false);
|
||||
this.statusbar.PerformLayout();
|
||||
this.panelinfo.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.display)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -771,5 +777,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private VertexInfoPanel vertexinfo;
|
||||
private SectorInfoPanel sectorinfo;
|
||||
private ThingInfoPanel thinginfo;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ using CodeImp.DoomBuilder.Editing;
|
|||
|
||||
namespace CodeImp.DoomBuilder.Interface
|
||||
{
|
||||
public class RenderTargetControl : PictureBox
|
||||
public class RenderTargetControl : Panel
|
||||
{
|
||||
#region ================== Constants
|
||||
|
||||
|
@ -99,7 +99,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
{
|
||||
// Set new source image
|
||||
img = srcimg;
|
||||
this.Image = img;
|
||||
//this.Image = img;
|
||||
}
|
||||
|
||||
// This sets up the control to display the splash logo
|
||||
|
@ -110,7 +110,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
// Change display to show splash logo
|
||||
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
|
@ -119,7 +119,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash2;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.Image = null;
|
||||
//this.Image = null;
|
||||
}
|
||||
|
||||
// This sets up the control for manual rendering
|
||||
|
@ -128,14 +128,14 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// Change display for rendering
|
||||
/*
|
||||
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.Opaque, true);
|
||||
*/
|
||||
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, false);
|
||||
this.SetStyle(ControlStyles.ContainerControl, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
|
@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
//this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.floor0_3;
|
||||
//this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
|
||||
this.Image = img;
|
||||
//this.Image = img;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -239,7 +239,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
//device.DeviceResizing += new CancelEventHandler(CancelResize);
|
||||
|
||||
// Create shader manager
|
||||
shaders = new ShaderManager();
|
||||
shaders = new ShaderManager(this);
|
||||
|
||||
// Initialize settings
|
||||
SetupSettings();
|
||||
|
|
|
@ -175,7 +175,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
if(thingsfront) PresentThings(1f);
|
||||
|
||||
// Done
|
||||
graphics.FinishRendering(true);
|
||||
graphics.FinishRendering();
|
||||
graphics.Present();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -637,7 +638,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
public void FinishRendering()
|
||||
{
|
||||
// Stop rendering
|
||||
graphics.FinishRendering(false);
|
||||
graphics.FinishRendering();
|
||||
|
||||
// Release rendertarget
|
||||
try
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 906 B |
Loading…
Reference in a new issue