mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-30 00:41:19 +00:00
* Ported ZDoom revisions r2493 to 2498:
- Shorten the description of DF2_KILLBOSSMONST in the menu. - Added m_hidepointer cvar to control whether or not the mouse pointer is hidden when it's grabbed. At least if the pointer is visible when the debugger break happens, I don't worry about it getting stuck hidden. (Note that that seems to be related to Alt+Tabbing out of the game and coming back. I wish I knew what's going on.) - Hide the cursor by overriding WM_SETCURSOR, as seen in the IDirect3DDEvice9::ShowCursor() example. Do not modify the window class pointer. I still had an instance where I was left with an invisible pointer no matter where I moved it, so hopefully this takes care of that. (edit: it doesn't.) - Removed TheInvisibleCursor, since passing NULL to SetCursor() has exactly the same effect. - Two tweaks to raw mouse input to make it better behaved when the window suddenly has focus removed (e.g. because of a debugger break): * Keep the pointer centered in the window, as for Win32Mouse. Even though it's not generating any traditional input events, it's still moving all over the screen. e.g. If we have focus yanked away and you're pressing the right mouse button as it happens, you can suddenly find yourself with a popup menu open. * Use SetCursorState() like the other mouse modes instead of ShowCursor() to hide the pointer. This way, we don't need to worry about being stuck with trying to use the system with an invisible pointer, because only the game window will be pointer-less. - pr_hom shouldn't have a name, since we don't care about it for save games or network sync. - Added SoundSequence sector property to udmf_zdoom.txt. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@867 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
9e5793977e
commit
fddc626b47
9 changed files with 78 additions and 63 deletions
|
@ -161,6 +161,8 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
|||
nofallingdamage = <bool>; // Falling damage is disabled in this sector
|
||||
dropactors = <bool>; // Actors drop with instantly moving floors (*)
|
||||
norespawn = <bool>; // Players can not respawn in this sector
|
||||
soundsequence = <string>; // The sound sequence to play when this sector moves. Placing a
|
||||
// sound sequence thing in the sector will override this property.
|
||||
|
||||
* Note about dropactors
|
||||
|
||||
|
@ -263,6 +265,9 @@ Changed node specifications to deprecate compression of node lump.
|
|||
1.10 25.04.2010
|
||||
Added 'playeruseback' line trigger flag.
|
||||
|
||||
1.11 07.08.2010
|
||||
Added 'soundsequnce' sector property.
|
||||
|
||||
===============================================================================
|
||||
EOF
|
||||
===============================================================================
|
||||
|
|
|
@ -948,7 +948,7 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
|
|||
// renders the view
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
static FRandom pr_glhom("GLHOM-Flasher");
|
||||
static FRandom pr_glhom;
|
||||
EXTERN_CVAR(Int, r_clearbuffer)
|
||||
CVAR(Bool, gl_testdl, false, 0)
|
||||
static int dl = -1;
|
||||
|
|
|
@ -1067,7 +1067,7 @@ static menuitem_t DMFlagsItems[] = {
|
|||
{ bitflag, "Allow spying", {&dmflags2}, {1}, {0}, {0}, {(value_t *)DF2_DISALLOW_SPYING} },
|
||||
{ bitflag, "Chasecam cheat", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_CHASECAM} },
|
||||
{ bitflag, "Check ammo for weapon switch", {&dmflags2}, {1}, {0}, {0}, {(value_t *)DF2_DONTCHECKAMMO} },
|
||||
{ bitflag, "Killing boss brain kills all its monsters", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_KILLBOSSMONST} },
|
||||
{ bitflag, "Killing Romero kills all his spawns", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_KILLBOSSMONST} },
|
||||
|
||||
{ redtext, " ", {NULL}, {0}, {0}, {0}, {NULL} },
|
||||
{ whitetext,"Deathmatch Settings", {NULL}, {0}, {0}, {0}, {NULL} },
|
||||
|
|
|
@ -104,7 +104,7 @@ static float CurrentVisibility = 8.f;
|
|||
static fixed_t MaxVisForWall;
|
||||
static fixed_t MaxVisForFloor;
|
||||
static FRandom pr_torchflicker ("TorchFlicker");
|
||||
static FRandom pr_hom ("HOM-Flasher");
|
||||
static FRandom pr_hom;
|
||||
static TArray<InterpolationViewer> PastViewers;
|
||||
static int centerxwide;
|
||||
static bool polyclipped;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 326 B |
|
@ -147,6 +147,7 @@ EXTERN_CVAR (Bool, lookstrafe)
|
|||
EXTERN_CVAR (Bool, use_joystick)
|
||||
|
||||
static int WheelDelta;
|
||||
extern bool CursorState;
|
||||
|
||||
extern BOOL paused;
|
||||
static bool noidle = false;
|
||||
|
@ -418,6 +419,14 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
I_CheckNativeMouse (false);
|
||||
break;
|
||||
|
||||
case WM_SETCURSOR:
|
||||
if (!CursorState)
|
||||
{
|
||||
SetCursor(NULL); // turn off window cursor
|
||||
return TRUE; // Prevent Windows from setting cursor to window class cursor
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
InvalidateRect (Window, NULL, FALSE);
|
||||
break;
|
||||
|
|
|
@ -118,7 +118,6 @@ extern BYTE *ST_Util_BitsForBitmap (BITMAPINFO *bitmap_info);
|
|||
extern EXCEPTION_POINTERS CrashPointers;
|
||||
extern BITMAPINFO *StartupBitmap;
|
||||
extern UINT TimerPeriod;
|
||||
extern HCURSOR TheArrowCursor, TheInvisibleCursor;
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
|
@ -931,9 +930,6 @@ void DoMain (HINSTANCE hInstance)
|
|||
x = y = 0;
|
||||
}
|
||||
|
||||
TheInvisibleCursor = LoadCursor (hInstance, MAKEINTRESOURCE(IDC_INVISIBLECURSOR));
|
||||
TheArrowCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
|
||||
WNDCLASS WndClass;
|
||||
WndClass.style = 0;
|
||||
WndClass.lpfnWndProc = LConProc;
|
||||
|
@ -941,7 +937,7 @@ void DoMain (HINSTANCE hInstance)
|
|||
WndClass.cbWndExtra = 0;
|
||||
WndClass.hInstance = hInstance;
|
||||
WndClass.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_ICON1));
|
||||
WndClass.hCursor = TheArrowCursor;
|
||||
WndClass.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
WndClass.hbrBackground = NULL;
|
||||
WndClass.lpszMenuName = NULL;
|
||||
WndClass.lpszClassName = (LPCTSTR)WinClassName;
|
||||
|
|
|
@ -87,8 +87,6 @@ public:
|
|||
void Ungrab();
|
||||
|
||||
protected:
|
||||
void CenterMouse(int x, int y);
|
||||
|
||||
POINT UngrabbedPointerPos;
|
||||
LONG PrevX, PrevY;
|
||||
bool Grabbed;
|
||||
|
@ -112,6 +110,7 @@ static void SetCursorState(bool visible);
|
|||
static FMouse *CreateWin32Mouse();
|
||||
static FMouse *CreateDInputMouse();
|
||||
static FMouse *CreateRawMouse();
|
||||
static void CenterMouse(int x, int y, LONG *centx, LONG *centy);
|
||||
|
||||
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
||||
|
||||
|
@ -135,12 +134,12 @@ static FMouse *(*MouseFactory[])() =
|
|||
|
||||
FMouse *Mouse;
|
||||
|
||||
HCURSOR TheArrowCursor;
|
||||
HCURSOR TheInvisibleCursor;
|
||||
bool CursorState;
|
||||
|
||||
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_hidepointer, true, 0)
|
||||
|
||||
CUSTOM_CVAR (Int, in_mouse, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
||||
{
|
||||
|
@ -183,11 +182,48 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|||
|
||||
static void SetCursorState(bool visible)
|
||||
{
|
||||
HCURSOR usingCursor = visible ? TheArrowCursor : TheInvisibleCursor;
|
||||
SetClassLongPtr(Window, GCLP_HCURSOR, (LONG_PTR)usingCursor);
|
||||
CursorState = visible || !m_hidepointer;
|
||||
if (GetForegroundWindow() == Window)
|
||||
{
|
||||
SetCursor(usingCursor);
|
||||
if (CursorState)
|
||||
{
|
||||
SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCursor(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// CenterMouse
|
||||
//
|
||||
// Moves the mouse to the center of the window, but only if the current
|
||||
// position isn't already in the center.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static void CenterMouse(int curx, int cury, LONG *centxp, LONG *centyp)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
GetWindowRect(Window, &rect);
|
||||
|
||||
int centx = (rect.left + rect.right) >> 1;
|
||||
int centy = (rect.top + rect.bottom) >> 1;
|
||||
|
||||
// Reduce the number of WM_MOUSEMOVE messages that get sent
|
||||
// by only calling SetCursorPos when we really need to.
|
||||
if (centx != curx || centy != cury)
|
||||
{
|
||||
if (centxp != NULL)
|
||||
{
|
||||
*centxp = centx;
|
||||
*centyp = centy;
|
||||
}
|
||||
SetCursorPos(centx, centy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -512,12 +548,11 @@ void FRawMouse::Grab()
|
|||
{
|
||||
GetCursorPos(&UngrabbedPointerPos);
|
||||
Grabbed = true;
|
||||
while (ShowCursor(FALSE) >= 0)
|
||||
{ }
|
||||
SetCursorState(false);
|
||||
// By setting the cursor position, we force the pointer image
|
||||
// to change right away instead of having it delayed until
|
||||
// some time in the future.
|
||||
SetCursorPos(0, 0);
|
||||
CenterMouse(-1, -1, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -543,7 +578,7 @@ void FRawMouse::Ungrab()
|
|||
Grabbed = false;
|
||||
ClearButtonState();
|
||||
}
|
||||
ShowCursor(TRUE);
|
||||
SetCursorState(true);
|
||||
SetCursorPos(UngrabbedPointerPos.x, UngrabbedPointerPos.y);
|
||||
}
|
||||
}
|
||||
|
@ -586,8 +621,13 @@ bool FRawMouse::ProcessRawInput(RAWINPUT *raw, int code)
|
|||
{
|
||||
WheelMoved(1, (SHORT)raw->data.mouse.usButtonData);
|
||||
}
|
||||
PostMouseMove(m_noprescale ? raw->data.mouse.lLastX : raw->data.mouse.lLastX<<2,
|
||||
-raw->data.mouse.lLastY);
|
||||
int x = m_noprescale ? raw->data.mouse.lLastX : raw->data.mouse.lLastX << 2;
|
||||
int y = -raw->data.mouse.lLastY;
|
||||
PostMouseMove(x, y);
|
||||
if (x | y)
|
||||
{
|
||||
CenterMouse(-1, -1, NULL, NULL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -920,7 +960,7 @@ void FWin32Mouse::ProcessInput()
|
|||
}
|
||||
if (x | y)
|
||||
{
|
||||
CenterMouse(pt.x, pt.y);
|
||||
CenterMouse(pt.x, pt.y, &PrevX, &PrevY);
|
||||
}
|
||||
PostMouseMove(x, y);
|
||||
}
|
||||
|
@ -944,13 +984,13 @@ bool FWin32Mouse::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED)
|
||||
{
|
||||
CenterMouse(-1, -1);
|
||||
CenterMouse(-1, -1, &PrevX, &PrevY);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (message == WM_MOVE)
|
||||
{
|
||||
CenterMouse(-1, -1);
|
||||
CenterMouse(-1, -1, &PrevX, &PrevY);
|
||||
return true;
|
||||
}
|
||||
else if (message == WM_SYSCOMMAND)
|
||||
|
@ -1059,7 +1099,7 @@ void FWin32Mouse::Grab()
|
|||
|
||||
ClipCursor(&rect);
|
||||
SetCursorState(false);
|
||||
CenterMouse(-1, -1);
|
||||
CenterMouse(-1, -1, &PrevX, &PrevY);
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
|
@ -1085,34 +1125,6 @@ void FWin32Mouse::Ungrab()
|
|||
ClearButtonState();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FWin32Mouse :: CenterMouse
|
||||
//
|
||||
// Moves the mouse to the center of the window, but only if the current
|
||||
// position isn't already in the center.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FWin32Mouse::CenterMouse(int curx, int cury)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
GetWindowRect (Window, &rect);
|
||||
|
||||
int centx = (rect.left + rect.right) >> 1;
|
||||
int centy = (rect.top + rect.bottom) >> 1;
|
||||
|
||||
// Reduce the number of WM_MOUSEMOVE messages that get sent
|
||||
// by only calling SetCursorPos when we really need to.
|
||||
if (centx != curx || centy != cury)
|
||||
{
|
||||
PrevX = centx;
|
||||
PrevY = centy;
|
||||
SetCursorPos (centx, centy);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
|
|
|
@ -443,13 +443,6 @@ BEGIN
|
|||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
IDC_INVISIBLECURSOR CURSOR "cursor1.cur"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue