Merge branch 'zmaster'

This commit is contained in:
Christoph Oelckers 2016-12-08 17:53:41 +01:00
commit 14400c41b6
3 changed files with 22 additions and 7 deletions

View File

@ -390,13 +390,14 @@ void DPSprite::SetState(FState *newstate, bool pending)
if (ID != PSP_FLASH)
{ // It's still possible to set the flash layer's offsets with the action function.
// Anything going through here cannot be reliably interpolated so this has to reset the interpolation coordinates if it changes the values.
if (newstate->GetMisc1())
{ // Set coordinates.
x = newstate->GetMisc1();
oldx = x = newstate->GetMisc1();
}
if (newstate->GetMisc2())
{
y = newstate->GetMisc2();
oldy = y = newstate->GetMisc2();
}
}
@ -1041,6 +1042,7 @@ enum WOFFlags
WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
};
void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
@ -1069,6 +1071,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else
{
psp->x = wx;
if (!(flags & WOF_INTERPOLATE)) psp->oldx = psp->x;
}
}
if (!(flags & WOF_KEEPY))
@ -1080,6 +1083,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else
{
psp->y = wy;
if (!(flags & WOF_INTERPOLATE)) psp->oldy = psp->y;
}
}
}

View File

@ -1184,6 +1184,11 @@ void CALLBACK ExitFatally (ULONG_PTR dummy)
//
//==========================================================================
namespace
{
CONTEXT MainThreadContext;
}
LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
{
#ifdef _DEBUG
@ -1208,11 +1213,7 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
// Otherwise, put the crashing thread to sleep and signal the main thread to clean up.
if (GetCurrentThreadId() == MainThreadID)
{
#ifndef _M_X64
info->ContextRecord->Eip = (DWORD_PTR)ExitFatally;
#else
info->ContextRecord->Rip = (DWORD_PTR)ExitFatally;
#endif
*info->ContextRecord = MainThreadContext;
}
else
{
@ -1304,6 +1305,15 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
if (MainThread != INVALID_HANDLE_VALUE)
{
SetUnhandledExceptionFilter (CatchAllExceptions);
static bool setJumpResult = false;
RtlCaptureContext(&MainThreadContext);
if (setJumpResult)
{
ExitFatally(0);
return 0;
}
setJumpResult = true;
}
#endif

View File

@ -703,6 +703,7 @@ enum EWeaponOffsetFlags
WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
};
// Flags for psprite layers