mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-24 12:51:53 +00:00
Game configurations: added "fixedrotation" property to dynamic lights, which use the angle property as a parameter.
Maintenance: removed a ton of redundant stuff.
This commit is contained in:
parent
d9e53f2899
commit
3e5f85dc8f
215 changed files with 608 additions and 943 deletions
|
@ -39,7 +39,8 @@ gzdoom_lights
|
|||
}
|
||||
9801
|
||||
{
|
||||
title = "Light Pulse";
|
||||
title = "Pulse Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -68,7 +69,8 @@ gzdoom_lights
|
|||
}
|
||||
9802
|
||||
{
|
||||
title = "Light Flicker";
|
||||
title = "Flicker Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -97,7 +99,7 @@ gzdoom_lights
|
|||
}
|
||||
9803
|
||||
{
|
||||
title = "Light Sector";
|
||||
title = "Sector Light";
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -121,7 +123,8 @@ gzdoom_lights
|
|||
}
|
||||
9804
|
||||
{
|
||||
title = "Light Random";
|
||||
title = "Random Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -150,7 +153,7 @@ gzdoom_lights
|
|||
}
|
||||
9810
|
||||
{
|
||||
title = "Light, Additive";
|
||||
title = "Additive Light";
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -174,7 +177,8 @@ gzdoom_lights
|
|||
}
|
||||
9811
|
||||
{
|
||||
title = "Light Pulse, Additive";
|
||||
title = "Additive Pulse Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -203,7 +207,8 @@ gzdoom_lights
|
|||
}
|
||||
9812
|
||||
{
|
||||
title = "Light Flicker, Additive";
|
||||
title = "Additive Flicker Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -232,7 +237,7 @@ gzdoom_lights
|
|||
}
|
||||
9813
|
||||
{
|
||||
title = "Light Sector, Additive";
|
||||
title = "Additive Sector Light";
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -256,7 +261,8 @@ gzdoom_lights
|
|||
}
|
||||
9814
|
||||
{
|
||||
title = "Light Random, Additive";
|
||||
title = "Additive Random Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -285,7 +291,7 @@ gzdoom_lights
|
|||
}
|
||||
9820
|
||||
{
|
||||
title = "Light, Subtractive";
|
||||
title = "Subtractive Light";
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -309,7 +315,8 @@ gzdoom_lights
|
|||
}
|
||||
9821
|
||||
{
|
||||
title = "Light Pulse, Subtractive";
|
||||
title = "Subtractive Pulse Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -338,7 +345,8 @@ gzdoom_lights
|
|||
}
|
||||
9822
|
||||
{
|
||||
title = "Light Flicker, Subtractive";
|
||||
title = "Subtractive Flicker Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -367,7 +375,7 @@ gzdoom_lights
|
|||
}
|
||||
9823
|
||||
{
|
||||
title = "Light Sector, Subtractive";
|
||||
title = "Subtractive Sector Light";
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
@ -391,7 +399,8 @@ gzdoom_lights
|
|||
}
|
||||
9824
|
||||
{
|
||||
title = "Light Random, Subtractive";
|
||||
title = "Subtractive Random Light";
|
||||
fixedrotation = true;
|
||||
arg0
|
||||
{
|
||||
title = "Red";
|
||||
|
|
|
@ -505,7 +505,6 @@
|
|||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Trackbar, Version=1.0.2486.37933, Culture=neutral, PublicKeyToken=503bf28f63ad27b4">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.Compilers
|
|||
{
|
||||
if(!isdisposed)
|
||||
{
|
||||
Exception deleteerror = null;
|
||||
Exception deleteerror;
|
||||
float starttime = General.Clock.CurrentTime;
|
||||
|
||||
do
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
for(int i = 0; i < filters.Count; i++)
|
||||
{
|
||||
// Add filters
|
||||
dic.Add("filter" + i.ToString(), filters[i].ToUpperInvariant());
|
||||
dic.Add("filter" + i, filters[i].ToUpperInvariant());
|
||||
}
|
||||
|
||||
// Write to config
|
||||
|
|
|
@ -787,7 +787,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
dic = cfg.ReadSetting("skills", new Hashtable());
|
||||
foreach(DictionaryEntry de in dic)
|
||||
{
|
||||
int num = 0;
|
||||
int num;
|
||||
if(int.TryParse(de.Key.ToString(), out num))
|
||||
{
|
||||
skills.Add(new SkillInfo(num, de.Value.ToString()));
|
||||
|
@ -808,7 +808,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
dic = cfg.ReadSetting("texturesets", new Hashtable());
|
||||
foreach(DictionaryEntry de in dic)
|
||||
{
|
||||
DefinedTextureSet s = new DefinedTextureSet(cfg, "texturesets." + de.Key.ToString());
|
||||
DefinedTextureSet s = new DefinedTextureSet(cfg, "texturesets." + de.Key);
|
||||
texturesets.Add(s);
|
||||
}
|
||||
}
|
||||
|
@ -822,7 +822,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
dic = cfg.ReadSetting("thingsfilters", new Hashtable());
|
||||
foreach(DictionaryEntry de in dic)
|
||||
{
|
||||
ThingsFilter f = new ThingsFilter(cfg, "thingsfilters." + de.Key.ToString());
|
||||
ThingsFilter f = new ThingsFilter(cfg, "thingsfilters." + de.Key);
|
||||
thingfilters.Add(f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private List<GeneralizedOption> options;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private List<LinedefActionInfo> actions;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Construct from IDictionary
|
||||
internal MapLumpInfo(string name, Configuration cfg)
|
||||
{
|
||||
string scriptconfig = "";
|
||||
|
||||
// Apply settings
|
||||
this.name = name;
|
||||
this.script = null;
|
||||
|
@ -44,7 +42,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blindcopy = cfg.ReadSetting("maplumpnames." + name + ".blindcopy", false);
|
||||
this.nodebuild = cfg.ReadSetting("maplumpnames." + name + ".nodebuild", false);
|
||||
this.allowempty = cfg.ReadSetting("maplumpnames." + name + ".allowempty", false);
|
||||
scriptconfig = cfg.ReadSetting("maplumpnames." + name + ".script", "");
|
||||
string scriptconfig = cfg.ReadSetting("maplumpnames." + name + ".script", "");
|
||||
|
||||
// Find script configuration
|
||||
if(scriptconfig.Length > 0)
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private string group;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -108,8 +108,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// 1 if the flag overlaps
|
||||
public int Compare(Thing t1, Thing t2)
|
||||
{
|
||||
bool t1flag = false;
|
||||
bool t2flag = false;
|
||||
bool t1flag;
|
||||
bool t2flag;
|
||||
|
||||
// Check if the flags exist
|
||||
if(!t1.Flags.ContainsKey(flag) || !t2.Flags.ContainsKey(flag)) {
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Variables
|
||||
private List<GeneralizedCategory> generalizedcategories;
|
||||
private bool controlpressed = false;
|
||||
private bool controlpressed;
|
||||
|
||||
// Constants
|
||||
private const string NUMBER_SEPERATOR = "\t";
|
||||
|
@ -99,8 +99,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
INumberedTitle item;
|
||||
Brush displaybrush = SystemBrushes.WindowText;
|
||||
Brush backbrush = SystemBrushes.Window;
|
||||
string displayname = "";
|
||||
int intnumber = 0;
|
||||
string displayname = string.Empty;
|
||||
int intnumber;
|
||||
|
||||
// Only when running
|
||||
if(!this.DesignMode)
|
||||
|
|
|
@ -392,7 +392,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(gotTagArgument && combobox.SelectedItem != null)
|
||||
return General.Clamp(((TagInfo)combobox.SelectedItem).Tag, General.Map.FormatInterface.MinArgument, General.Map.FormatInterface.MaxArgument);
|
||||
|
||||
int result = 0;
|
||||
int result;
|
||||
|
||||
// Strip prefixes
|
||||
string str = combobox.Text.Trim().ToLowerInvariant();
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private int eventcount = 0;
|
||||
private int eventcount;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private bool ignorebuttonchange = false;
|
||||
private StepsList steps = null;
|
||||
private bool ignorebuttonchange;
|
||||
private StepsList steps;
|
||||
private int stepsize = 1;
|
||||
private float stepsizeFloat = 1.0f; //mxd
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
tabs.TabsOffsetTop = buttonTogglePinning.Bottom + 2; //mxd
|
||||
|
||||
if(General.Settings != null)
|
||||
buttonTogglePinning.Image = General.Settings.CollapseDockers ? CodeImp.DoomBuilder.Properties.Resources.Unpin : CodeImp.DoomBuilder.Properties.Resources.Pin; //mxd
|
||||
buttonTogglePinning.Image = General.Settings.CollapseDockers ? Properties.Resources.Unpin : Properties.Resources.Pin; //mxd
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -448,7 +448,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void buttonTogglePinning_Click(object sender, EventArgs e) {
|
||||
General.Settings.CollapseDockers = !General.Settings.CollapseDockers;
|
||||
General.MainWindow.SetupInterface();
|
||||
buttonTogglePinning.Image = General.Settings.CollapseDockers ? CodeImp.DoomBuilder.Properties.Resources.Unpin : CodeImp.DoomBuilder.Properties.Resources.Pin;
|
||||
buttonTogglePinning.Image = General.Settings.CollapseDockers ? Properties.Resources.Unpin : Properties.Resources.Pin;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -471,7 +471,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else if(e.ColumnIndex == 2)
|
||||
{
|
||||
// Get the row
|
||||
FieldsEditorRow frow = null;
|
||||
FieldsEditorRow frow;
|
||||
DataGridViewRow row = fieldslist.Rows[e.RowIndex];
|
||||
if(row is FieldsEditorRow)
|
||||
{
|
||||
|
@ -526,10 +526,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void fieldslist_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
FieldsEditorRow frow = null;
|
||||
DataGridViewRow row = null;
|
||||
|
||||
|
||||
// Get the row
|
||||
row = fieldslist.Rows[e.RowIndex];
|
||||
DataGridViewRow row = fieldslist.Rows[e.RowIndex];
|
||||
if(row is FieldsEditorRow) frow = row as FieldsEditorRow;
|
||||
|
||||
// Renaming a field?
|
||||
|
@ -825,13 +824,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void UpdateBrowseButton()
|
||||
{
|
||||
FieldsEditorRow frow = null;
|
||||
DataGridViewRow row = null;
|
||||
|
||||
// Any row selected?
|
||||
if(fieldslist.SelectedRows.Count > 0)
|
||||
{
|
||||
// Get selected row
|
||||
row = fieldslist.SelectedRows[0];
|
||||
DataGridViewRow row = fieldslist.SelectedRows[0];
|
||||
if(row is FieldsEditorRow) frow = row as FieldsEditorRow;
|
||||
|
||||
// Not the new row and FieldsEditorRow available?
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
DisplayImageSize(0, 0); //mxd
|
||||
|
||||
// Flat required!
|
||||
return CodeImp.DoomBuilder.Properties.Resources.MissingTexture;
|
||||
return Properties.Resources.MissingTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
Rectangle imagerect = new Rectangle(bounds.Left + ((bounds.Width - General.Map.Data.Previews.MaxImageWidth) >> 1),
|
||||
bounds.Top + ((bounds.Height - General.Map.Data.Previews.MaxImageHeight - (int)textsize.Height) >> 1),
|
||||
General.Map.Data.Previews.MaxImageWidth, General.Map.Data.Previews.MaxImageHeight);
|
||||
PointF textpos = new PointF(bounds.Left + ((float)bounds.Width - textsize.Width) * 0.5f, bounds.Bottom - textsize.Height - 2);
|
||||
PointF textpos = new PointF(bounds.Left + (bounds.Width - textsize.Width) * 0.5f, bounds.Bottom - textsize.Height - 2);
|
||||
|
||||
// Determine colors
|
||||
if(this.Selected)
|
||||
|
|
|
@ -79,9 +79,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.Opaque, false);
|
||||
this.UpdateStyles();
|
||||
this.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash3_trans;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.BackColor = SystemColors.AppWorkspace;
|
||||
this.BackgroundImage = Properties.Resources.Splash3_trans;
|
||||
this.BackgroundImageLayout = ImageLayout.Center;
|
||||
}
|
||||
|
||||
// This sets up the control for manual rendering
|
||||
|
@ -97,7 +97,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.UpdateStyles();
|
||||
this.BackColor = Color.Black;
|
||||
this.BackgroundImage = null;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.BackgroundImageLayout = ImageLayout.None;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -2295,7 +2295,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
if(controlptr != IntPtr.Zero)
|
||||
{
|
||||
return (UInt32)Perform(directptr, message, (UInt32)wParam, (UInt32)lParam);
|
||||
return (UInt32)Perform(directptr, message, wParam, lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2309,7 +2309,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.ignoredkeys.Add(key, key);
|
||||
}
|
||||
|
||||
public void AddIgnoredKey(System.Windows.Forms.Keys key, System.Windows.Forms.Keys modifier)
|
||||
public void AddIgnoredKey(Keys key, Keys modifier)
|
||||
{
|
||||
this.ignoredkeys.Add((int)key + (int)modifier, (int)key + (int)modifier);
|
||||
}
|
||||
|
@ -2370,7 +2370,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
#region ================== Message Pump
|
||||
|
||||
// This handles messages
|
||||
protected override void WndProc(ref System.Windows.Forms.Message m)
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
// Notify message?
|
||||
if(m.Msg == WM_NOTIFY)
|
||||
|
@ -2524,7 +2524,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
string textstr = null;
|
||||
try
|
||||
{
|
||||
textstr = System.Runtime.InteropServices.Marshal.PtrToStringAuto(scn.text);
|
||||
textstr = Marshal.PtrToStringAuto(scn.text);
|
||||
}
|
||||
catch(IndexOutOfRangeException)
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
navigator.Name = "navigator";
|
||||
navigator.TabStop = true;
|
||||
navigator.TabIndex = 0;
|
||||
navigator.DropDown += new EventHandler(navigator_DropDown);
|
||||
navigator.DropDown += navigator_DropDown;
|
||||
this.Controls.Add(navigator);
|
||||
|
||||
// Make the script control
|
||||
|
@ -311,7 +311,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if (Array.IndexOf(ScriptTypes.TYPES, config.Description) != -1) {
|
||||
updateNavigator(new MemoryStream(editor.GetText()), config.Description);
|
||||
navigator.Enabled = true;
|
||||
navigator.SelectedIndexChanged += new EventHandler(navigator_SelectedIndexChanged);
|
||||
navigator.SelectedIndexChanged += navigator_SelectedIndexChanged;
|
||||
}else{
|
||||
navigator.Items.Clear();
|
||||
navigator.Enabled = false;
|
||||
|
|
|
@ -77,8 +77,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Current position information
|
||||
private string curfunctionname = "";
|
||||
private int curargumentindex = 0;
|
||||
private int curfunctionstartpos = 0;
|
||||
private int curargumentindex;
|
||||
private int curfunctionstartpos;
|
||||
|
||||
// Status
|
||||
private bool changed;
|
||||
|
@ -158,7 +158,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Events
|
||||
scriptedit.ModEventMask = 0x7FFFF; // Which events to receive (see also ScriptModificationFlags)
|
||||
scriptedit.Modified += new ScintillaControl.ModifiedHandler(scriptedit_Modified);
|
||||
scriptedit.Modified += scriptedit_Modified;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -333,7 +333,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
stylelookup.Add(stylenum, (ScriptStyleType)(int)de.Value);
|
||||
|
||||
// Apply color to style
|
||||
int colorindex = 0;
|
||||
int colorindex;
|
||||
switch((ScriptStyleType)(int)de.Value)
|
||||
{
|
||||
case ScriptStyleType.PlainText: colorindex = ColorCollection.PLAINTEXT; break;
|
||||
|
@ -570,7 +570,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// This registers an XPM image for the autocomplete list
|
||||
private unsafe void RegisterAutoCompleteImage(ImageIndex index, byte[] imagedata)
|
||||
private void RegisterAutoCompleteImage(ImageIndex index, byte[] imagedata)
|
||||
{
|
||||
// Convert to string
|
||||
string bigstring = Encoding.UTF8.GetString(imagedata);
|
||||
|
@ -580,7 +580,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// This registers an XPM image for the markes list
|
||||
private unsafe void RegisterMarkerImage(ImageIndex index, byte[] imagedata)
|
||||
private void RegisterMarkerImage(ImageIndex index, byte[] imagedata)
|
||||
{
|
||||
// Convert to string
|
||||
string bigstring = Encoding.UTF8.GetString(imagedata);
|
||||
|
|
|
@ -78,14 +78,14 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
item = new ToolStripMenuItem(cfg.Description);
|
||||
//item.Image = buttonnew.Image;
|
||||
item.Tag = cfg;
|
||||
item.Click += new EventHandler(buttonnew_Click);
|
||||
item.Click += buttonnew_Click;
|
||||
buttonnew.DropDownItems.Add(item);
|
||||
|
||||
// Button for script type menu
|
||||
item = new ToolStripMenuItem(cfg.Description);
|
||||
//item.Image = buttonnew.Image;
|
||||
item.Tag = cfg;
|
||||
item.Click += new EventHandler(buttonscriptconfig_Click);
|
||||
item.Click += buttonscriptconfig_Click;
|
||||
buttonscriptconfig.DropDownItems.Add(item);
|
||||
}
|
||||
|
||||
|
@ -344,9 +344,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
ei.ImageIndex = 0;
|
||||
ei.SubItems.Add(e.description);
|
||||
if(e.filename.StartsWith("?"))
|
||||
ei.SubItems.Add(e.filename.Replace("?", "") + " (line " + e.linenumber.ToString() + ")");
|
||||
ei.SubItems.Add(e.filename.Replace("?", "") + " (line " + e.linenumber + ")");
|
||||
else
|
||||
ei.SubItems.Add(Path.GetFileName(e.filename) + " (line " + e.linenumber.ToString() + ")");
|
||||
ei.SubItems.Add(Path.GetFileName(e.filename) + " (line " + e.linenumber + ")");
|
||||
ei.Tag = e;
|
||||
errorlist.Items.Add(ei);
|
||||
listindex++;
|
||||
|
@ -735,7 +735,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Show warning
|
||||
if((compilererrors != null) && (compilererrors.Count > 0))
|
||||
General.MainWindow.DisplayStatus(StatusType.Warning, compilererrors.Count.ToString() + " errors while compiling " + t.Text + "!");
|
||||
General.MainWindow.DisplayStatus(StatusType.Warning, compilererrors.Count + " errors while compiling " + t.Text + "!");
|
||||
else
|
||||
General.MainWindow.DisplayStatus(StatusType.Info, "Script " + t.Text + " compiled without errors.");
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Compile script
|
||||
public override void Compile()
|
||||
{
|
||||
bool success = false; //mxd
|
||||
bool success; //mxd
|
||||
|
||||
// Compile
|
||||
if(ismapheader)
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This shows the info
|
||||
public void ShowInfo(Sector s)
|
||||
{
|
||||
string effectinfo = "";
|
||||
string effectinfo;
|
||||
|
||||
int sheight = s.CeilHeight - s.FloorHeight;
|
||||
|
||||
|
@ -50,9 +50,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(General.Map.Config.SectorEffects.ContainsKey(s.Effect))
|
||||
effectinfo = General.Map.Config.SectorEffects[s.Effect].ToString();
|
||||
else if(s.Effect == 0)
|
||||
effectinfo = s.Effect.ToString() + " - Normal";
|
||||
effectinfo = s.Effect + " - Normal";
|
||||
else
|
||||
effectinfo = s.Effect.ToString() + " - Unknown";
|
||||
effectinfo = s.Effect + " - Unknown";
|
||||
|
||||
// Sector info
|
||||
sectorinfo.Text = " Sector " + s.Index + " (" + (s.Sidedefs == null ? "no" : s.Sidedefs.Count.ToString()) + " sidedefs)"; //mxd
|
||||
|
@ -213,7 +213,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededCeilingInfo = true;
|
||||
ceilingAngle.Enabled = true;
|
||||
ceilingAngleLabel.Enabled = true;
|
||||
ceilingAngle.Text = s.Fields["rotationceiling"].Value.ToString() + "\u00B0";
|
||||
ceilingAngle.Text = s.Fields["rotationceiling"].Value + "\u00B0";
|
||||
} else {
|
||||
ceilingAngle.Text = "-";
|
||||
ceilingAngle.Enabled = false;
|
||||
|
@ -224,7 +224,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededFloorInfo = true;
|
||||
floorAngle.Enabled = true;
|
||||
floorAngleLabel.Enabled = true;
|
||||
floorAngle.Text = s.Fields["rotationfloor"].Value.ToString() + "\u00B0";
|
||||
floorAngle.Text = s.Fields["rotationfloor"].Value + "\u00B0";
|
||||
} else {
|
||||
floorAngle.Text = "-";
|
||||
floorAngle.Enabled = false;
|
||||
|
|
|
@ -47,16 +47,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
timer.Stop(); //mxd
|
||||
|
||||
// Check if name is a "none" texture
|
||||
if((imagename.Length < 1) || (imagename == "-"))
|
||||
{
|
||||
if((imagename.Length < 1) || (imagename == "-")) {
|
||||
DisplayImageSize(0, 0); //mxd
|
||||
|
||||
// Determine image to show
|
||||
if(required)
|
||||
return CodeImp.DoomBuilder.Properties.Resources.MissingTexture;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
return (required ? Properties.Resources.MissingTexture : null);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageData texture = General.Map.Data.GetTextureImage(imagename); //mxd
|
||||
|
@ -71,13 +67,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// This browses for a texture
|
||||
protected override string BrowseImage(string imagename)
|
||||
{
|
||||
string result;
|
||||
|
||||
protected override string BrowseImage(string imagename) {
|
||||
// Browse for texture
|
||||
result = TextureBrowserForm.Browse(this.ParentForm, imagename, false);
|
||||
if(result != null) return result; else return imagename;
|
||||
string result = TextureBrowserForm.Browse(this.ParentForm, imagename, false);
|
||||
return result ?? imagename;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,9 +48,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This shows the info
|
||||
public void ShowInfo(Thing t)
|
||||
{
|
||||
ThingTypeInfo ti;
|
||||
LinedefActionInfo act = null;
|
||||
string actioninfo = "";
|
||||
string actioninfo;
|
||||
string zinfo;
|
||||
float zvalue;
|
||||
|
||||
|
@ -78,7 +77,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
flagsPanel.Left = spritepanel.Left + spritepanel.Width + spritepanel.Margin.Right + flagsPanel.Margin.Left; //mxd
|
||||
|
||||
// Lookup thing info
|
||||
ti = General.Map.Data.GetThingInfo(t.Type);
|
||||
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
|
||||
|
||||
// Get thing action information
|
||||
if(General.Map.Config.LinedefActions.ContainsKey(t.Action))
|
||||
|
@ -87,9 +86,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
actioninfo = act.ToString();
|
||||
}
|
||||
else if(t.Action == 0)
|
||||
actioninfo = t.Action.ToString() + " - None";
|
||||
actioninfo = t.Action + " - None";
|
||||
else
|
||||
actioninfo = t.Action.ToString() + " - Unknown";
|
||||
actioninfo = t.Action + " - Unknown";
|
||||
|
||||
// Determine z info to show
|
||||
t.DetermineSector();
|
||||
|
@ -117,7 +116,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
{
|
||||
zvalue = t.Position.z;
|
||||
if(zvalue >= 0.0f) zinfo = "+" + zvalue.ToString(); else zinfo = zvalue.ToString();
|
||||
if(zvalue >= 0.0f) zinfo = "+" + zvalue; else zinfo = zvalue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
private float loadfinishtime;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -1513,7 +1513,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Go for all things
|
||||
foreach(ThingTypeInfo ti in thingtypes.Values) {
|
||||
// Valid sprite name?
|
||||
string sprite = string.Empty;
|
||||
string sprite;
|
||||
|
||||
if(ti.Sprite.Length == 0 || ti.Sprite.Length > 8) {
|
||||
if(ti.Actor == null) continue;
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Variables
|
||||
|
||||
protected DataLocation location;
|
||||
protected bool issuspended = false;
|
||||
protected bool isdisposed = false;
|
||||
protected bool issuspended;
|
||||
protected bool isdisposed;
|
||||
protected ResourceTextureSet textureset;
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -67,12 +67,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
protected Bitmap bitmap;
|
||||
|
||||
// Direct3D texture
|
||||
private int mipmaplevels = 0; // 0 = all mipmaps
|
||||
private int mipmaplevels; // 0 = all mipmaps
|
||||
protected bool dynamictexture;
|
||||
private Texture texture;
|
||||
|
||||
// Disposing
|
||||
protected bool isdisposed = false;
|
||||
protected bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
private Queue<ImageData> imageque;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private Bitmap loadbitmap = null;
|
||||
private Bitmap loadbitmap;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
{
|
||||
// Scale and power this for nicer usability
|
||||
Vector2D pansign = panamount.GetSign();
|
||||
panamount = (panamount * panamount) * pansign * 0.0001f * (float)General.Settings.AutoScrollSpeed / renderer.Scale;
|
||||
panamount = (panamount * panamount) * pansign * 0.0001f * General.Settings.AutoScrollSpeed / renderer.Scale;
|
||||
|
||||
// Multiply by delta time
|
||||
panamount.x *= deltatime;
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
#region ================== Variables
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
// Last inserted prefab
|
||||
private string lastprefabfile;
|
||||
|
@ -161,7 +161,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
General.Map.UndoRedo.CreateUndo("Insert prefab");
|
||||
|
||||
// Decompress stream
|
||||
MemoryStream memstream = null; //mxd
|
||||
MemoryStream memstream; //mxd
|
||||
filedata.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
try {
|
||||
|
|
|
@ -32,16 +32,16 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
#region ================== Variables
|
||||
|
||||
// Properties
|
||||
private string switchaction = null;
|
||||
private string buttonimage = null;
|
||||
private int buttonorder = 0;
|
||||
private string switchaction;
|
||||
private string buttonimage;
|
||||
private int buttonorder;
|
||||
private string buttongroup = "~none";
|
||||
private bool optional = true;
|
||||
private bool isvolatile = false;
|
||||
private bool isvolatile;
|
||||
private string displayname = "<unnamed mode>";
|
||||
private bool allowcopypaste = true;
|
||||
private bool usebydefault = false;
|
||||
private bool safestartmode = false;
|
||||
private bool usebydefault;
|
||||
private bool safestartmode;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -41,13 +41,13 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
private EditModeAttribute attribs;
|
||||
|
||||
// Mode switching
|
||||
private BeginActionAttribute switchactionattr = null;
|
||||
private ActionDelegate switchactiondel = null;
|
||||
private BeginActionAttribute switchactionattr;
|
||||
private ActionDelegate switchactiondel;
|
||||
|
||||
// Mode button
|
||||
private Stream buttonimagestream = null;
|
||||
private Image buttonimage = null;
|
||||
private string buttondesc = null;
|
||||
private Stream buttonimagestream;
|
||||
private Image buttonimage;
|
||||
private string buttondesc;
|
||||
private int buttonorder = int.MaxValue;
|
||||
|
||||
#endregion
|
||||
|
@ -115,7 +115,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
{
|
||||
if((switchactiondel == null) && (switchactionattr != null))
|
||||
{
|
||||
switchactiondel = new ActionDelegate(UserSwitchToMode);
|
||||
switchactiondel = UserSwitchToMode;
|
||||
General.Actions.BindBeginDelegate(plugin.Assembly, switchactiondel, switchactionattr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
private bool disengaging;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -135,8 +135,8 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
backsource = cfg.ReadSetting(path + ".backsource", 0);
|
||||
backoffsetx = cfg.ReadSetting(path + ".backoffsetx", 0);
|
||||
backoffsety = cfg.ReadSetting(path + ".backoffsety", 0);
|
||||
backscalex = (float)cfg.ReadSetting(path + ".backscalex", 100) / 100.0f;
|
||||
backscaley = (float)cfg.ReadSetting(path + ".backscaley", 100) / 100.0f;
|
||||
backscalex = cfg.ReadSetting(path + ".backscalex", 100) / 100.0f;
|
||||
backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f;
|
||||
gridsize = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE);
|
||||
|
||||
// Setup
|
||||
|
@ -149,7 +149,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
{
|
||||
// Change grid
|
||||
this.gridsize = size;
|
||||
this.gridsizef = (float)gridsize;
|
||||
this.gridsizef = gridsize;
|
||||
this.gridsizefinv = 1f / gridsizef;
|
||||
|
||||
// Update in main window
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
protected Dictionary<Thing, bool> thingsvisiblestate;
|
||||
|
||||
// Disposing
|
||||
protected bool isdisposed = false;
|
||||
protected bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
foreach(DictionaryEntry de in fields)
|
||||
{
|
||||
// Add to the corresponding list
|
||||
if((bool)de.Value == true)
|
||||
if((bool)de.Value)
|
||||
requiredfields.Add(de.Key.ToString());
|
||||
else
|
||||
forbiddenfields.Add(de.Key.ToString());
|
||||
|
@ -150,7 +150,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
IDictionary fieldvalues = cfg.ReadSetting(path + ".customfieldvalues", new Hashtable());
|
||||
foreach(DictionaryEntry fv in fieldvalues)
|
||||
{
|
||||
int ft = cfg.ReadSetting(path + ".customfieldtypes." + fv.Key.ToString(), 0);
|
||||
int ft = cfg.ReadSetting(path + ".customfieldtypes." + fv.Key, 0);
|
||||
customfields.Add(fv.Key.ToString(), new UniValue(ft, fv.Value));
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
{
|
||||
if(t.Flags.ContainsKey(s))
|
||||
{
|
||||
if(t.Flags[s] == true)
|
||||
if(t.Flags[s])
|
||||
{
|
||||
qualifies = false;
|
||||
break;
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
private Thread backgroundthread;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -170,7 +170,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
General.Actions.BindMethods(this);
|
||||
|
||||
// Start background thread
|
||||
backgroundthread = new Thread(new ThreadStart(BackgroundThread));
|
||||
backgroundthread = new Thread(BackgroundThread);
|
||||
backgroundthread.Name = "Snapshot Compressor";
|
||||
backgroundthread.Priority = ThreadPriority.Lowest;
|
||||
backgroundthread.IsBackground = true;
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
|
||||
private void tbColor_TextChanged(object sender, EventArgs e) {
|
||||
if(blockUpdate) return;
|
||||
int colorVal = defaultValue;
|
||||
int colorVal;
|
||||
|
||||
if(int.TryParse(tbColor.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out colorVal)){
|
||||
colorVal = General.Clamp(colorVal, 0, 16777215);
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
{
|
||||
#region Selected Node(s) Properties
|
||||
|
||||
private List<TreeNode> m_SelectedNodes = null;
|
||||
private List<TreeNode> m_SelectedNodes;
|
||||
public List<TreeNode> SelectedNodes {
|
||||
get {
|
||||
return m_SelectedNodes;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -106,8 +106,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data {
|
|||
}
|
||||
}
|
||||
|
||||
Vector3D start = new Vector3D();
|
||||
Vector3D end = new Vector3D();
|
||||
Vector3D start, end;
|
||||
|
||||
//process path nodes
|
||||
if (result.ProcessPathNodes) {
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||
namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||
{
|
||||
public enum ModelLoadState
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
|
|||
//check if we have something like "999(void)" as a token
|
||||
if (token.Contains("(")) token = token.Substring(0, token.IndexOf("("));
|
||||
|
||||
int n = 0;
|
||||
int n;
|
||||
if (int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out n)) {
|
||||
int endPos = (int)stream.Position - 1;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using SlimDX;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
|
||||
if (token == "MODEL") {
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken(); //should be model name
|
||||
ReadToken(); //should be model name
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken();//should be opening brace
|
||||
|
||||
|
@ -35,9 +35,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
|
||||
}else if(token == "SCRIPT"){
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken(); //should be script name or number
|
||||
ReadToken(); //should be script name or number
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken(); //should be script parameters/type
|
||||
ReadToken(); //should be script parameters/type
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken(); //should be opening brace
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
|
|||
|
||||
}else if(token == "ACTOR"){
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken(); //should be actor name
|
||||
ReadToken(); //should be actor name
|
||||
|
||||
SkipWhitespace(true);
|
||||
token = ReadToken();
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
foreach(Thing t in list) {
|
||||
t.Selected = true;
|
||||
|
||||
Vector2D p = (Vector2D)t.Position;
|
||||
Vector2D p = t.Position;
|
||||
points.Add(p);
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, t.Size * 2.0f));
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, -t.Size * 2.0f));
|
||||
|
@ -345,7 +345,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
foreach(Thing t in list) {
|
||||
t.Selected = true;
|
||||
|
||||
Vector2D p = (Vector2D)t.Position;
|
||||
Vector2D p = t.Position;
|
||||
points.Add(p);
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, t.Size * 2.0f));
|
||||
points.Add(p + new Vector2D(t.Size * 2.0f, -t.Size * 2.0f));
|
||||
|
|
|
@ -483,13 +483,13 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
s.Position = ofs_tris + start;
|
||||
|
||||
for (int i = 0; i < num_tris; i++) {
|
||||
polyIndecesList.Add((int)br.ReadUInt16());
|
||||
polyIndecesList.Add((int)br.ReadUInt16());
|
||||
polyIndecesList.Add((int)br.ReadUInt16());
|
||||
polyIndecesList.Add(br.ReadUInt16());
|
||||
polyIndecesList.Add(br.ReadUInt16());
|
||||
polyIndecesList.Add(br.ReadUInt16());
|
||||
|
||||
uvIndecesList.Add((int)br.ReadUInt16());
|
||||
uvIndecesList.Add((int)br.ReadUInt16());
|
||||
uvIndecesList.Add((int)br.ReadUInt16());
|
||||
uvIndecesList.Add(br.ReadUInt16());
|
||||
uvIndecesList.Add(br.ReadUInt16());
|
||||
uvIndecesList.Add(br.ReadUInt16());
|
||||
}
|
||||
|
||||
//UV coords
|
||||
|
@ -504,8 +504,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
if (s.Position != ofs_animFrame + start)
|
||||
s.Position = ofs_animFrame + start;
|
||||
|
||||
Vector3 scale = new Vector3((float)br.ReadSingle(), (float)br.ReadSingle(), (float)br.ReadSingle());
|
||||
Vector3 translate = new Vector3((float)br.ReadSingle(), (float)br.ReadSingle(), (float)br.ReadSingle());
|
||||
Vector3 scale = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
|
||||
Vector3 translate = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
|
||||
|
||||
s.Position += 16; //frame name
|
||||
|
||||
|
@ -522,9 +522,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
for (int i = 0; i < num_verts; i++) {
|
||||
WorldVertex v = new WorldVertex();
|
||||
|
||||
v.x = ((float)br.ReadByte() * scale.X + translate.X);
|
||||
v.y = ((float)br.ReadByte() * scale.Y + translate.Y);
|
||||
v.z = ((float)br.ReadByte() * scale.Z + translate.Z);
|
||||
v.x = (br.ReadByte() * scale.X + translate.X);
|
||||
v.y = (br.ReadByte() * scale.Y + translate.Y);
|
||||
v.z = (br.ReadByte() * scale.Z + translate.Z);
|
||||
|
||||
//rotate it
|
||||
float rx = angleOfsetCos * v.x - angleOfsetSin * v.y;
|
||||
|
@ -900,7 +900,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
ms.Dispose();
|
||||
|
||||
if(bitmap != null) {
|
||||
BitmapData bmlock = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
||||
BitmapData bmlock = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
||||
texture = new Texture(device, bitmap.Width, bitmap.Height, 1, Usage.None, Format.A8R8G8B8, Pool.Managed);
|
||||
|
||||
DataRectangle textureLock = texture.LockRectangle(0, LockFlags.None);
|
||||
|
@ -921,7 +921,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
|
||||
private static string ReadString(BinaryReader br, int len) {
|
||||
var NAME = string.Empty;
|
||||
int i = 0;
|
||||
int i;
|
||||
for (i = 0; i < len; ++i) {
|
||||
var c = br.ReadChar();
|
||||
if (c == '\0') {
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder
|
|||
};
|
||||
|
||||
internal static uint ComputeCrc32(uint oldCrc, byte value) {
|
||||
return (uint)(Crc32.CrcTable[(oldCrc ^ value) & 0xFF] ^ (oldCrc >> 8));
|
||||
return (Crc32.CrcTable[(oldCrc ^ value) & 0xFF] ^ (oldCrc >> 8));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -155,7 +155,7 @@ namespace CodeImp.DoomBuilder
|
|||
/// </summary>
|
||||
public long Value {
|
||||
get {
|
||||
return (long)crc;
|
||||
return crc;
|
||||
}
|
||||
set {
|
||||
crc = (uint)value;
|
||||
|
|
|
@ -373,7 +373,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to load configuration
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration '" + de.Key.ToString() + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration '" + de.Key + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder
|
|||
// Store the number if we found one
|
||||
if(numstr.Length > 0)
|
||||
{
|
||||
int num = 0;
|
||||
int num;
|
||||
int.TryParse(numstr, out num);
|
||||
if(first) p_l1 = num.ToString(); else p_l2 = num.ToString();
|
||||
numstr = "";
|
||||
|
@ -176,7 +176,7 @@ namespace CodeImp.DoomBuilder
|
|||
// Store the number if we found one
|
||||
if(numstr.Length > 0)
|
||||
{
|
||||
int num = 0;
|
||||
int num;
|
||||
int.TryParse(numstr, out num);
|
||||
if(first) p_l1 = num.ToString(); else p_l2 = num.ToString();
|
||||
}
|
||||
|
|
|
@ -1121,7 +1121,7 @@ namespace CodeImp.DoomBuilder {
|
|||
// We don't want to bother the user with this. There are a lot of lumps in
|
||||
// the game configs that are trivial and don't need to be found.
|
||||
if (lumprequired) {
|
||||
General.ErrorLogger.Add(ErrorType.Warning, ml.Key.ToString() + " (required lump) should be read but was not found in the WAD file.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, ml.Key + " (required lump) should be read but was not found in the WAD file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
while(low < high)
|
||||
{
|
||||
int mid = (int)Math.Floor((float)(low + high) * 0.5f);
|
||||
int mid = (int)Math.Floor((low + high) * 0.5f);
|
||||
int l = base[mid];
|
||||
|
||||
if(l <= level)
|
||||
|
@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
while(low < high)
|
||||
{
|
||||
int mid = (int)Math.Ceiling((float)(low + high) * 0.5f);
|
||||
int mid = (int)Math.Ceiling((low + high) * 0.5f);
|
||||
int l = base[mid];
|
||||
|
||||
if(l >= level)
|
||||
|
@ -85,7 +85,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
while(low < high)
|
||||
{
|
||||
int mid = (int)Math.Floor((float)(low + high) * 0.5f);
|
||||
int mid = (int)Math.Floor((low + high) * 0.5f);
|
||||
int l = base[mid];
|
||||
|
||||
if(l <= level)
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
// This converts doom angle to real angle
|
||||
public static float DoomToReal(int doomangle)
|
||||
{
|
||||
return (float)Math.Round(Normalized(DegToRad((float)(doomangle + 90))), 4);
|
||||
return (float)Math.Round(Normalized(DegToRad((doomangle + 90))), 4);
|
||||
}
|
||||
|
||||
// This converts real angle to doom angle
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
|
||||
int totalSteps = steps + 1;
|
||||
Vector2D[] points = new Vector2D[totalSteps];
|
||||
float step = 1f / (float)steps;
|
||||
float step = 1f / steps;
|
||||
float curStep = 0f;
|
||||
|
||||
for(int i = 0; i < totalSteps; i++) {
|
||||
|
@ -238,7 +238,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
|
||||
int totalSteps = steps + 1;
|
||||
Vector2D[] points = new Vector2D[totalSteps];
|
||||
float step = 1f / (float)steps;
|
||||
float step = 1f / steps;
|
||||
float curStep = 0f;
|
||||
|
||||
for(int i = 0; i < totalSteps; i++) {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using System.Collections.ObjectModel;
|
||||
|
|
|
@ -320,19 +320,19 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
}
|
||||
|
||||
// Transform
|
||||
public unsafe Vector2D GetTransformed(float offsetx, float offsety, float scalex, float scaley)
|
||||
public Vector2D GetTransformed(float offsetx, float offsety, float scalex, float scaley)
|
||||
{
|
||||
return new Vector2D((x + offsetx) * scalex, (y + offsety) * scaley);
|
||||
}
|
||||
|
||||
// Inverse Transform
|
||||
public unsafe Vector2D GetInvTransformed(float invoffsetx, float invoffsety, float invscalex, float invscaley)
|
||||
public Vector2D GetInvTransformed(float invoffsetx, float invoffsety, float invscalex, float invscaley)
|
||||
{
|
||||
return new Vector2D((x * invscalex) + invoffsetx, (y * invscaley) + invoffsety);
|
||||
}
|
||||
|
||||
// Rotate (Added by Anders Åstrand 2008-05-18)
|
||||
public unsafe Vector2D GetRotated(float theta)
|
||||
public Vector2D GetRotated(float theta)
|
||||
{
|
||||
float cos = (float)Math.Cos(theta);
|
||||
float sin = (float)Math.Sin(theta);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using System.IO;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
private long position;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -621,8 +621,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Is it a number?
|
||||
if(NUMBERS.IndexOf(c.ToString(CultureInfo.InvariantCulture)) > -1)
|
||||
{
|
||||
int vv = 0;
|
||||
char vc = '0';
|
||||
int vv;
|
||||
char vc;
|
||||
|
||||
// Convert the next 3 characters to a number
|
||||
string v = data.Substring(pos, 3);
|
||||
|
@ -712,7 +712,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Floating point?
|
||||
if(val.IndexOf("f") > -1)
|
||||
{
|
||||
float fval = 0;
|
||||
float fval;
|
||||
|
||||
// Convert to float (remove the f first)
|
||||
try { fval = Convert.ToSingle(val.Trim().Replace("f", ""), CultureInfo.InvariantCulture); }
|
||||
|
@ -1188,7 +1188,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
//db.Append("="); db.Append(spacing); db.Append("null;"); db.Append(newline);
|
||||
|
||||
// Output key only
|
||||
db.Append(leveltabs); db.Append(de.Key.ToString()); db.Append(";"); db.Append(newline);
|
||||
db.Append(leveltabs); db.Append(de.Key); db.Append(";"); db.Append(newline);
|
||||
}
|
||||
// Check if the value if of ConfigStruct type
|
||||
else if(de.Value is IDictionary)
|
||||
|
@ -1208,13 +1208,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
if((bool)de.Value)
|
||||
{
|
||||
// Output the keyword "true"
|
||||
db.Append(leveltabs); db.Append(de.Key.ToString()); db.Append(spacing);
|
||||
db.Append(leveltabs); db.Append(de.Key); db.Append(spacing);
|
||||
db.Append("="); db.Append(spacing); db.Append("true;"); db.Append(newline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Output the keyword "false"
|
||||
db.Append(leveltabs); db.Append(de.Key.ToString()); db.Append(spacing);
|
||||
db.Append(leveltabs); db.Append(de.Key); db.Append(spacing);
|
||||
db.Append("="); db.Append(spacing); db.Append("false;"); db.Append(newline);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ using System.Drawing.Imaging;
|
|||
|
||||
namespace CodeImp.DoomBuilder.IO
|
||||
{
|
||||
internal unsafe class DoomColormapReader : IImageReader
|
||||
internal class DoomColormapReader : IImageReader
|
||||
{
|
||||
#region ================== Variables
|
||||
|
||||
|
@ -82,7 +82,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
// This creates a Bitmap from the given data
|
||||
// Returns null on failure
|
||||
public Bitmap ReadAsBitmap(Stream stream)
|
||||
public unsafe Bitmap ReadAsBitmap(Stream stream)
|
||||
{
|
||||
BitmapData bitmapdata;
|
||||
PixelColorBlock pixeldata;
|
||||
|
@ -167,9 +167,9 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
// This creates pixel color data from the given data
|
||||
// Returns null on failure
|
||||
private PixelColorBlock ReadAsPixelData(Stream stream, out int width, out int height)
|
||||
private unsafe PixelColorBlock ReadAsPixelData(Stream stream, out int width, out int height)
|
||||
{
|
||||
PixelColorBlock pixeldata = null;
|
||||
PixelColorBlock pixeldata;
|
||||
byte[] bytes;
|
||||
|
||||
// Image will be 128x128
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
private PixelColorBlock ReadAsPixelData(Stream stream, out int width, out int height)
|
||||
{
|
||||
new BinaryReader(stream);
|
||||
PixelColorBlock pixeldata = null;
|
||||
PixelColorBlock pixeldata;
|
||||
float sqrlength;
|
||||
byte[] bytes;
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
y = reader.ReadInt16();
|
||||
|
||||
// Create new item
|
||||
v = map.CreateVertex(new Vector2D((float)x, (float)y));
|
||||
v = map.CreateVertex(new Vector2D(x, y));
|
||||
|
||||
// Add it to the lookup table
|
||||
link.Add(i, v);
|
||||
|
|
|
@ -179,7 +179,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
private PixelColorBlock ReadAsPixelData(Stream stream, out int width, out int height, out int offsetx, out int offsety)
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
PixelColorBlock pixeldata = null;
|
||||
PixelColorBlock pixeldata;
|
||||
int y, read_y, count, p;
|
||||
int[] columns;
|
||||
int dataoffset;
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
y = reader.ReadInt16();
|
||||
|
||||
// Create new item
|
||||
v = map.CreateVertex(new Vector2D((float)x, (float)y));
|
||||
v = map.CreateVertex(new Vector2D(x, y));
|
||||
|
||||
// Add it to the lookup table
|
||||
link.Add(i, v);
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
private int length;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ using System.Collections.Generic;
|
|||
using System.Text;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using System.Collections;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
|
||||
|
|
|
@ -57,15 +57,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
#region ================== Variables
|
||||
|
||||
// Error result
|
||||
private int cpErrorResult = 0;
|
||||
private int cpErrorResult;
|
||||
private string cpErrorDescription = "";
|
||||
private int cpErrorLine = 0;
|
||||
private int cpErrorLine;
|
||||
|
||||
// Configuration root
|
||||
private UniversalCollection root = null;
|
||||
private UniversalCollection root;
|
||||
|
||||
private const string numbers = "0123456789";
|
||||
private const string numbers2 = "0123456789-.&";
|
||||
private const string newline = "\n";
|
||||
private char[] newlineChar = new[] {'\n'};
|
||||
private StringBuilder key; //mxd
|
||||
|
@ -343,7 +341,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
pm = PM_STRING; //numbers
|
||||
}
|
||||
// Check for numeric character numbers
|
||||
else if(numbers2.IndexOf(c) > -1)
|
||||
else if(Configuration.NUMBERS2.IndexOf(c) > -1)
|
||||
{
|
||||
// Now parsing number
|
||||
pm = PM_NUMBER;
|
||||
|
@ -393,38 +391,38 @@ namespace CodeImp.DoomBuilder.IO
|
|||
try
|
||||
{
|
||||
// Convert to value
|
||||
int ival = System.Convert.ToInt32(s.Substring(2).Trim(), 16);
|
||||
int ival = Convert.ToInt32(s.Substring(2).Trim(), 16);
|
||||
|
||||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
}
|
||||
catch(System.OverflowException)
|
||||
catch(OverflowException)
|
||||
{
|
||||
// Too large for Int32, try Int64
|
||||
try
|
||||
{
|
||||
// Convert to value
|
||||
long lval = System.Convert.ToInt64(s.Substring(2).Trim(), 16);
|
||||
long lval = Convert.ToInt64(s.Substring(2).Trim(), 16);
|
||||
|
||||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
}
|
||||
catch(System.OverflowException)
|
||||
catch(OverflowException)
|
||||
{
|
||||
// Too large for Int64, return error
|
||||
RaiseError(line, ERROR_VALUETOOBIG);
|
||||
}
|
||||
catch(System.FormatException)
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
}
|
||||
}
|
||||
catch(System.FormatException)
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
|
@ -436,8 +434,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
float fval = 0;
|
||||
|
||||
// Convert to float (remove the f first)
|
||||
try { fval = System.Convert.ToSingle(s.Trim(), CultureInfo.InvariantCulture); }
|
||||
catch(System.FormatException)
|
||||
try { fval = Convert.ToSingle(s.Trim(), CultureInfo.InvariantCulture); }
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
|
@ -454,14 +452,14 @@ namespace CodeImp.DoomBuilder.IO
|
|||
try
|
||||
{
|
||||
// Convert to value
|
||||
int ival = System.Convert.ToInt32(s.Trim(), CultureInfo.InvariantCulture);
|
||||
int ival = Convert.ToInt32(s.Trim(), CultureInfo.InvariantCulture);
|
||||
|
||||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
}
|
||||
catch(System.OverflowException)
|
||||
catch(OverflowException)
|
||||
{
|
||||
// Too large for Int32, try Int64
|
||||
try
|
||||
|
@ -474,7 +472,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
}
|
||||
catch(System.OverflowException)
|
||||
catch(OverflowException)
|
||||
{
|
||||
// Too large for Int64, return error
|
||||
RaiseError(line, ERROR_VALUETOOBIG);
|
||||
|
@ -485,7 +483,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
}
|
||||
}
|
||||
catch(System.FormatException)
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
|
@ -528,23 +526,23 @@ namespace CodeImp.DoomBuilder.IO
|
|||
case 't': val.Append('\t'); break;
|
||||
default:
|
||||
// Is it a number?
|
||||
if(numbers.IndexOf(c) > -1)
|
||||
if(Configuration.NUMBERS.IndexOf(c) > -1)
|
||||
{
|
||||
int vv = 0;
|
||||
char vc = '0';
|
||||
|
||||
// Convert the next 3 characters to a number
|
||||
string v = data[line].Substring(pos, 3);
|
||||
try { vv = System.Convert.ToInt32(v.Trim(), CultureInfo.InvariantCulture); }
|
||||
catch(System.FormatException)
|
||||
try { vv = Convert.ToInt32(v.Trim(), CultureInfo.InvariantCulture); }
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
}
|
||||
|
||||
// Convert the number to a char
|
||||
try { vc = System.Convert.ToChar(vv, CultureInfo.InvariantCulture); }
|
||||
catch(System.FormatException)
|
||||
try { vc = Convert.ToChar(vv, CultureInfo.InvariantCulture); }
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID);
|
||||
|
|
|
@ -26,7 +26,7 @@ using System.Drawing.Imaging;
|
|||
|
||||
namespace CodeImp.DoomBuilder.IO
|
||||
{
|
||||
internal unsafe class UnknownImageReader : IImageReader
|
||||
internal class UnknownImageReader : IImageReader
|
||||
{
|
||||
public uint ImageType { get; private set; } //mxd
|
||||
|
||||
|
@ -56,13 +56,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// This reads the image and returns a Bitmap
|
||||
public Bitmap ReadAsBitmap(Stream stream)
|
||||
{
|
||||
return new Bitmap(CodeImp.DoomBuilder.Properties.Resources.Failed);
|
||||
return new Bitmap(Properties.Resources.Failed);
|
||||
}
|
||||
|
||||
// This reads the image and returns a Bitmap
|
||||
public static Bitmap ReadAsBitmap()
|
||||
{
|
||||
return new Bitmap(CodeImp.DoomBuilder.Properties.Resources.Failed);
|
||||
return new Bitmap(Properties.Resources.Failed);
|
||||
}
|
||||
|
||||
// This draws the picture to the given pixel color data
|
||||
|
|
|
@ -54,8 +54,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
private List<Lump> lumps;
|
||||
|
||||
// Status
|
||||
private bool isreadonly = false;
|
||||
private bool isdisposed = false;
|
||||
private bool isreadonly;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -114,8 +114,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// This returns the block center in world coordinates
|
||||
protected Vector2D GetBlockCenter(Point p)
|
||||
{
|
||||
return new Vector2D((float)((p.X << blocksizeshift) + (blocksize >> 1)) + range.Left,
|
||||
(float)((p.Y << blocksizeshift) + (blocksize >> 1)) + range.Top);
|
||||
return new Vector2D(((p.X << blocksizeshift) + (blocksize >> 1)) + range.Left,
|
||||
((p.Y << blocksizeshift) + (blocksize >> 1)) + range.Top);
|
||||
}
|
||||
|
||||
// This returns true when the given block is inside range
|
||||
|
|
|
@ -398,7 +398,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
{
|
||||
// First make a single integer with all bits from activation and flags
|
||||
int bits = activate;
|
||||
int flagbit = 0;
|
||||
int flagbit;
|
||||
foreach(KeyValuePair<string, bool> f in flags)
|
||||
if(int.TryParse(f.Key, out flagbit) && f.Value) bits |= flagbit;
|
||||
|
||||
|
@ -444,7 +444,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
foreach(KeyValuePair<string, string> f in General.Map.Config.LinedefFlags)
|
||||
{
|
||||
// Flag must be numeric
|
||||
int flagbit = 0;
|
||||
int flagbit;
|
||||
if(int.TryParse(f.Key, out flagbit))
|
||||
{
|
||||
foreach(FlagTranslation ft in General.Map.Config.LinedefFlagsTranslation)
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
protected bool marked;
|
||||
|
||||
// Disposing
|
||||
protected bool isdisposed = false;
|
||||
protected bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
private MapSet map;
|
||||
|
||||
// Sector
|
||||
private Sector sector = null;
|
||||
private Sector sector;
|
||||
|
||||
// List items
|
||||
private LinkedListNode<Thing> selecteditem;
|
||||
|
@ -256,7 +256,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
{
|
||||
// First make a single integer with all flags
|
||||
int bits = 0;
|
||||
int flagbit = 0;
|
||||
int flagbit;
|
||||
foreach(KeyValuePair<string, bool> f in flags)
|
||||
if(int.TryParse(f.Key, out flagbit) && f.Value) bits |= flagbit;
|
||||
|
||||
|
@ -292,7 +292,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
foreach(KeyValuePair<string, string> f in General.Map.Config.ThingFlags)
|
||||
{
|
||||
// Flag must be numeric
|
||||
int flagbit = 0;
|
||||
int flagbit;
|
||||
if(int.TryParse(f.Key, out flagbit))
|
||||
{
|
||||
foreach(FlagTranslation ft in General.Map.Config.ThingFlagsTranslation)
|
||||
|
@ -496,7 +496,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
public void SnapToGrid()
|
||||
{
|
||||
// Calculate nearest grid coordinates
|
||||
this.Move(General.Map.Grid.SnappedToGrid((Vector2D)pos));
|
||||
this.Move(General.Map.Grid.SnappedToGrid(pos));
|
||||
}
|
||||
|
||||
// This snaps the vertex to the map format accuracy
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
private Plugin plugin;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
//mxd. It's nice to have these avaliable to plugins...
|
||||
public static Point DisplayLocationAbs {
|
||||
|
@ -288,12 +288,12 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
/// <summary>
|
||||
/// Called when an Action begins.
|
||||
/// </summary>
|
||||
public virtual void OnActionBegin(CodeImp.DoomBuilder.Actions.Action action) { }
|
||||
public virtual void OnActionBegin(Actions.Action action) { }
|
||||
|
||||
/// <summary>
|
||||
/// Called when an Action ends.
|
||||
/// </summary>
|
||||
public virtual void OnActionEnd(CodeImp.DoomBuilder.Actions.Action action) { }
|
||||
public virtual void OnActionEnd(Actions.Action action) { }
|
||||
|
||||
/// <summary>
|
||||
/// Called when an Editing Mode engages
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
private string name;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
private List<Plugin> plugins;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -286,8 +286,8 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
public void OnSectorFloorSurfaceUpdate(Sector s, ref FlatVertex[] vertices) { foreach(Plugin p in plugins) p.Plug.OnSectorFloorSurfaceUpdate(s, ref vertices); }
|
||||
public void OnShowPreferences(PreferencesController controller) { foreach(Plugin p in plugins) p.Plug.OnShowPreferences(controller); }
|
||||
public void OnClosePreferences(PreferencesController controller) { foreach(Plugin p in plugins) p.Plug.OnClosePreferences(controller); }
|
||||
public void OnActionBegin(CodeImp.DoomBuilder.Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionBegin(action); }
|
||||
public void OnActionEnd(CodeImp.DoomBuilder.Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionEnd(action); }
|
||||
public void OnActionBegin(Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionBegin(action); }
|
||||
public void OnActionEnd(Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionEnd(action); }
|
||||
public void OnEditEngage(EditMode oldmode, EditMode newmode) { foreach(Plugin p in plugins) p.Plug.OnEditEngage(oldmode, newmode); }
|
||||
public void OnEditDisengage(EditMode oldmode, EditMode newmode) { foreach(Plugin p in plugins) p.Plug.OnEditDisengage(oldmode, newmode); }
|
||||
public void OnEditCancel() { foreach(Plugin p in plugins) p.Plug.OnEditCancel(); }
|
||||
|
|
|
@ -21,7 +21,6 @@ using System.Collections.Generic;
|
|||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using SlimDX.Direct3D9;
|
||||
using System.ComponentModel;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using SlimDX;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
@ -61,7 +60,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private ResourceImage fonttexture;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
protected VertexDeclaration vertexdecl;
|
||||
|
||||
// Disposing
|
||||
protected bool isdisposed = false;
|
||||
protected bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -112,26 +112,25 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
//To ColorRef (alpha-less). mxd. Changed function name to more descriptive one...
|
||||
public int ToInversedColorRef()
|
||||
{
|
||||
return ((int)r + ((int)b << 16) + ((int)g << 8));
|
||||
//return (((int)r << 16) + ((int)g << 8) + (int)b);
|
||||
return (r + (b << 16) + (g << 8));
|
||||
}
|
||||
|
||||
// To ColorValue
|
||||
public Color4 ToColorValue()
|
||||
{
|
||||
return new Color4((float)a * BYTE_TO_FLOAT,
|
||||
(float)r * BYTE_TO_FLOAT,
|
||||
(float)g * BYTE_TO_FLOAT,
|
||||
(float)b * BYTE_TO_FLOAT);
|
||||
return new Color4(a * BYTE_TO_FLOAT,
|
||||
r * BYTE_TO_FLOAT,
|
||||
g * BYTE_TO_FLOAT,
|
||||
b * BYTE_TO_FLOAT);
|
||||
}
|
||||
|
||||
// To ColorValue
|
||||
public Color4 ToColorValue(float withalpha)
|
||||
{
|
||||
return new Color4(withalpha,
|
||||
(float)r * BYTE_TO_FLOAT,
|
||||
(float)g * BYTE_TO_FLOAT,
|
||||
(float)b * BYTE_TO_FLOAT);
|
||||
r * BYTE_TO_FLOAT,
|
||||
g * BYTE_TO_FLOAT,
|
||||
b * BYTE_TO_FLOAT);
|
||||
}
|
||||
|
||||
// This returns a new PixelColor with adjusted alpha
|
||||
|
@ -146,11 +145,11 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
PixelColor c = new PixelColor();
|
||||
float ba;
|
||||
|
||||
ba = (float)a.a * BYTE_TO_FLOAT;
|
||||
c.r = (byte)((float)a.r * (1f - ba) + (float)b.r * ba);
|
||||
c.g = (byte)((float)a.g * (1f - ba) + (float)b.g * ba);
|
||||
c.b = (byte)((float)a.b * (1f - ba) + (float)b.b * ba);
|
||||
c.a = (byte)((float)a.a * (1f - ba) + ba);
|
||||
ba = a.a * BYTE_TO_FLOAT;
|
||||
c.r = (byte)(a.r * (1f - ba) + b.r * ba);
|
||||
c.g = (byte)(a.g * (1f - ba) + b.g * ba);
|
||||
c.b = (byte)(a.b * (1f - ba) + b.b * ba);
|
||||
c.a = (byte)(a.a * (1f - ba) + ba);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
@ -158,14 +157,14 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// This modulates two colors
|
||||
public static PixelColor Modulate(PixelColor a, PixelColor b)
|
||||
{
|
||||
float aa = (float)a.a * BYTE_TO_FLOAT;
|
||||
float ar = (float)a.r * BYTE_TO_FLOAT;
|
||||
float ag = (float)a.g * BYTE_TO_FLOAT;
|
||||
float ab = (float)a.b * BYTE_TO_FLOAT;
|
||||
float ba = (float)b.a * BYTE_TO_FLOAT;
|
||||
float br = (float)b.r * BYTE_TO_FLOAT;
|
||||
float bg = (float)b.g * BYTE_TO_FLOAT;
|
||||
float bb = (float)b.b * BYTE_TO_FLOAT;
|
||||
float aa = a.a * BYTE_TO_FLOAT;
|
||||
float ar = a.r * BYTE_TO_FLOAT;
|
||||
float ag = a.g * BYTE_TO_FLOAT;
|
||||
float ab = a.b * BYTE_TO_FLOAT;
|
||||
float ba = b.a * BYTE_TO_FLOAT;
|
||||
float br = b.r * BYTE_TO_FLOAT;
|
||||
float bg = b.g * BYTE_TO_FLOAT;
|
||||
float bb = b.b * BYTE_TO_FLOAT;
|
||||
PixelColor c = new PixelColor();
|
||||
c.a = (byte)((aa * ba) * 255.0f);
|
||||
c.r = (byte)((ar * br) * 255.0f);
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// This clears the memory black
|
||||
public void Clear()
|
||||
{
|
||||
if(memorysize > 0) General.ZeroMemory(new IntPtr(memory), (int)memorysize);
|
||||
if(memorysize > 0) General.ZeroMemory(new IntPtr(memory), memorysize);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -201,11 +201,11 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
else
|
||||
{
|
||||
// Blend with pixel
|
||||
a = (float)c.a * 0.003921568627450980392156862745098f;
|
||||
if((int)p->a + (int)c.a > 255) p->a = 255; else p->a += c.a;
|
||||
p->r = (byte)((float)p->r * (1f - a) + (float)c.r * a);
|
||||
p->g = (byte)((float)p->g * (1f - a) + (float)c.g * a);
|
||||
p->b = (byte)((float)p->b * (1f - a) + (float)c.b * a);
|
||||
a = c.a * 0.003921568627450980392156862745098f;
|
||||
if(p->a + c.a > 255) p->a = 255; else p->a += c.a;
|
||||
p->r = (byte)(p->r * (1f - a) + c.r * a);
|
||||
p->g = (byte)(p->g * (1f - a) + c.g * a);
|
||||
p->b = (byte)(p->b * (1f - a) + c.b * a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// Simulat doom light levels
|
||||
if((level < 192) && General.Map.Config.DoomLightLevels)
|
||||
flevel = (192.0f - (float)(192 - level) * 1.5f);
|
||||
flevel = (192.0f - (192 - level) * 1.5f);
|
||||
|
||||
byte blevel = (byte)General.Clamp((int)flevel, 0, 255);
|
||||
PixelColor c = new PixelColor(255, blevel, blevel, blevel);
|
||||
|
|
|
@ -1425,10 +1425,10 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// The geometry must be a triangle list
|
||||
public void RenderGeometry(FlatVertex[] vertices, ImageData texture, bool transformcoords)
|
||||
{
|
||||
Texture t = null;
|
||||
|
||||
if(vertices.Length > 0)
|
||||
{
|
||||
Texture t;
|
||||
|
||||
if(texture != null)
|
||||
{
|
||||
// Make sure the texture is loaded
|
||||
|
@ -1456,7 +1456,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Draw
|
||||
graphics.Shaders.Display2D.Begin();
|
||||
graphics.Shaders.Display2D.BeginPass(1);
|
||||
graphics.Device.DrawUserPrimitives<FlatVertex>(PrimitiveType.TriangleList, 0, vertices.Length / 3, vertices);
|
||||
graphics.Device.DrawUserPrimitives(PrimitiveType.TriangleList, 0, vertices.Length / 3, vertices);
|
||||
graphics.Shaders.Display2D.EndPass();
|
||||
graphics.Shaders.Display2D.End();
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// Dummy frustum
|
||||
frustum = new ProjectedFrustum2D(new Vector2D(), 0.0f, 0.0f, PROJ_NEAR_PLANE,
|
||||
General.Settings.ViewDistance, Angle2D.DegToRad((float)General.Settings.VisualFOV));
|
||||
General.Settings.ViewDistance, Angle2D.DegToRad(General.Settings.VisualFOV));
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -205,9 +205,9 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private void CreateCrosshairVerts(Size texturesize)
|
||||
{
|
||||
// Determine coordinates
|
||||
float width = (float)windowsize.Width;
|
||||
float height = (float)windowsize.Height;
|
||||
float size = (float)height * CROSSHAIR_SCALE;
|
||||
float width = windowsize.Width;
|
||||
float height = windowsize.Height;
|
||||
float size = height * CROSSHAIR_SCALE;
|
||||
RectangleF rect = new RectangleF((width - size) / 2, (height - size) / 2, size, size);
|
||||
|
||||
// Make vertices
|
||||
|
@ -269,14 +269,14 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
{
|
||||
// Calculate aspect
|
||||
float aspect = (float)General.Map.Graphics.RenderTarget.ClientSize.Width /
|
||||
(float)General.Map.Graphics.RenderTarget.ClientSize.Height;
|
||||
General.Map.Graphics.RenderTarget.ClientSize.Height;
|
||||
|
||||
// The DirectX PerspectiveFovRH matrix method calculates the scaling in X and Y as follows:
|
||||
// yscale = 1 / tan(fovY / 2)
|
||||
// xscale = yscale / aspect
|
||||
// The fov specified in the method is the FOV over Y, but we want the user to specify the FOV
|
||||
// over X, so calculate what it would be over Y first;
|
||||
float fov = Angle2D.DegToRad((float)General.Settings.VisualFOV);
|
||||
float fov = Angle2D.DegToRad(General.Settings.VisualFOV);
|
||||
float reversefov = 1.0f / (float)Math.Tan(fov / 2.0f);
|
||||
float reversefovy = reversefov * aspect;
|
||||
float fovy = (float)Math.Atan(1.0f / reversefovy) * 2.0f;
|
||||
|
@ -291,14 +291,11 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// This creates matrices for a camera view
|
||||
public void PositionAndLookAt(Vector3D pos, Vector3D lookat)
|
||||
{
|
||||
Vector3D delta;
|
||||
float anglexy, anglez;
|
||||
|
||||
// Calculate delta vector
|
||||
cameraposition = pos;
|
||||
delta = lookat - pos;
|
||||
anglexy = delta.GetAngleXY();
|
||||
anglez = delta.GetAngleZ();
|
||||
Vector3D delta = lookat - pos;
|
||||
float anglexy = delta.GetAngleXY();
|
||||
float anglez = delta.GetAngleZ();
|
||||
|
||||
// Create frustum
|
||||
frustum = new ProjectedFrustum2D(pos, anglexy, anglez, PROJ_NEAR_PLANE,
|
||||
|
@ -315,7 +312,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private void CreateMatrices2D()
|
||||
{
|
||||
windowsize = graphics.RenderTarget.ClientSize;
|
||||
Matrix scaling = Matrix.Scaling((1f / (float)windowsize.Width) * 2f, (1f / (float)windowsize.Height) * -2f, 1f);
|
||||
Matrix scaling = Matrix.Scaling((1f / windowsize.Width) * 2f, (1f / windowsize.Height) * -2f, 1f);
|
||||
Matrix translate = Matrix.Translation(-(float)windowsize.Width * 0.5f, -(float)windowsize.Height * 0.5f, 0f);
|
||||
view2d = Matrix.Multiply(translate, scaling);
|
||||
}
|
||||
|
@ -582,7 +579,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
ApplyMatrices3D();
|
||||
|
||||
// Setup color
|
||||
Color4 thingColor = new Color4();
|
||||
Color4 thingColor;
|
||||
if (t.Selected && showselection) {
|
||||
thingColor = General.Colors.Selection3D.ToColorValue();
|
||||
} else {
|
||||
|
@ -644,7 +641,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
ApplyMatrices3D();
|
||||
|
||||
// Setup color
|
||||
Color4 color = new Color4();
|
||||
Color4 color;
|
||||
if(v.Selected && showselection) {
|
||||
color = General.Colors.Selection3D.ToColorValue();
|
||||
} else {
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private D3DDevice device;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// of sector vertices, the surface manager will take care of splitting it up in several SurfaceEntries.
|
||||
internal class SurfaceEntryCollection : List<SurfaceEntry>
|
||||
{
|
||||
public int totalvertices = 0;
|
||||
public int totalvertices;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private FontCharacter[] characters;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -122,8 +122,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// This is ancient code of mine.
|
||||
// The charater sizes were based on 800x600 resolution.
|
||||
characters[i].width = (float)(int)chr["width"] / 40f;
|
||||
characters[i].height = (float)(int)chr["height"] / 30f;
|
||||
characters[i].width = (int)chr["width"] / 40f;
|
||||
characters[i].height = (int)chr["height"] / 30f;
|
||||
characters[i].u1 = (float)chr["u1"];
|
||||
characters[i].v1 = (float)chr["v1"];
|
||||
characters[i].u2 = (float)chr["u2"];
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
private float lastscaley;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -57,13 +57,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
int oldvalue = (int)Math.Round(value);
|
||||
int newvalue = AngleForm.ShowDialog(parent, oldvalue);
|
||||
if(newvalue != oldvalue) value = (float)newvalue;
|
||||
if(newvalue != oldvalue) value = newvalue;
|
||||
}
|
||||
|
||||
public override void SetValue(object value)
|
||||
{
|
||||
float result;
|
||||
|
||||
// Null?
|
||||
if(value == null)
|
||||
{
|
||||
|
@ -75,9 +73,9 @@ namespace CodeImp.DoomBuilder.Types
|
|||
// Set directly
|
||||
this.value = Convert.ToSingle(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Try parsing as string
|
||||
float result;
|
||||
if(float.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.CurrentCulture, out result))
|
||||
{
|
||||
this.value = result;
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private object value = (int)0;
|
||||
private object value = 0;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
if(value != null)
|
||||
this.value = value;
|
||||
else
|
||||
this.value = (int)0;
|
||||
this.value = 0;
|
||||
}
|
||||
|
||||
public override object GetValue()
|
||||
|
@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
int result;
|
||||
if(int.TryParse(this.value.ToString(), out result)) return result;
|
||||
else return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override string GetStringValue()
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
private Dictionary<int, TypeHandlerAttribute> handlertypes;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -89,15 +89,15 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
// This returns the block center in world coordinates
|
||||
public Vector2D GetBlockCenter(Point p)
|
||||
{
|
||||
return new Vector2D((float)((p.X << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1)),
|
||||
(float)((p.Y << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1)));
|
||||
return new Vector2D((p.X << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1),
|
||||
(p.Y << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1));
|
||||
}
|
||||
|
||||
// This returns the key for a block at the given coordinates
|
||||
// TODO: Could we just use the Point struct as key?
|
||||
private ulong GetBlockKey(Point p)
|
||||
{
|
||||
return unchecked( ((ulong)(uint)p.X << 32) + (ulong)(uint)p.Y );
|
||||
return unchecked( ((ulong)(uint)p.X << 32) + (uint)p.Y );
|
||||
}
|
||||
|
||||
// This returns the block with the given coordinates
|
||||
|
|
|
@ -451,18 +451,17 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
if (target.picked == null) return new Vector2D(float.NaN, float.NaN);
|
||||
|
||||
//now find where exactly did we hit
|
||||
Vector2D hitCoords = new Vector2D();
|
||||
if (target.picked is VisualGeometry) {
|
||||
VisualGeometry vg = target.picked as VisualGeometry;
|
||||
hitCoords = getIntersection(start, start + delta, new Vector3D(vg.BoundingBox[0].X, vg.BoundingBox[0].Y, vg.BoundingBox[0].Z), new Vector3D(vg.Vertices[0].nx, vg.Vertices[0].ny, vg.Vertices[0].nz));
|
||||
} else if (target.picked is VisualThing) {
|
||||
return getIntersection(start, start + delta, new Vector3D(vg.BoundingBox[0].X, vg.BoundingBox[0].Y, vg.BoundingBox[0].Z), new Vector3D(vg.Vertices[0].nx, vg.Vertices[0].ny, vg.Vertices[0].nz));
|
||||
}
|
||||
|
||||
if (target.picked is VisualThing) {
|
||||
VisualThing vt = target.picked as VisualThing;
|
||||
hitCoords = getIntersection(start, start + delta, new Vector3D(vt.BoundingBox[0].X, vt.BoundingBox[0].Y, vt.BoundingBox[0].Z), D3DDevice.V3D(vt.Center - vt.PositionV3));
|
||||
} else {
|
||||
return new Vector2D(float.NaN, float.NaN);
|
||||
}
|
||||
return getIntersection(start, start + delta, new Vector3D(vt.BoundingBox[0].X, vt.BoundingBox[0].Y, vt.BoundingBox[0].Z), D3DDevice.V3D(vt.Center - vt.PositionV3));
|
||||
}
|
||||
|
||||
return hitCoords;
|
||||
return new Vector2D(float.NaN, float.NaN);
|
||||
}
|
||||
|
||||
//mxd. This checks intersection between line and plane
|
||||
|
@ -1082,12 +1081,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
|
||||
// Move the camera
|
||||
if(General.Interface.ShiftState) multiplier = MOVE_SPEED_MULTIPLIER * 2.0f; else multiplier = MOVE_SPEED_MULTIPLIER;
|
||||
if(keyforward) camdeltapos += camvec * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keybackward) camdeltapos -= camvec * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyleft) camdeltapos -= camvecstrafe * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyright) camdeltapos += camvecstrafe * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyup) camdeltapos += upvec * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keydown) camdeltapos += -upvec * cammovemul * (float)General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyforward) camdeltapos += camvec * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keybackward) camdeltapos -= camvec * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyleft) camdeltapos -= camvecstrafe * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyright) camdeltapos += camvecstrafe * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keyup) camdeltapos += upvec * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
if(keydown) camdeltapos += -upvec * cammovemul * General.Settings.MoveSpeed * multiplier * deltatime;
|
||||
|
||||
// Move the camera
|
||||
General.Map.VisualCamera.ProcessMovement(camdeltapos);
|
||||
|
@ -1099,7 +1098,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
DoCulling();
|
||||
|
||||
// Update labels in main window
|
||||
General.MainWindow.UpdateCoordinates((Vector2D)General.Map.VisualCamera.Position);
|
||||
General.MainWindow.UpdateCoordinates(General.Map.VisualCamera.Position);
|
||||
|
||||
// Now redraw
|
||||
General.Interface.RedrawDisplay();
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
private Sector sector;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
protected bool selected;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
private bool isdisposed;
|
||||
|
||||
//mxd
|
||||
private int cameraDistance3D;
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
CheckBox box = options.Add(item.Title, item.GetIntValue());
|
||||
|
||||
// Bind checking event
|
||||
box.CheckedChanged += new EventHandler(box_CheckedChanged);
|
||||
box.CheckedChanged += box_CheckedChanged;
|
||||
|
||||
// Checking the box?
|
||||
if((value & (int)box.Tag) == (int)box.Tag)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue