Merge pull request #3758 from ScottNZ/crashform

Crash improvements: closes #3698 and closes #3700
This commit is contained in:
Matthias Mailänder
2013-08-29 08:35:58 -07:00
5 changed files with 19 additions and 1 deletions

View File

@@ -58,6 +58,8 @@ namespace OpenRA.FileFormats.Graphics
void DisableDepthBuffer();
void SetBlendMode(BlendMode mode);
void Quit();
}
public interface IVertexBuffer<T>

View File

@@ -50,8 +50,11 @@ namespace OpenRA
Log.Write("exception", "{0}", rpt);
Console.Error.WriteLine(rpt);
if (Game.Settings.Debug.ShowFatalErrorDialog)
if (Game.Settings.Debug.ShowFatalErrorDialog && !Game.Settings.Server.Dedicated)
{
Game.Renderer.Device.Quit();
FatalErrorDialog.Show();
}
}
static StringBuilder BuildExceptionReport(Exception e)

View File

@@ -61,6 +61,12 @@ namespace OpenRA.Renderer.Cg
FragmentProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_FRAGMENT);
}
public override void Quit()
{
Tao.Cg.Cg.cgDestroyContext(Context);
base.Quit();
}
public override IShader CreateShader(string name) { return new Shader(this, name); }
}
}

View File

@@ -35,6 +35,8 @@ namespace OpenRA.Renderer.Null
WindowSize = size;
}
public void Quit() { }
public void EnableScissor(int left, int top, int width, int height) { }
public void DisableScissor() { }

View File

@@ -106,6 +106,11 @@ namespace OpenRA.Renderer.SdlCommon
return surf;
}
public virtual void Quit()
{
Sdl.SDL_Quit();
}
int ModeFromPrimitiveType(PrimitiveType pt)
{
switch (pt)