| 284 | } |
| 285 | |
| 286 | void ShowProgress(interface_mode uMsg) |
| 287 | { |
| 288 | IsProgress = true; |
| 289 | |
| 290 | gbSomebodyWonGameKludge = false; |
| 291 | plrmsg_delay(true); |
| 292 | |
| 293 | EventHandler previousHandler = SetEventHandler(DisableInputEventHandler); |
| 294 | |
| 295 | if (!HeadlessMode) { |
| 296 | assert(ghMainWnd); |
| 297 | |
| 298 | interface_msg_pump(); |
| 299 | ClearScreenBuffer(); |
| 300 | scrollrt_draw_game_screen(); |
| 301 | |
| 302 | if (IsHardwareCursor()) |
| 303 | SetHardwareCursorVisible(false); |
| 304 | |
| 305 | BlackPalette(); |
| 306 | |
| 307 | // Blit the background once and then free it. |
| 308 | LoadCutsceneBackground(uMsg); |
| 309 | DrawCutsceneBackground(); |
| 310 | if (RenderDirectlyToOutputSurface && PalSurface != nullptr) { |
| 311 | // Render into all the backbuffers if there are multiple. |
| 312 | const void *initialPixels = PalSurface->pixels; |
| 313 | if (DiabloUiSurface() == PalSurface) |
| 314 | BltFast(nullptr, nullptr); |
| 315 | RenderPresent(); |
| 316 | while (PalSurface->pixels != initialPixels) { |
| 317 | DrawCutsceneBackground(); |
| 318 | if (DiabloUiSurface() == PalSurface) |
| 319 | BltFast(nullptr, nullptr); |
| 320 | RenderPresent(); |
| 321 | } |
| 322 | } |
| 323 | FreeCutsceneBackground(); |
| 324 | |
| 325 | PaletteFadeIn(8); |
| 326 | IncProgress(); |
| 327 | sound_init(); |
| 328 | IncProgress(); |
| 329 | } |
| 330 | |
| 331 | Player &myPlayer = *MyPlayer; |
| 332 | |
| 333 | switch (uMsg) { |
| 334 | case WM_DIABLOADGAME: |
| 335 | IncProgress(); |
| 336 | IncProgress(); |
| 337 | LoadGame(true); |
| 338 | IncProgress(); |
| 339 | IncProgress(); |
| 340 | break; |
| 341 | case WM_DIABNEWGAME: |
| 342 | myPlayer.pOriginalCathedral = !gbIsHellfire; |
| 343 | IncProgress(); |
no test coverage detected