@@ -104,41 +104,42 @@ class D3DHooks : public Hook
104104 {
105105 IDirect3DDevice9* d3ddev = Game::D3DDevice ();
106106
107- if (Settings::UILetterboxing == 1 && Game::is_in_game ())
108- return ; // disable letterboxing while in-game
109-
110- // Backup existing cullmode and set to none, otherwise we won't get drawn
111- DWORD prevCullMode = D3DCULL_NONE;
112- d3ddev->GetRenderState (D3DRS_CULLMODE, &prevCullMode);
113- d3ddev->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE);
114-
115- // Seems these SetRenderState/SetTexture calls are needed for DGVoodoo to render letterbox while imgui is active
116- // DXVK/D3D9 seem to work fine without them
117- // TODO: the game keeps its own copies of the render states so it can update them if needed, should we update the games copy here?
107+ // Only show letterboxing if not in game, or UILetterboxing is 2
108+ if (!Game::is_in_game () || Settings::UILetterboxing == 2 )
118109 {
119- // Set render states
120- d3ddev->SetRenderState (D3DRS_ALPHABLENDENABLE, FALSE );
121- d3ddev->SetRenderState (D3DRS_ZENABLE, D3DZB_FALSE);
122- d3ddev->SetRenderState (D3DRS_LIGHTING, FALSE );
123-
124- // Set texture stage states to avoid any texture influence
125- d3ddev->SetTexture (0 , NULL );
126- d3ddev->SetTextureStageState (0 , D3DTSS_COLOROP, D3DTOP_DISABLE);
127- d3ddev->SetTextureStageState (0 , D3DTSS_ALPHAOP, D3DTOP_DISABLE);
128- }
110+ // Backup existing cullmode and set to none, otherwise we won't get drawn
111+ DWORD prevCullMode = D3DCULL_NONE;
112+ d3ddev->GetRenderState (D3DRS_CULLMODE, &prevCullMode);
113+ d3ddev->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE);
114+
115+ // Seems these SetRenderState/SetTexture calls are needed for DGVoodoo to render letterbox while imgui is active
116+ // DXVK/D3D9 seem to work fine without them
117+ // TODO: the game keeps its own copies of the render states so it can update them if needed, should we update the games copy here?
118+ {
119+ // Set render states
120+ d3ddev->SetRenderState (D3DRS_ALPHABLENDENABLE, FALSE );
121+ d3ddev->SetRenderState (D3DRS_ZENABLE, D3DZB_FALSE);
122+ d3ddev->SetRenderState (D3DRS_LIGHTING, FALSE );
123+
124+ // Set texture stage states to avoid any texture influence
125+ d3ddev->SetTexture (0 , NULL );
126+ d3ddev->SetTextureStageState (0 , D3DTSS_COLOROP, D3DTOP_DISABLE);
127+ d3ddev->SetTextureStageState (0 , D3DTSS_ALPHAOP, D3DTOP_DISABLE);
128+ }
129129
130- // Set FVF and stream source
131- d3ddev->SetFVF (CUSTOMFVF);
132- d3ddev->SetStreamSource (0 , LetterboxVertex, 0 , sizeof (CUSTOMVERTEX));
130+ // Set FVF and stream source
131+ d3ddev->SetFVF (CUSTOMFVF);
132+ d3ddev->SetStreamSource (0 , LetterboxVertex, 0 , sizeof (CUSTOMVERTEX));
133133
134- // Draw left border
135- d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0 , 2 );
134+ // Draw left border
135+ d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0 , 2 );
136136
137- // Draw right border
138- d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 4 , 2 );
137+ // Draw right border
138+ d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 4 , 2 );
139139
140- // Restore original cullmode
141- d3ddev->SetRenderState (D3DRS_CULLMODE, prevCullMode);
140+ // Restore original cullmode
141+ d3ddev->SetRenderState (D3DRS_CULLMODE, prevCullMode);
142+ }
142143 }
143144
144145 if (overlayInited)
0 commit comments