mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
@ -59,6 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "pfCrashHandler/plCrashCli.h"
|
#include "pfCrashHandler/plCrashCli.h"
|
||||||
#include "plNetClient/plNetClientMgr.h"
|
#include "plNetClient/plNetClientMgr.h"
|
||||||
#include "plNetClient/plNetLinkingMgr.h"
|
#include "plNetClient/plNetLinkingMgr.h"
|
||||||
|
#include "plInputCore/plInputDevice.h"
|
||||||
#include "plInputCore/plInputManager.h"
|
#include "plInputCore/plInputManager.h"
|
||||||
#include "plUnifiedTime/plUnifiedTime.h"
|
#include "plUnifiedTime/plUnifiedTime.h"
|
||||||
#include "plPipeline.h"
|
#include "plPipeline.h"
|
||||||
@ -370,7 +371,7 @@ void DebugMsgF(const char* format, ...);
|
|||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static bool gDragging = false;
|
static bool gDragging = false;
|
||||||
static uint32_t keyState=0;
|
static uint8_t mouse_down = 0;
|
||||||
|
|
||||||
// Messages we registered for manually (no const value)
|
// Messages we registered for manually (no const value)
|
||||||
if (message == s_WmTaskbarList)
|
if (message == s_WmTaskbarList)
|
||||||
@ -394,31 +395,45 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nc->ResetServerTimeOffset(true);
|
nc->ResetServerTimeOffset(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KEYDOWN :
|
case WM_LBUTTONDOWN:
|
||||||
case WM_LBUTTONDOWN :
|
case WM_RBUTTONDOWN:
|
||||||
case WM_RBUTTONDOWN :
|
case WM_LBUTTONDBLCLK:
|
||||||
case WM_LBUTTONDBLCLK : // The left mouse button was double-clicked.
|
case WM_MBUTTONDBLCLK:
|
||||||
case WM_MBUTTONDBLCLK : // The middle mouse button was double-clicked.
|
case WM_MBUTTONDOWN:
|
||||||
case WM_MBUTTONDOWN : // The middle mouse button was pressed.
|
case WM_RBUTTONDBLCLK:
|
||||||
case WM_RBUTTONDBLCLK : // The right mouse button was double-clicked.
|
// Ensure we don't leave the client area during clicks
|
||||||
// If they did anything but move the mouse, quit any intro movie playing.
|
if (!(mouse_down++))
|
||||||
{
|
SetCapture(hWnd);
|
||||||
if( gClient )
|
// fall through to old case
|
||||||
gClient->SetQuitIntro(true);
|
case WM_KEYDOWN:
|
||||||
}
|
|
||||||
// Fall through to other events
|
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
case WM_KEYUP :
|
// If they did anything but move the mouse, quit any intro movie playing.
|
||||||
case WM_LBUTTONUP :
|
if (gClient)
|
||||||
case WM_RBUTTONUP :
|
|
||||||
case WM_MBUTTONUP : // The middle mouse button was released.
|
|
||||||
case WM_MOUSEMOVE :
|
|
||||||
case 0x020A: // fuc&ing windows b.s...
|
|
||||||
{
|
{
|
||||||
if (gClient && gClient->WindowActive() && gClient->GetInputManager())
|
gClient->SetQuitIntro(true);
|
||||||
{
|
|
||||||
|
// normal input processing
|
||||||
|
if (gClient->WindowActive() && gClient->GetInputManager())
|
||||||
|
gClient->GetInputManager()->HandleWin32ControlEvent(message, wParam, lParam, hWnd);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
case WM_RBUTTONUP:
|
||||||
|
case WM_MBUTTONUP:
|
||||||
|
// Stop hogging the cursor
|
||||||
|
if (!(--mouse_down))
|
||||||
|
ReleaseCapture();
|
||||||
|
// fall through to input processing
|
||||||
|
case WM_MOUSEWHEEL:
|
||||||
|
case WM_KEYUP:
|
||||||
|
if (gClient && gClient->WindowActive() && gClient->GetInputManager())
|
||||||
|
gClient->GetInputManager()->HandleWin32ControlEvent(message, wParam, lParam, hWnd);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
{
|
||||||
|
if (gClient && gClient->GetInputManager())
|
||||||
gClient->GetInputManager()->HandleWin32ControlEvent(message, wParam, lParam, hWnd);
|
gClient->GetInputManager()->HandleWin32ControlEvent(message, wParam, lParam, hWnd);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -457,6 +472,26 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_SETCURSOR:
|
||||||
|
{
|
||||||
|
static bool winCursor = true;
|
||||||
|
bool enterWnd = LOWORD(lParam) == HTCLIENT;
|
||||||
|
if (enterWnd && winCursor)
|
||||||
|
{
|
||||||
|
winCursor = !winCursor;
|
||||||
|
ShowCursor(winCursor != 0);
|
||||||
|
plMouseDevice::ShowCursor();
|
||||||
|
}
|
||||||
|
else if (!enterWnd && !winCursor)
|
||||||
|
{
|
||||||
|
winCursor = !winCursor;
|
||||||
|
ShowCursor(winCursor != 0);
|
||||||
|
plMouseDevice::HideCursor();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
{
|
{
|
||||||
bool active = (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE);
|
bool active = (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE);
|
||||||
@ -469,25 +504,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
if (gClient && !minimized && !gClient->GetDone())
|
if (gClient && !minimized && !gClient->GetDone())
|
||||||
{
|
{
|
||||||
if (LOWORD(wParam) == WA_CLICKACTIVE)
|
|
||||||
{
|
|
||||||
// See if they've clicked on the frame, in which case they just want to
|
|
||||||
// move, not activate, us.
|
|
||||||
POINT pt;
|
|
||||||
GetCursorPos(&pt);
|
|
||||||
ScreenToClient(hWnd, &pt);
|
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
GetClientRect(hWnd, &rect);
|
|
||||||
|
|
||||||
if( (pt.x < rect.left)
|
|
||||||
||(pt.x >= rect.right)
|
|
||||||
||(pt.y < rect.top)
|
|
||||||
||(pt.y >= rect.bottom) )
|
|
||||||
{
|
|
||||||
active = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gClient->WindowActivate(active);
|
gClient->WindowActivate(active);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -750,27 +750,3 @@ bool plMouseDevice::MsgReceive(plMessage* msg)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void plMouseDevice::HandleWindowActivate(bool bActive, HWND hWnd)
|
|
||||||
{
|
|
||||||
if ( bActive )
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
::GetClientRect(hWnd,&rect);
|
|
||||||
|
|
||||||
// rect.right /= plInputManager::GetInstance()->GetMouseScale();
|
|
||||||
// rect.bottom /= plInputManager::GetInstance()->GetMouseScale();
|
|
||||||
|
|
||||||
::MapWindowPoints( hWnd, NULL, (POINT *)&rect, 2 );
|
|
||||||
::ShowCursor( FALSE );
|
|
||||||
SetCapture(hWnd);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ReleaseCapture();
|
|
||||||
::ShowCursor( TRUE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -160,7 +160,6 @@ public:
|
|||||||
~plMouseDevice();
|
~plMouseDevice();
|
||||||
|
|
||||||
const char* GetInputName() { return "mouse"; }
|
const char* GetInputName() { return "mouse"; }
|
||||||
void HandleWindowActivate(bool bActive, hsWindowHndl hWnd);
|
|
||||||
|
|
||||||
bool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
|
bool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
|
||||||
void SetControlFlag(int f)
|
void SetControlFlag(int f)
|
||||||
|
@ -584,8 +584,6 @@ void plDInputMgr::AddDevice(IDirectInputDevice8* device)
|
|||||||
void plDInputMgr::ConfigureDevice()
|
void plDInputMgr::ConfigureDevice()
|
||||||
{
|
{
|
||||||
::ShowCursor( TRUE );
|
::ShowCursor( TRUE );
|
||||||
ReleaseCapture();
|
|
||||||
|
|
||||||
|
|
||||||
DICOLORSET dics;
|
DICOLORSET dics;
|
||||||
ZeroMemory(&dics, sizeof(DICOLORSET));
|
ZeroMemory(&dics, sizeof(DICOLORSET));
|
||||||
@ -607,8 +605,6 @@ void plDInputMgr::ConfigureDevice()
|
|||||||
fDI->fSticks[i]->fDevice->SetActionMap( fDI->fActionFormat, NULL, DIDSAM_FORCESAVE );
|
fDI->fSticks[i]->fDevice->SetActionMap( fDI->fActionFormat, NULL, DIDSAM_FORCESAVE );
|
||||||
|
|
||||||
::ShowCursor( FALSE );
|
::ShowCursor( FALSE );
|
||||||
SetCapture(fhWnd);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plDInputMgr::MsgReceive(plMessage* msg)
|
bool plDInputMgr::MsgReceive(plMessage* msg)
|
||||||
|
@ -2247,7 +2247,6 @@ bool plDXPipeline::IResetDevice()
|
|||||||
{
|
{
|
||||||
IClearShadowSlaves();
|
IClearShadowSlaves();
|
||||||
|
|
||||||
ReleaseCapture();
|
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
HRESULT coopLev = fD3DDevice->TestCooperativeLevel();
|
HRESULT coopLev = fD3DDevice->TestCooperativeLevel();
|
||||||
if( coopLev == D3DERR_DEVICELOST )
|
if( coopLev == D3DERR_DEVICELOST )
|
||||||
@ -2295,8 +2294,6 @@ bool plDXPipeline::IResetDevice()
|
|||||||
/// all device-specific stuff needs to be recreated
|
/// all device-specific stuff needs to be recreated
|
||||||
plDeviceRecreateMsg* clean = new plDeviceRecreateMsg();
|
plDeviceRecreateMsg* clean = new plDeviceRecreateMsg();
|
||||||
plgDispatch::MsgSend(clean);
|
plgDispatch::MsgSend(clean);
|
||||||
|
|
||||||
SetCapture(fSettings.fHWnd);
|
|
||||||
}
|
}
|
||||||
fDevWasLost = true;
|
fDevWasLost = true;
|
||||||
fDeviceLost = false;
|
fDeviceLost = false;
|
||||||
|
Reference in New Issue
Block a user