| 3236 | } |
| 3237 | |
| 3238 | bool GuiController::CallInventory(ItemInfo* item, bool resetMode) |
| 3239 | { |
| 3240 | auto& player = GetLaraInfo(*item); |
| 3241 | |
| 3242 | bool doLoad = false; |
| 3243 | |
| 3244 | player.Inventory.OldBusy = player.Inventory.IsBusy; |
| 3245 | |
| 3246 | g_Renderer.DumpGameScene(SceneRenderMode::NoHud); |
| 3247 | g_VideoPlayer.Pause(); |
| 3248 | PauseAllSounds(SoundPauseMode::Inventory); |
| 3249 | SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always); |
| 3250 | |
| 3251 | if (resetMode) |
| 3252 | SetInventoryMode(InventoryMode::InGame); |
| 3253 | |
| 3254 | InitializeInventory(item); |
| 3255 | |
| 3256 | g_Synchronizer.Init(); |
| 3257 | |
| 3258 | bool legacy30FpsDoneDraw = false; |
| 3259 | bool exitLoop = false; |
| 3260 | |
| 3261 | while (!exitLoop) |
| 3262 | { |
| 3263 | if (ThreadEnded) |
| 3264 | { |
| 3265 | App.ResetClock = true; |
| 3266 | return false; |
| 3267 | } |
| 3268 | |
| 3269 | g_Synchronizer.Sync(); |
| 3270 | |
| 3271 | while (g_Synchronizer.Synced()) |
| 3272 | { |
| 3273 | TimeInMenu++; |
| 3274 | GlobalCounter++; |
| 3275 | SaveGame::Statistics.Game.TimeTaken++; |
| 3276 | SaveGame::Statistics.Level.TimeTaken++; |
| 3277 | |
| 3278 | UpdateInputActions(); |
| 3279 | |
| 3280 | if (GuiIsDeselected() || IsClicked(In::Inventory)) |
| 3281 | exitLoop = true; |
| 3282 | |
| 3283 | g_Renderer.PrepareScene(); |
| 3284 | |
| 3285 | switch (InvMode) |
| 3286 | { |
| 3287 | case InventoryMode::InGame: |
| 3288 | if (exitLoop) |
| 3289 | SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always); |
| 3290 | |
| 3291 | DoInventory(item); |
| 3292 | break; |
| 3293 | |
| 3294 | case InventoryMode::Statistics: |
| 3295 | exitLoop = !resetMode; |
no test coverage detected