You have entered the comedy area

This commit is contained in:
James R 2020-01-28 21:28:26 -08:00
parent 6893db46a1
commit 68bd632bac
6 changed files with 16 additions and 0 deletions

View file

@ -98,6 +98,8 @@ int SUBVERSION;
// platform independant focus loss
UINT8 window_notinfocus = false;
INT32 window_x;
INT32 window_y;
//
// DEMO LOOP

View file

@ -146,6 +146,8 @@ extern boolean digital_disabled;
extern boolean menuactive; // Menu overlaid?
extern UINT8 paused; // Game paused?
extern UINT8 window_notinfocus; // are we in focus? (backend independant -- handles auto pausing and display of "focus lost" message)
extern INT32 window_x;
extern INT32 window_y;
extern boolean nodrawers;
extern boolean noblit;

View file

@ -342,4 +342,6 @@ const char *I_ClipboardPaste(void);
void I_RegisterSysCommands(void);
void I_CursedWindowMovement(int xd, int yd);
#endif

View file

@ -632,6 +632,7 @@ void P_Ticker(boolean run)
quake.x = M_RandomRange(-ir,ir);
quake.y = M_RandomRange(-ir,ir);
quake.z = M_RandomRange(-ir,ir);
I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y));
ir >>= 2;
ir = M_RandomRange(-ir,ir);
if (ir < 0)

View file

@ -836,6 +836,12 @@ INT32 I_GetKey (void)
return rc;
}
void
I_CursedWindowMovement (int xd, int yd)
{
SDL_SetWindowPosition(window, window_x + xd, window_y + yd);
}
//
// I_JoyScale
//

View file

@ -638,6 +638,9 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
break;
case SDL_WINDOWEVENT_MAXIMIZED:
break;
case SDL_WINDOWEVENT_MOVED:
window_x = evt.data1;
window_y = evt.data2;
}
if (mousefocus && kbfocus)