diff --git a/Gameleap/code/CoreTech/Libraries/GameOS/WinMain.cpp b/Gameleap/code/CoreTech/Libraries/GameOS/WinMain.cpp index 3b1682aa..f10f4679 100644 --- a/Gameleap/code/CoreTech/Libraries/GameOS/WinMain.cpp +++ b/Gameleap/code/CoreTech/Libraries/GameOS/WinMain.cpp @@ -941,10 +941,15 @@ void gos_UpdateDisplay( bool Everything ) } break; case 4: - // Same 7-step cadence as mode 1: clear both MFD devices at step 0. + // Step 0: clear + grid for radar and LEFT MFD. + // Step 1: clear + grid for RIGHT MFD (staggered so the right + // flip at new sh_step==1 shows channels 3-4 from the previous + // cycle, not a freshly-cleared buffer). if(sh_step==0){ radar_device.BeginScene(); - mfd_device.BeginScene(); // also clears mfd_device_right internally + mfd_device.BeginScene(); // left device only + } else if(sh_step==1) { + mfd_device.BeginSceneRight(); // right device clear + grid } break; } diff --git a/Gameleap/code/CoreTech/Libraries/GameOS/render.cpp b/Gameleap/code/CoreTech/Libraries/GameOS/render.cpp index d87ee41c..13c8ce81 100644 --- a/Gameleap/code/CoreTech/Libraries/GameOS/render.cpp +++ b/Gameleap/code/CoreTech/Libraries/GameOS/render.cpp @@ -1620,23 +1620,15 @@ bool CMFD_Device::BeginScene() //pD3DDevice->Clear(0,NULL,D3DCLEAR_TARGET ,0,1.0f,0); }break; case 4: - // Clear and draw background grid on the LEFT device. + // Clear and draw background grid on the LEFT device only. + // The right device is cleared/gridded in BeginSceneRight(), + // called from WinMain at old sh_step==1 (one frame after the + // right MFD flip) so its back buffer has fresh content when flipped. SetRenderTargetBackbuffer(); pD3DDevice->Clear(0,NULL,D3DCLEAR_TARGET,0,1.0f,0); pD3DDevice->BeginScene(); if(sh_game_started) DrawMFDBackGrid(); pD3DDevice->EndScene(); - // Clear and draw background grid on the RIGHT device. - if (m_pRightDevice) { - m_pRightDevice->SetRenderTargetBackbuffer(); - m_pRightDevice->pD3DDevice->Clear(0,NULL,D3DCLEAR_TARGET,0,1.0f,0); - m_pRightDevice->pD3DDevice->BeginScene(); - if(sh_game_started) { - m_pRightDevice->pD3DDevice->SetTexture(0,0); - m_pRightDevice->DrawQuadList(8,rcs640_solo,0xFFFFFFFF); - } - m_pRightDevice->pD3DDevice->EndScene(); - } return true; // skip the common BeginScene/DrawGrid/EndScene below } pD3DDevice->BeginScene(); @@ -1655,6 +1647,25 @@ bool CMFD_Device::EndScene() return true; } +// Mode 4: clear and draw the background grid on the right device. +// Called from WinMain at old sh_step==1, one frame after the right MFD +// flip, so channels 3-4 can render into a fresh back buffer before the +// next flip at new sh_step==1 (= old sh_step==0). +bool CMFD_Device::BeginSceneRight() +{ + if (g_nTypeOfMFDs != 4 || !m_pRightDevice) + return false; + m_pRightDevice->SetRenderTargetBackbuffer(); + m_pRightDevice->pD3DDevice->Clear(0,NULL,D3DCLEAR_TARGET,0,1.0f,0); + m_pRightDevice->pD3DDevice->BeginScene(); + if(sh_game_started) { + m_pRightDevice->pD3DDevice->SetTexture(0,0); + m_pRightDevice->DrawQuadList(8,rcs640_solo,0xFFFFFFFF); + } + m_pRightDevice->pD3DDevice->EndScene(); + return true; +} + bool CMFD_Device::Release() { diff --git a/Gameleap/code/CoreTech/Libraries/GameOS/render.hpp b/Gameleap/code/CoreTech/Libraries/GameOS/render.hpp index cd07b11d..618cb664 100644 --- a/Gameleap/code/CoreTech/Libraries/GameOS/render.hpp +++ b/Gameleap/code/CoreTech/Libraries/GameOS/render.hpp @@ -178,6 +178,7 @@ public: bool BeginChannel(DWORD channel);// 0~4¹øÀÇ Ã¤³ÎÀ» Á¤ÇÒ ¼ö ÀְԵȴÙ. bool EndChannel(); virtual bool BeginScene(); //normalÇÑ beginscene/endscene¸¦ ÇÑ´Ù. + bool BeginSceneRight(); // mode 4: clear+grid on right device at sh_step==1 virtual bool EndScene(); //flipÀ» ÇÑ´Ù. virtual bool Release(); bool LoadDamageTexture(const char *mechtexturename);