- Pixel Shader model 2.0 is now always used when available (regardless of High Quality Display option)

- Edit Selection mode now updates surface geometry when drag is released
This commit is contained in:
codeimp 2009-05-03 20:21:52 +00:00
parent 6f5f441ea6
commit d3c87b2a71
7 changed files with 19 additions and 30 deletions

View file

@ -232,16 +232,8 @@ namespace CodeImp.DoomBuilder.Rendering
shaders.World3D.SetConstants(General.Settings.VisualBilinear, true);
// Texture filters
if(General.Settings.QualityDisplay)
{
postfilter = Filter.Point;
mipgeneratefilter = Filter.Box;
}
else
{
postfilter = Filter.Point;
mipgeneratefilter = Filter.Box;
}
// Initialize presentations
Presentation.Initialize();

View file

@ -115,7 +115,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
// Compile effect
fx = Effect.FromStream(General.Map.Graphics.Device, fxdata, null, null, null, ShaderFlags.None, null, out errors);
if((errors != null) && (errors != ""))
if(!string.IsNullOrEmpty(errors))
{
throw new Exception("Errors in effect file " + fxfile + ": " + errors);
}
@ -127,7 +127,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
// Compile effect
fx = Effect.FromStream(General.Map.Graphics.Device, fxdata, null, null, null, ShaderFlags.Debug, null, out errors);
if((errors != null) && (errors != ""))
if(!string.IsNullOrEmpty(errors))
{
throw new Exception("Errors in effect file " + fxfile + ": " + errors);
}
@ -155,31 +155,31 @@ namespace CodeImp.DoomBuilder.Rendering
General.Map.Graphics.Device.VertexDeclaration = vertexdecl;
// Set effect
if(manager.Enabled && General.Settings.QualityDisplay) effect.Begin(FX.DoNotSaveState);
if(manager.Enabled) effect.Begin(FX.DoNotSaveState);
}
// This begins a pass
public virtual void BeginPass(int index)
{
if(manager.Enabled && General.Settings.QualityDisplay) effect.BeginPass(index);
if(manager.Enabled) effect.BeginPass(index);
}
// This ends a pass
public void EndPass()
{
if(manager.Enabled && General.Settings.QualityDisplay) effect.EndPass();
if(manager.Enabled) effect.EndPass();
}
// This ends te shader
public void End()
{
if(manager.Enabled && General.Settings.QualityDisplay) effect.End();
if(manager.Enabled) effect.End();
}
// This applies properties during a pass
public void ApplySettings()
{
if(manager.Enabled && General.Settings.QualityDisplay) effect.CommitChanges();
if(manager.Enabled) effect.CommitChanges();
}
#endregion

View file

@ -127,7 +127,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
Device device = manager.D3DDevice.Device;
if(!manager.Enabled || !General.Settings.QualityDisplay)
if(!manager.Enabled)
{
// Sampler settings
if(General.Settings.ClassicBilinear)

View file

@ -248,7 +248,7 @@ namespace CodeImp.DoomBuilder.Rendering
}
// Check which pass to use
if(layer.antialiasing) aapass = 0; else aapass = 1;
if(layer.antialiasing && General.Settings.QualityDisplay) aapass = 0; else aapass = 1;
// Render layer
switch(layer.layer)

View file

@ -121,7 +121,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
Device device = manager.D3DDevice.Device;
if(!manager.Enabled || !General.Settings.QualityDisplay)
if(!manager.Enabled)
{
// Sampler settings
if(General.Settings.ClassicBilinear)

View file

@ -116,7 +116,7 @@ namespace CodeImp.DoomBuilder.Rendering
// This sets the constant settings
public void SetConstants(bool bilinear, bool useanisotropic)
{
if(manager.Enabled && General.Settings.QualityDisplay)
if(manager.Enabled)
{
if(bilinear)
{
@ -134,21 +134,16 @@ namespace CodeImp.DoomBuilder.Rendering
// This sets the modulation color
public void SetModulateColor(int modcolor)
{
if(manager.Enabled && General.Settings.QualityDisplay)
if(manager.Enabled)
{
effect.SetValue(modulatecolor, new Color4(modcolor));
}
else
{
Device device = manager.D3DDevice.Device;
device.SetRenderState(RenderState.TextureFactor, modcolor);
}
}
// This sets the highlight color
public void SetHighlightColor(int hicolor)
{
if(manager.Enabled && General.Settings.QualityDisplay)
if(manager.Enabled)
{
effect.SetValue(highlightcolor, new Color4(hicolor));
}
@ -159,7 +154,7 @@ namespace CodeImp.DoomBuilder.Rendering
{
Device device = manager.D3DDevice.Device;
if(!manager.Enabled || !General.Settings.QualityDisplay)
if(!manager.Enabled)
{
// Sampler settings
if(General.Settings.VisualBilinear)

View file

@ -801,6 +801,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
t.Rotate(thingangle[index]);
t.Move(thingpos[index++]);
}
General.Map.Map.Update(true, true);
// Make undo
General.Map.UndoRedo.CreateUndo("Edit selection");
@ -1218,6 +1219,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
mode = ModifyMode.None;
// Redraw
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}