mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- Make Gameloop exceptions behave more like previous code (by tazpn)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5213 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1898,6 +1898,36 @@ static LONG __stdcall SGPExceptionFilter(int exceptionCount, EXCEPTION_POINTERS*
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
static void SGPGameLoop()
|
||||
{
|
||||
try
|
||||
{
|
||||
GameLoop();
|
||||
}
|
||||
catch(sgp::Exception &ex)
|
||||
{
|
||||
SGP_ERROR(ex.what());
|
||||
SHOWEXCEPTION(ex);
|
||||
}
|
||||
catch(vfs::Exception &ex)
|
||||
{
|
||||
SGP_ERROR(ex.what());
|
||||
SHOWEXCEPTION(ex);
|
||||
}
|
||||
catch(std::exception &ex)
|
||||
{
|
||||
sgp::Exception nex(ex.what());
|
||||
SGP_ERROR(nex.what());
|
||||
SHOWEXCEPTION(nex);
|
||||
}
|
||||
catch(const char* msg)
|
||||
{
|
||||
sgp::Exception ex(msg);
|
||||
SGP_ERROR(ex.what());
|
||||
SHOWEXCEPTION(ex);
|
||||
}
|
||||
}
|
||||
|
||||
static bool CallGameLoop(bool wait)
|
||||
{
|
||||
static int numUnsuccessfulTries = 0;
|
||||
@@ -1915,7 +1945,7 @@ static bool CallGameLoop(bool wait)
|
||||
{
|
||||
__try
|
||||
{
|
||||
GameLoop();
|
||||
SGPGameLoop();
|
||||
numUnsuccessfulTries = 0;
|
||||
}
|
||||
__except( SGPExceptionFilter(++numUnsuccessfulTries, GetExceptionInformation()) )
|
||||
|
||||
Reference in New Issue
Block a user