mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fixed Issue 1928
Fixed Issue 1917 (Since wxWidgets is not allowed in core, so I moved the popup window to CFrame) *Maybe* this could also fix Issue 1919? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4780 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -34,6 +34,20 @@ const TCHAR m_szClassName[] = _T("DolphinEmuWnd");
|
||||
int g_winstyle;
|
||||
static volatile bool s_sizing;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
|
||||
an empty transparent cursor */
|
||||
// ------------------
|
||||
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
||||
void CreateCursors(HINSTANCE hInstance)
|
||||
{
|
||||
BYTE ANDmaskCursor[] = { 0xff };
|
||||
BYTE XORmaskCursor[] = { 0x00 };
|
||||
hCursorBlank = CreateCursor(hInstance, 0,0, 1,1, ANDmaskCursor,XORmaskCursor);
|
||||
|
||||
hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
}
|
||||
|
||||
bool IsSizing()
|
||||
{
|
||||
return s_sizing;
|
||||
@ -117,14 +131,18 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
// Which then handles all the necessary steps to Shutdown the core + the plugins
|
||||
if (m_hParent == NULL)
|
||||
{
|
||||
PostMessage( m_hMain, WM_USER, WM_USER_STOP, 0 );
|
||||
PostMessage(m_hMain, WM_USER, WM_USER_STOP, 0);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_USER:
|
||||
if (wParam == TOGGLE_FULLSCREEN)
|
||||
if (wParam == WM_USER_STOP)
|
||||
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||
else if (wParam == TOGGLE_FULLSCREEN)
|
||||
ToggleFullscreen(hWnd);
|
||||
else if (wParam == WIIMOTE_DISCONNECT)
|
||||
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
@ -159,6 +177,8 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
||||
m_hInstance = hInstance;
|
||||
RegisterClassEx( &wndClass );
|
||||
|
||||
CreateCursors(m_hInstance);
|
||||
|
||||
if (g_Config.RenderToMainframe)
|
||||
{
|
||||
m_hParent = m_hMain = parent;
|
||||
|
@ -332,18 +332,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
and coordinate it with the other settings if nessesary */
|
||||
case WM_USER:
|
||||
if (wParam == WM_USER_STOP)
|
||||
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||
else if (wParam == WM_USER_KEYDOWN)
|
||||
{
|
||||
if (lParam)
|
||||
SetCursor(hCursor);
|
||||
else
|
||||
SetCursor(hCursorBlank);
|
||||
}
|
||||
if (wParam == WM_USER_KEYDOWN) {
|
||||
OnKeyDown(lParam);
|
||||
FreeLookInput(wParam, lParam);
|
||||
}
|
||||
if (wParam == TOGGLE_FULLSCREEN && !g_Config.RenderToMainframe)
|
||||
ToggleFullscreen(m_hWnd);
|
||||
else if (wParam == TOGGLE_FULLSCREEN)
|
||||
{
|
||||
if(!g_Config.RenderToMainframe)
|
||||
ToggleFullscreen(m_hWnd);
|
||||
}
|
||||
else if (wParam == WIIMOTE_DISCONNECT)
|
||||
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||
break;
|
||||
|
||||
// This is called when we close the window when we render to a separate window
|
||||
|
@ -191,15 +191,10 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
only let it pass through Dolphin > Frame.cpp to determine if it should be on or off
|
||||
and coordinate it with the other settings if nessesary */
|
||||
case WM_USER:
|
||||
/* I set wParam to 10 just in case there are other WM_USER events. If we want more
|
||||
WM_USER cases we would start making wParam or lParam cases */
|
||||
if (wParam == 10)
|
||||
{
|
||||
if (lParam)
|
||||
SetCursor(hCursor);
|
||||
else
|
||||
SetCursor(hCursorBlank);
|
||||
}
|
||||
if (wParam == WM_USER_STOP)
|
||||
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||
else if (wParam == WIIMOTE_DISCONNECT)
|
||||
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||
break;
|
||||
|
||||
/* Post thes mouse events to the main window, it's nessesary becase in difference to the
|
||||
|
@ -311,6 +311,8 @@ void Shutdown()
|
||||
// Finally close SDL
|
||||
if (SDL_WasInit(0))
|
||||
SDL_Quit();
|
||||
|
||||
g_SearchDeviceDone = false;
|
||||
}
|
||||
|
||||
// Start emulation
|
||||
@ -555,15 +557,7 @@ void InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size
|
||||
}
|
||||
|
||||
void ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
// Check for custom communication
|
||||
if(_channelID == 99 && *(const u8*)_pData == WIIMOTE_DISCONNECT)
|
||||
{
|
||||
WARN_LOG(WIIMOTE, "Wiimote: #%i Disconnected", _number);
|
||||
g_ReportingAuto[_number] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
g_ID = _number;
|
||||
|
||||
hid_packet* hidp = (hid_packet*)_pData;
|
||||
|
@ -333,6 +333,17 @@ void Wiimote_ControlChannel(int _number, u16 _channelID, const void* _pData, u32
|
||||
DEBUG_LOG(WIIMOTE, " Data: %s", Temp.c_str());
|
||||
#endif
|
||||
|
||||
// Check for custom communication
|
||||
if(_channelID == 99 && *(const u8*)_pData == WIIMOTE_DISCONNECT)
|
||||
{
|
||||
WiiMoteEmu::g_ReportingAuto[_number] = false;
|
||||
WARN_LOG(WIIMOTE, "Wiimote: #%i Disconnected", _number);
|
||||
#ifdef _WIN32
|
||||
PostMessage(g_WiimoteInitialize.hWnd, WM_USER, WIIMOTE_DISCONNECT, _number);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (WiiMoteEmu::WiiMapping[_number].Source <= 1)
|
||||
WiiMoteEmu::ControlChannel(_number, _channelID, _pData, _Size);
|
||||
#if HAVE_WIIUSE
|
||||
|
@ -253,6 +253,7 @@ void Shutdown()
|
||||
|
||||
// Remove the pointer to the initialize data
|
||||
g_PADInitialize = NULL;
|
||||
g_SearchDeviceDone = false;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user