Mercurial > mm7
comparison Game.cpp @ 794:4a00901e063c
stru10
author | Nomad |
---|---|
date | Mon, 25 Mar 2013 11:58:38 +0200 |
parents | 346f7069676a |
children | 9a3121bbc1d0 |
comparison
equal
deleted
inserted
replaced
793:290afbd48b6b | 794:4a00901e063c |
---|---|
171 pStru6Instance->DrawPlayerBuffAnims(); | 171 pStru6Instance->DrawPlayerBuffAnims(); |
172 pOtherOverlayList->DrawTurnBasedIcon(v4); | 172 pOtherOverlayList->DrawTurnBasedIcon(v4); |
173 GameUI_DrawTorchlightAndWizardEye(); | 173 GameUI_DrawTorchlightAndWizardEye(); |
174 } | 174 } |
175 | 175 |
176 | |
177 static bool render_framerate = false; | |
178 static float framerate = 0.0f; | |
179 static uint frames_this_second = 0; | |
180 static uint last_frame_time = GetTickCount(); | |
181 static uint framerate_time_elapsed = 0; | |
182 | |
183 auto frame_dt = GetTickCount() - last_frame_time; | |
184 last_frame_time = GetTickCount(); | |
185 | |
186 framerate_time_elapsed += frame_dt; | |
187 if (framerate_time_elapsed >= 1000) | |
188 { | |
189 framerate = frames_this_second * (1000.0f / framerate_time_elapsed); | |
190 | |
191 framerate_time_elapsed = 0; | |
192 frames_this_second = 0; | |
193 render_framerate = true; | |
194 } | |
195 | |
196 ++frames_this_second; | |
197 | |
198 | |
199 if (render_framerate) | |
200 { | |
201 sprintf(pTmpBuf, "FPS: % .4f", framerate); | |
202 pPrimaryWindow->DrawText(pFontArrus, 494, 0, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0), pTmpBuf, 0, 0, 0); | |
203 } | |
204 | |
176 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | 205 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
177 { | 206 { |
178 sprintf(pTmpBuf, "Party Sector ID: %u/%u\n", pBLVRenderParams->uPartySectorID, pIndoor->uNumSectors); | 207 sprintf(pTmpBuf, "Party Sector ID: %u/%u\n", pBLVRenderParams->uPartySectorID, pIndoor->uNumSectors); |
179 pPrimaryWindow->DrawText(pFontArrus, 16, 16, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF); | 208 pPrimaryWindow->DrawText(pFontArrus, 16, 16, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF); |
180 } | 209 } |
658 pDecalBuilder->field_308008 = 0; | 687 pDecalBuilder->field_308008 = 0; |
659 if (!_44F07B()) | 688 if (!_44F07B()) |
660 return false; | 689 return false; |
661 | 690 |
662 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) | 691 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) |
663 LOBYTE(pStru10Instance->field_4) = 0; | 692 pStru10Instance->bDoNotDrawPortalFrustum = false; |
664 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 693 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
665 { | 694 { |
666 v5 = GetLevelFogColor(); | 695 v5 = GetLevelFogColor(); |
667 pRenderer->uFogColor = v5 & 0xFFFFFF; | 696 pRenderer->uFogColor = v5 & 0xFFFFFF; |
668 } | 697 } |