Minor fixes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4955 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2010-01-25 05:12:24 +00:00
parent dbfdcc263b
commit 85c2310b03
3 changed files with 12 additions and 11 deletions

View File

@ -161,7 +161,8 @@ CPanel::CPanel(
return 0;
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)
main_frame->bNoWiimoteMsg = false;
else

View File

@ -154,8 +154,6 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
}
else if (wParam == WIIMOTE_DISCONNECT)
{
if (g_Config.bFullscreen)
ToggleFullscreen(hWnd);
PostMessage(m_hMain, WM_USER, wParam, lParam);
}
break;
@ -305,7 +303,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
dmScreenSettings.dmPelsWidth = w_fs;
dmScreenSettings.dmPelsHeight = h_fs;
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL)
if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
return;
// Set new window style -> PopUp
@ -335,14 +333,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
RECT rcdesktop;
GetWindowRect(GetDesktopWindow(), &rcdesktop);
// Set new window style FS -> Windowed
SetWindowLong(hParent, GWL_STYLE, style);
// SetWindowPos to the center of the screen
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/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);
// Set new window style FS -> Windowed
SetWindowLong(hParent, GWL_STYLE, style);
// Re-Enable the cursor
ShowCursor(TRUE);
g_Config.bFullscreen = false;

View File

@ -349,7 +349,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
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
@ -461,7 +463,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
dmScreenSettings.dmPelsWidth = w_fs;
dmScreenSettings.dmPelsHeight = h_fs;
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL)
if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
return;
// Set new window style -> PopUp
@ -490,14 +492,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
RECT rcdesktop;
GetWindowRect(GetDesktopWindow(), &rcdesktop);
// Set new window style FS -> Windowed
SetWindowLongPtr(hParent, GWL_STYLE, style);
// SetWindowPos to the center of the screen
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/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);
// Set new window style FS -> Windowed
SetWindowLongPtr(hParent, GWL_STYLE, style);
// Re-Enable the cursor
ShowCursor(TRUE);
g_Config.bFullscreen = false;