Mercurial > mm7
comparison Game.cpp @ 804:9a3121bbc1d0
Слияние
author | Ritor1 |
---|---|
date | Mon, 25 Mar 2013 15:18:40 +0600 |
parents | d2deab4991fa 4a00901e063c |
children | cfc65feef029 |
comparison
equal
deleted
inserted
replaced
803:d2deab4991fa | 804:9a3121bbc1d0 |
---|---|
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 } |
657 pDecalBuilder->field_308008 = 0; | 686 pDecalBuilder->field_308008 = 0; |
658 if (!_44F07B()) | 687 if (!_44F07B()) |
659 return false; | 688 return false; |
660 | 689 |
661 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) | 690 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) |
662 LOBYTE(pStru10Instance->field_4) = 0; | 691 pStru10Instance->bDoNotDrawPortalFrustum = false; |
663 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 692 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
664 { | 693 { |
665 v5 = GetLevelFogColor(); | 694 v5 = GetLevelFogColor(); |
666 pRenderer->uFogColor = v5 & 0xFFFFFF; | 695 pRenderer->uFogColor = v5 & 0xFFFFFF; |
667 } | 696 } |