diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index e0ec4392..5ceb573a 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -161,6 +161,8 @@ Note: All fields default to false unless mentioned otherwise. nofallingdamage = ; // Falling damage is disabled in this sector dropactors = ; // Actors drop with instantly moving floors (*) norespawn = ; // Players can not respawn in this sector + soundsequence = ; // 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 =============================================================================== diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index d6f9596b..f4025375 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -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; diff --git a/src/m_options.cpp b/src/m_options.cpp index 4fd60a58..7d2d3f33 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -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} }, diff --git a/src/r_main.cpp b/src/r_main.cpp index 0bb308a6..435f7a41 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -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 PastViewers; static int centerxwide; static bool polyclipped; diff --git a/src/win32/cursor1.cur b/src/win32/cursor1.cur deleted file mode 100644 index 048f06b4..00000000 Binary files a/src/win32/cursor1.cur and /dev/null differ diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index e9d2a26b..d01547da 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -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; diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index a76380bd..808ae4fb 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -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; diff --git a/src/win32/i_mouse.cpp b/src/win32/i_mouse.cpp index 80c00bdb..af595dea 100644 --- a/src/win32/i_mouse.cpp +++ b/src/win32/i_mouse.cpp @@ -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); - } -} - /**************************************************************************/ /**************************************************************************/ diff --git a/src/win32/zdoom.rc b/src/win32/zdoom.rc index 014e09dc..d6602a10 100644 --- a/src/win32/zdoom.rc +++ b/src/win32/zdoom.rc @@ -443,13 +443,6 @@ BEGIN END -///////////////////////////////////////////////////////////////////////////// -// -// Cursor -// - -IDC_INVISIBLECURSOR CURSOR "cursor1.cur" - ///////////////////////////////////////////////////////////////////////////// // // Bitmap