Minor fixes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4955 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
dbfdcc263b
commit
85c2310b03
|
@ -161,7 +161,8 @@ CPanel::CPanel(
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WIIMOTE_DISCONNECT:
|
case WIIMOTE_DISCONNECT:
|
||||||
if( SConfig::GetInstance().m_LocalCoreStartupParameter.bWii ){ //Only Alerts if the game is a wii game.
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
|
{
|
||||||
if (main_frame->bNoWiimoteMsg)
|
if (main_frame->bNoWiimoteMsg)
|
||||||
main_frame->bNoWiimoteMsg = false;
|
main_frame->bNoWiimoteMsg = false;
|
||||||
else
|
else
|
||||||
|
|
|
@ -154,8 +154,6 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||||
}
|
}
|
||||||
else if (wParam == WIIMOTE_DISCONNECT)
|
else if (wParam == WIIMOTE_DISCONNECT)
|
||||||
{
|
{
|
||||||
if (g_Config.bFullscreen)
|
|
||||||
ToggleFullscreen(hWnd);
|
|
||||||
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -305,7 +303,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
dmScreenSettings.dmPelsWidth = w_fs;
|
dmScreenSettings.dmPelsWidth = w_fs;
|
||||||
dmScreenSettings.dmPelsHeight = h_fs;
|
dmScreenSettings.dmPelsHeight = h_fs;
|
||||||
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
|
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
|
||||||
if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL)
|
if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Set new window style -> PopUp
|
// Set new window style -> PopUp
|
||||||
|
@ -335,14 +333,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
RECT rcdesktop;
|
RECT rcdesktop;
|
||||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||||
|
|
||||||
|
// Set new window style FS -> Windowed
|
||||||
|
SetWindowLong(hParent, GWL_STYLE, style);
|
||||||
|
|
||||||
// SetWindowPos to the center of the screen
|
// SetWindowPos to the center of the screen
|
||||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
||||||
SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER);
|
SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER);
|
||||||
|
|
||||||
// Set new window style FS -> Windowed
|
|
||||||
SetWindowLong(hParent, GWL_STYLE, style);
|
|
||||||
|
|
||||||
// Re-Enable the cursor
|
// Re-Enable the cursor
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
g_Config.bFullscreen = false;
|
g_Config.bFullscreen = false;
|
||||||
|
|
|
@ -349,7 +349,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||||
ToggleFullscreen(m_hWnd);
|
ToggleFullscreen(m_hWnd);
|
||||||
}
|
}
|
||||||
else if (wParam == WIIMOTE_DISCONNECT)
|
else if (wParam == WIIMOTE_DISCONNECT)
|
||||||
|
{
|
||||||
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// This is called when we close the window when we render to a separate window
|
// This is called when we close the window when we render to a separate window
|
||||||
|
@ -461,7 +463,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
dmScreenSettings.dmPelsWidth = w_fs;
|
dmScreenSettings.dmPelsWidth = w_fs;
|
||||||
dmScreenSettings.dmPelsHeight = h_fs;
|
dmScreenSettings.dmPelsHeight = h_fs;
|
||||||
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
|
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
|
||||||
if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL)
|
if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Set new window style -> PopUp
|
// Set new window style -> PopUp
|
||||||
|
@ -490,14 +492,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
RECT rcdesktop;
|
RECT rcdesktop;
|
||||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||||
|
|
||||||
|
// Set new window style FS -> Windowed
|
||||||
|
SetWindowLongPtr(hParent, GWL_STYLE, style);
|
||||||
|
|
||||||
// SetWindowPos to the center of the screen
|
// SetWindowPos to the center of the screen
|
||||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
||||||
SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER);
|
SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER);
|
||||||
|
|
||||||
// Set new window style FS -> Windowed
|
|
||||||
SetWindowLongPtr(hParent, GWL_STYLE, style);
|
|
||||||
|
|
||||||
// Re-Enable the cursor
|
// Re-Enable the cursor
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
g_Config.bFullscreen = false;
|
g_Config.bFullscreen = false;
|
||||||
|
|
Loading…
Reference in New Issue