- rename classes with D3D in them

This commit is contained in:
Magnus Norddahl 2019-08-09 23:22:16 +02:00
parent 8ada3862e4
commit e3740033fc
21 changed files with 44 additions and 44 deletions

View file

@ -23,7 +23,7 @@ using CodeImp.DoomBuilder.Rendering;
namespace CodeImp.DoomBuilder.Data
{
public class DynamicBitmapImage : BitmapImage, ID3DResource
public class DynamicBitmapImage : BitmapImage, IRenderResource
{
#region ================== Variables

View file

@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder
private ConfigurationInfo configinfo;
private GameConfiguration config;
private DataManager data;
private D3DDevice graphics;
private RenderDevice graphics;
private Renderer2D renderer2d;
private Renderer3D renderer3d;
private WADReader tempwadreader;
@ -107,7 +107,7 @@ namespace CodeImp.DoomBuilder
public DataManager Data { get { return data; } }
public bool IsChanged { get { return changed | CheckScriptChanged(); } set { changed |= value; if(!maploading) General.MainWindow.UpdateMapChangedStatus(); } }
public bool IsDisposed { get { return isdisposed; } }
internal D3DDevice Graphics { get { return graphics; } }
internal RenderDevice Graphics { get { return graphics; } }
public IRenderer2D Renderer2D { get { return renderer2d; } }
public IRenderer3D Renderer3D { get { return renderer3d; } }
internal Renderer2D CRenderer2D { get { return renderer2d; } }
@ -261,7 +261,7 @@ namespace CodeImp.DoomBuilder
// Initiate graphics
General.WriteLogLine("Initializing graphics device...");
graphics = new D3DDevice(General.MainWindow.Display);
graphics = new RenderDevice(General.MainWindow.Display);
// Create renderers
renderer2d = new Renderer2D(graphics);
@ -368,7 +368,7 @@ namespace CodeImp.DoomBuilder
// Initiate graphics
General.WriteLogLine("Initializing graphics device...");
graphics = new D3DDevice(General.MainWindow.Display);
graphics = new RenderDevice(General.MainWindow.Display);
// Create renderers
renderer2d = new Renderer2D(graphics);

View file

@ -2461,7 +2461,7 @@ namespace CodeImp.DoomBuilder.Geometry
/// </summary>
public static Vector2D HermiteSpline(Vector2D p1, Vector2D t1, Vector2D p2, Vector2D t2, float u)
{
return D3DDevice.V2D(Vector2.Hermite(D3DDevice.V2(p1), D3DDevice.V2(t1), D3DDevice.V2(p2), D3DDevice.V2(t2), u));
return RenderDevice.V2D(Vector2.Hermite(RenderDevice.V2(p1), RenderDevice.V2(t1), RenderDevice.V2(p2), RenderDevice.V2(t2), u));
}
/// <summary>
@ -2470,7 +2470,7 @@ namespace CodeImp.DoomBuilder.Geometry
/// </summary>
public static Vector3D HermiteSpline(Vector3D p1, Vector3D t1, Vector3D p2, Vector3D t2, float u)
{
return D3DDevice.V3D(Vector3.Hermite(D3DDevice.V3(p1), D3DDevice.V3(t1), D3DDevice.V3(p2), D3DDevice.V3(t2), u));
return RenderDevice.V3D(Vector3.Hermite(RenderDevice.V3(p1), RenderDevice.V3(t1), RenderDevice.V3(p2), RenderDevice.V3(t2), u));
}
//mxd

View file

@ -22,7 +22,7 @@ using System;
namespace CodeImp.DoomBuilder.Rendering
{
internal sealed class Display2DShader : D3DShader
internal sealed class Display2DShader : EffectShader
{
#region ================== Variables

View file

@ -23,7 +23,7 @@ using System.IO;
namespace CodeImp.DoomBuilder.Rendering
{
internal abstract class D3DShader : IDisposable
internal abstract class EffectShader : IDisposable
{
#region ================== Constants
@ -58,7 +58,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Constructor / Disposer
// Constructor
protected D3DShader(ShaderManager manager)
protected EffectShader(ShaderManager manager)
{
// Initialize
this.manager = manager;

View file

@ -255,7 +255,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Rendering
// This renders the quad
public void Render(D3DDevice device)
public void Render(RenderDevice device)
{
// Render the quad
device.DrawUserPrimitives(type, 0, 2, vertices);

View file

@ -20,7 +20,7 @@
namespace CodeImp.DoomBuilder.Rendering
{
internal interface ID3DResource
internal interface IRenderResource
{
// This is used to unload the resouce
void UnloadResource();

View file

@ -28,9 +28,9 @@ using System.Runtime.InteropServices;
namespace CodeImp.DoomBuilder.Rendering
{
internal class D3DDevice : IDisposable
internal class RenderDevice : IDisposable
{
internal D3DDevice(RenderTargetControl rendertarget)
internal RenderDevice(RenderTargetControl rendertarget)
{
Handle = RenderDevice_New();
if (Handle == IntPtr.Zero)
@ -41,7 +41,7 @@ namespace CodeImp.DoomBuilder.Rendering
SetupSettings();
}
~D3DDevice()
~RenderDevice()
{
Dispose();
}
@ -114,11 +114,11 @@ namespace CodeImp.DoomBuilder.Rendering
{
}
internal void RegisterResource(ID3DResource res)
internal void RegisterResource(IRenderResource res)
{
}
internal void UnregisterResource(ID3DResource res)
internal void UnregisterResource(IRenderResource res)
{
}

View file

@ -25,7 +25,7 @@ using CodeImp.DoomBuilder.Geometry;
namespace CodeImp.DoomBuilder.Rendering
{
internal abstract class Renderer : ID3DResource, IDisposable
internal abstract class Renderer : IRenderResource, IDisposable
{
#region ================== Constants
@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Variables
// Graphics
protected D3DDevice graphics;
protected RenderDevice graphics;
protected static bool fullbrightness;
// Disposing
@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Constructor / Disposer
// Constructor
protected Renderer(D3DDevice g)
protected Renderer(RenderDevice g)
{
// Initialize
this.graphics = g;

View file

@ -133,7 +133,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Constructor / Disposer
// Constructor
internal Renderer2D(D3DDevice graphics) : base(graphics)
internal Renderer2D(RenderDevice graphics) : base(graphics)
{
// Create surface manager
surfaces = new SurfaceManager();

View file

@ -132,7 +132,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Constructor / Disposer
// Constructor
internal Renderer3D(D3DDevice graphics) : base(graphics)
internal Renderer3D(RenderDevice graphics) : base(graphics)
{
// Initialize
//CreateProjection(); // [ZZ] don't do undefined things once not even ready
@ -265,7 +265,7 @@ namespace CodeImp.DoomBuilder.Rendering
General.Settings.ViewDistance, Angle2D.DegToRad(General.Settings.VisualFOV));
// Make the view matrix
view3d = Matrix.LookAtRH(D3DDevice.V3(pos), D3DDevice.V3(lookat), new Vector3(0f, 0f, 1f));
view3d = Matrix.LookAtRH(RenderDevice.V3(pos), RenderDevice.V3(lookat), new Vector3(0f, 0f, 1f));
viewproj = view3d * projection; //mxd
// Make the billboard matrix

View file

@ -22,7 +22,7 @@ using System;
namespace CodeImp.DoomBuilder.Rendering
{
internal class ShaderManager : ID3DResource, IDisposable
internal class ShaderManager : IRenderResource, IDisposable
{
#region ================== Constants
@ -36,7 +36,7 @@ namespace CodeImp.DoomBuilder.Rendering
private World3DShader world3dshader;
// Device
private D3DDevice device;
private RenderDevice device;
// Disposing
private bool isdisposed;
@ -49,14 +49,14 @@ namespace CodeImp.DoomBuilder.Rendering
public Things2DShader Things2D { get { return things2dshader; } }
public World3DShader World3D { get { return world3dshader; } }
public bool IsDisposed { get { return isdisposed; } }
internal D3DDevice D3DDevice { get { return device; } }
internal RenderDevice D3DDevice { get { return device; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
public ShaderManager(D3DDevice device)
public ShaderManager(RenderDevice device)
{
// Initialize
this.device = device;

View file

@ -27,7 +27,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.Rendering
{
internal class SurfaceManager : ID3DResource
internal class SurfaceManager : IRenderResource
{
#region ================== Constants
@ -603,7 +603,7 @@ namespace CodeImp.DoomBuilder.Rendering
}
// This renders the sorted sector surfaces
internal void RenderSectorSurfaces(D3DDevice graphics)
internal void RenderSectorSurfaces(RenderDevice graphics)
{
if(!resourcesunloaded)
{

View file

@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.Rendering
void Update(float translatex, float translatey, float scalex, float scaley);
}
public class TextLabel : IDisposable, ID3DResource, ITextLabel
public class TextLabel : IDisposable, IRenderResource, ITextLabel
{
#region ================== Constants

View file

@ -22,7 +22,7 @@ using System;
namespace CodeImp.DoomBuilder.Rendering
{
internal sealed class Things2DShader : D3DShader
internal sealed class Things2DShader : EffectShader
{
#region ================== Variables

View file

@ -7,7 +7,7 @@ using CodeImp.DoomBuilder.VisualModes;
namespace CodeImp.DoomBuilder.Rendering
{
internal sealed class VisualVertexHandle : IDisposable, ID3DResource
internal sealed class VisualVertexHandle : IDisposable, IRenderResource
{
#region ================== Variables

View file

@ -22,7 +22,7 @@ using System;
namespace CodeImp.DoomBuilder.Rendering
{
internal sealed class World3DShader : D3DShader
internal sealed class World3DShader : EffectShader
{
#region ================== Variables

View file

@ -489,7 +489,7 @@ namespace CodeImp.DoomBuilder.VisualModes
VisualThing vt = target.picked as VisualThing;
if(vt != null) return GetIntersection(start, start + delta, vt.CenterV3D, D3DDevice.V3D(vt.Center - vt.PositionV3));
if(vt != null) return GetIntersection(start, start + delta, vt.CenterV3D, RenderDevice.V3D(vt.Center - vt.PositionV3));
return new Vector2D(float.NaN, float.NaN);
}

View file

@ -25,7 +25,7 @@ using CodeImp.DoomBuilder.Rendering;
namespace CodeImp.DoomBuilder.VisualModes
{
public class VisualSector : ID3DResource, IDisposable
public class VisualSector : IRenderResource, IDisposable
{
#region ================== Constants

View file

@ -31,7 +31,7 @@ using CodeImp.DoomBuilder.GZBuilder;
namespace CodeImp.DoomBuilder.VisualModes
{
public abstract class VisualThing : IVisualPickable, ID3DResource, IDisposable
public abstract class VisualThing : IVisualPickable, IRenderResource, IDisposable
{
#region ================== Constants
@ -125,7 +125,7 @@ namespace CodeImp.DoomBuilder.VisualModes
return new Vector3(position_v3.X, position_v3.Y, position_v3.Z + thingheight / 2f);
}
}
public Vector3D CenterV3D { get { return D3DDevice.V3D(Center); } }
public Vector3D CenterV3D { get { return RenderDevice.V3D(Center); } }
public float LocalCenterZ { get { return thingheight / 2f; } } //mxd
public Vector3 PositionV3 { get { return position_v3; } }
public Vector3D[] BoundingBox { get { return boundingBox; } }
@ -271,7 +271,7 @@ namespace CodeImp.DoomBuilder.VisualModes
/// </summary>
public void SetPosition(Vector3D pos)
{
position_v3 = D3DDevice.V3(pos); //mxd
position_v3 = RenderDevice.V3(pos); //mxd
position = Matrix.Translation(position_v3);
updategeo = true;
updatecage = true; //mxd

View file

@ -109,8 +109,8 @@ namespace CodeImp.DoomBuilder.Windows
browseScreenshotsFolderDialog.SelectedPath = General.Settings.ScreenshotsPath;
//mxd. Anisotropic filtering
anisotropicfiltering.Value = Math.Max(D3DDevice.AF_STEPS.IndexOf(General.Settings.FilterAnisotropy), 0); //mxd
antialiasing.Value = Math.Max(D3DDevice.AA_STEPS.IndexOf(General.Settings.AntiAliasingSamples), 0); //mxd
anisotropicfiltering.Value = Math.Max(RenderDevice.AF_STEPS.IndexOf(General.Settings.FilterAnisotropy), 0); //mxd
antialiasing.Value = Math.Max(RenderDevice.AA_STEPS.IndexOf(General.Settings.AntiAliasingSamples), 0); //mxd
//mxd. Script editor
scriptfontbold.Checked = General.Settings.ScriptFontBold;
@ -403,8 +403,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd
General.Settings.GZSynchCameras = cbSynchCameras.Checked;
General.Settings.GZMaxDynamicLights = tbDynLightCount.Value * 16;
General.Settings.FilterAnisotropy = D3DDevice.AF_STEPS[anisotropicfiltering.Value];
General.Settings.AntiAliasingSamples = D3DDevice.AA_STEPS[antialiasing.Value];
General.Settings.FilterAnisotropy = RenderDevice.AF_STEPS[anisotropicfiltering.Value];
General.Settings.AntiAliasingSamples = RenderDevice.AA_STEPS[antialiasing.Value];
General.Settings.GZStretchView = cbStretchView.Checked;
General.Settings.GZVertexScale2D = vertexScale.Value;
General.Settings.GZOldHighlightMode = cbOldHighlightMode.Checked;
@ -1013,13 +1013,13 @@ namespace CodeImp.DoomBuilder.Windows
//mxd
private void anisotropicfiltering_ValueChanged(object sender, EventArgs e)
{
labelanisotropicfiltering.Text = anisotropicfiltering.Value == 0 ? "None" : (int)D3DDevice.AF_STEPS[anisotropicfiltering.Value] + "x";
labelanisotropicfiltering.Text = anisotropicfiltering.Value == 0 ? "None" : (int)RenderDevice.AF_STEPS[anisotropicfiltering.Value] + "x";
}
//mxd
private void antialiasing_ValueChanged(object sender, EventArgs e)
{
labelantialiasing.Text = (antialiasing.Value == 0 ? "None" : D3DDevice.AA_STEPS[antialiasing.Value] + " samples");
labelantialiasing.Text = (antialiasing.Value == 0 ? "None" : RenderDevice.AA_STEPS[antialiasing.Value] + " samples");
}
#endregion