@@ -705,18 +705,17 @@ BOOL CHW::support(D3DFORMAT fmt, DWORD type, DWORD usage)
705705
706706void CHW::updateWindowProps (HWND m_hWnd)
707707{
708- // BOOL bWindowed = strstr(Core.Params,"-dedicated") ? TRUE : !psDeviceFlags.is (rsFullscreen);
709- BOOL bWindowed = !psDeviceFlags.is (rsFullscreen);
708+ const bool bWindowed = !psDeviceFlags.is (rsFullscreen);
710709
711710 u32 dwWindowStyle = 0 ;
712711 // Set window properties depending on what mode were in.
713712 if (bWindowed)
714713 {
715714 if (m_move_window)
716715 {
717- bool bBordersMode = strstr (Core.Params , " -draw_borders" );
716+ const bool drawBorders = strstr (Core.Params , " -draw_borders" );
718717 dwWindowStyle = WS_VISIBLE;
719- if (bBordersMode )
718+ if (drawBorders )
720719 dwWindowStyle |= WS_BORDER | WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX;
721720 SetWindowLong (m_hWnd, GWL_STYLE, dwWindowStyle);
722721 // When moving from fullscreen to windowed mode, it is important to
@@ -730,38 +729,40 @@ void CHW::updateWindowProps(HWND m_hWnd)
730729
731730 RECT m_rcWindowBounds;
732731 float fYOffset = 0 .f ;
733- bool bCenter = false ;
732+ bool centerScreen = false ;
734733 if (strstr (Core.Params , " -center_screen" ))
735- bCenter = true ;
734+ centerScreen = true ;
736735
737- if (bCenter )
736+ if (centerScreen )
738737 {
739738 RECT DesktopRect;
740-
741739 GetClientRect (GetDesktopWindow (), &DesktopRect);
742740
743- SetRect (&m_rcWindowBounds, (DesktopRect.right - m_ChainDesc.BufferDesc .Width ) / 2 ,
741+ SetRect (&m_rcWindowBounds,
742+ (DesktopRect.right - m_ChainDesc.BufferDesc .Width ) / 2 ,
744743 (DesktopRect.bottom - m_ChainDesc.BufferDesc .Height ) / 2 ,
745744 (DesktopRect.right + m_ChainDesc.BufferDesc .Width ) / 2 ,
746745 (DesktopRect.bottom + m_ChainDesc.BufferDesc .Height ) / 2 );
747746 }
748747 else
749748 {
750- if (bBordersMode )
749+ if (drawBorders )
751750 fYOffset = GetSystemMetrics (SM_CYCAPTION); // size of the window title bar
752751 SetRect (&m_rcWindowBounds, 0 , 0 , m_ChainDesc.BufferDesc .Width , m_ChainDesc.BufferDesc .Height );
753752 };
754753
755754 AdjustWindowRect (&m_rcWindowBounds, dwWindowStyle, FALSE );
756755
757- SetWindowPos (m_hWnd, HWND_NOTOPMOST, m_rcWindowBounds.left , m_rcWindowBounds.top + fYOffset ,
758- (m_rcWindowBounds.right - m_rcWindowBounds.left ), (m_rcWindowBounds.bottom - m_rcWindowBounds.top ),
759- SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_DRAWFRAME);
756+ SetWindowPos (m_hWnd, HWND_NOTOPMOST,
757+ m_rcWindowBounds.left , m_rcWindowBounds.top + fYOffset ,
758+ m_rcWindowBounds.right - m_rcWindowBounds.left ,
759+ m_rcWindowBounds.bottom - m_rcWindowBounds.top ,
760+ SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_DRAWFRAME);
760761 }
761762 }
762763 else
763764 {
764- SetWindowLong (m_hWnd, GWL_STYLE, dwWindowStyle = ( WS_POPUP | WS_VISIBLE) );
765+ SetWindowLong (m_hWnd, GWL_STYLE, dwWindowStyle = WS_POPUP | WS_VISIBLE);
765766 }
766767
767768 ShowCursor (FALSE );
0 commit comments