void CPythonApplication::RenderGame() { if (!PERF_CHECKER_RENDER_GAME) { float fAspect=m_kWndMgr.GetAspect(); float fFarClip=m_pyBackground.GetFarClip(); m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); CCullingManager::Instance().Process(); m_kChrMgr.Deform(); m_kEftMgr.Update(); m_pyBackground.RenderCharacterShadowToTexture(); m_pyGraphic.SetGameRenderState(); m_pyGraphic.PushState(); { long lx, ly; m_kWndMgr.GetMousePosition(lx, ly); m_pyGraphic.SetCursorPosition(lx, ly); } m_pyBackground.RenderSky(); m_pyBackground.RenderBeforeLensFlare(); m_pyBackground.RenderCloud(); m_pyBackground.BeginEnvironment(); m_pyBackground.Render(); m_pyBackground.SetCharacterDirLight(); m_kChrMgr.Render(); m_pyBackground.SetBackgroundDirLight(); m_pyBackground.RenderWater(); m_pyBackground.RenderSnow(); m_pyBackground.RenderEffect(); m_pyBackground.EndEnvironment(); m_kEftMgr.Render(); m_pyItem.Render(); m_FlyingManager.Render(); m_pyBackground.BeginEnvironment(); m_pyBackground.RenderPCBlocker(); m_pyBackground.EndEnvironment(); m_pyBackground.RenderAfterLensFlare(); return; } //if (GetAsyncKeyState(VK_Z)) // STATEMANAGER.SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); DWORD t1 = ELTimer_GetMSec(); //m_kChrMgr.Deform(); DWORD t2 = ELTimer_GetMSec(); //m_kEftMgr.Update(); DWORD t3 = ELTimer_GetMSec(); m_pyBackground.RenderCharacterShadowToTexture(); DWORD t4 = ELTimer_GetMSec(); m_pyGraphic.SetGameRenderState(); m_pyGraphic.PushState(); float fAspect = m_kWndMgr.GetAspect(); float fFarClip = m_pyBackground.GetFarClip(); m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); DWORD t5 = ELTimer_GetMSec(); CCullingManager::Instance().Process(); DWORD t6 = ELTimer_GetMSec(); { long lx, ly; m_kWndMgr.GetMousePosition(lx, ly); m_pyGraphic.SetCursorPosition(lx, ly); } m_pyBackground.RenderSky(); DWORD t7 = ELTimer_GetMSec(); m_pyBackground.RenderBeforeLensFlare(); DWORD t8 = ELTimer_GetMSec(); m_pyBackground.RenderCloud(); DWORD t9 = ELTimer_GetMSec(); m_pyBackground.BeginEnvironment(); m_pyBackground.Render(); m_pyBackground.SetCharacterDirLight(); DWORD t10 = ELTimer_GetMSec(); m_kChrMgr.Render(); DWORD t11 = ELTimer_GetMSec(); m_pyBackground.SetBackgroundDirLight(); m_pyBackground.RenderWater(); DWORD t12 = ELTimer_GetMSec(); m_pyBackground.RenderEffect(); DWORD t13 = ELTimer_GetMSec(); m_pyBackground.EndEnvironment(); m_kEftMgr.Render(); DWORD t14 = ELTimer_GetMSec(); m_pyItem.Render(); DWORD t15 = ELTimer_GetMSec(); m_FlyingManager.Render(); DWORD t16 = ELTimer_GetMSec(); m_pyBackground.BeginEnvironment(); m_pyBackground.RenderPCBlocker(); m_pyBackground.EndEnvironment(); DWORD t17 = ELTimer_GetMSec(); m_pyBackground.RenderAfterLensFlare(); DWORD t18 = ELTimer_GetMSec(); DWORD tEnd = ELTimer_GetMSec(); if (GetAsyncKeyState(VK_Z)) STATEMANAGER.SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); if (tEnd - t1<3) return; static FILE* fp = fopen("perf_game_render.txt", "w"); fprintf(fp, "GR.Total %d (Time %d)\n", tEnd - t1, ELTimer_GetMSec()); fprintf(fp, "GR.DFM %d\n", t2 - t1); fprintf(fp, "GR.EFT.UP %d\n", t3 - t2); fprintf(fp, "GR.SHW %d\n", t4 - t3); fprintf(fp, "GR.STT %d\n", t5 - t4); fprintf(fp, "GR.CLL %d\n", t6 - t5); fprintf(fp, "GR.BG.SKY %d\n", t7 - t6); fprintf(fp, "GR.BG.LEN %d\n", t8 - t7); fprintf(fp, "GR.BG.CLD %d\n", t9 - t8); fprintf(fp, "GR.BG.MAIN %d\n", t10 - t9); fprintf(fp, "GR.CHR %d\n", t11 - t10); fprintf(fp, "GR.BG.WTR %d\n", t12 - t11); fprintf(fp, "GR.BG.EFT %d\n", t13 - t12); fprintf(fp, "GR.EFT %d\n", t14 - t13); fprintf(fp, "GR.ITM %d\n", t15 - t14); fprintf(fp, "GR.FLY %d\n", t16 - t15); fprintf(fp, "GR.BG.BLK %d\n", t17 - t16); fprintf(fp, "GR.BG.LEN %d\n", t18 - t17); fflush(fp); }