Mercurial > mm7
comparison Game/MainMenu.cpp @ 2564:f9bdfe26d03d
.
author | a.parshin |
---|---|
date | Wed, 20 May 2015 00:56:07 +0200 |
parents | 48708da03b7f |
children | d87bfbd3bb3b |
comparison
equal
deleted
inserted
replaced
2563:65c97624c047 | 2564:f9bdfe26d03d |
---|---|
13 #include "GUI/UI/UIPartyCreation.h" | 13 #include "GUI/UI/UIPartyCreation.h" |
14 #include "GUI/UI/UISaveLoad.h" | 14 #include "GUI/UI/UISaveLoad.h" |
15 #include "GUI/GUIButton.h" | 15 #include "GUI/GUIButton.h" |
16 | 16 |
17 #include "Media/Audio/AudioPlayer.h" | 17 #include "Media/Audio/AudioPlayer.h" |
18 #include "Media/Audio/AIL.h" | |
18 | 19 |
19 #include "Game/MainMenu.h" | 20 #include "Game/MainMenu.h" |
20 #include "Game/MainMenuLoad.h" | 21 #include "Game/MainMenuLoad.h" |
21 | 22 |
22 | 23 |
352 } while (pMessageQueue_50CBD0->uNumMessages); | 353 } while (pMessageQueue_50CBD0->uNumMessages); |
353 } | 354 } |
354 } | 355 } |
355 | 356 |
356 | 357 |
358 static bool first_initialization = true; | |
357 //----- (004627B7) -------------------------------------------------------- | 359 //----- (004627B7) -------------------------------------------------------- |
358 void MainMenu_Loop() | 360 void MainMenu_Loop() |
359 { | 361 { |
360 GUIButton *pButton; // eax@27 | 362 GUIButton *pButton; // eax@27 |
361 unsigned int pControlParam; // ecx@35 | 363 unsigned int pControlParam; // ecx@35 |
362 unsigned int pY; // [sp-18h] [bp-54h]@39 | 364 unsigned int pY; // [sp-18h] [bp-54h]@39 |
363 Texture *pTexture; // [sp-14h] [bp-50h]@39 | 365 Texture *pTexture; // [sp-14h] [bp-50h]@39 |
364 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 | 366 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 |
365 MSG msg; | 367 MSG msg; |
366 | 368 |
369 | |
370 | |
371 if (first_initialization) | |
372 { | |
373 first_initialization = false; | |
374 | |
375 RGBTexture tex; // [sp+Ch] [bp-30h]@1 | |
376 tex.Load("mm6title.pcx", 2); | |
377 | |
378 pRenderer->ResetUIClipRect(); | |
379 pRenderer->BeginScene(); | |
380 { | |
381 pRenderer->DrawTextureNew(0, 0, &tex); | |
382 } | |
383 pRenderer->EndScene(); | |
384 pRenderer->Present(); | |
385 | |
386 tex.Release(); | |
387 | |
388 MainMenuUI_LoadFontsAndSomeStuff(); | |
389 | |
390 pRenderer->BeginScene(); | |
391 { | |
392 DrawMM7CopyrightWindow(); | |
393 } | |
394 pRenderer->EndScene(); | |
395 pRenderer->Present(); | |
396 | |
397 #ifdef NDEBUG | |
398 Sleep(1500); // let the copyright window stay for a while | |
399 #endif | |
400 | |
401 if (!bNoSound && pAudioPlayer->hAILRedbook) | |
402 { | |
403 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8 | |
404 unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8 | |
405 | |
406 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0)); | |
407 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
408 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &uTrackStartMS, &uTrackEndMS); | |
409 AIL_redbook_play(pAudioPlayer->hAILRedbook, uTrackStartMS + 1, uTrackEndMS); | |
410 } | |
411 | |
412 SecondaryInitialization(); | |
413 FinalInitialization(); | |
414 } | |
415 | |
416 | |
367 current_screen_type = SCREEN_GAME; | 417 current_screen_type = SCREEN_GAME; |
368 | 418 |
369 pGUIWindow2 = 0; | 419 pGUIWindow2 = 0; |
370 pAudioPlayer->StopChannels(-1, -1); | 420 pAudioPlayer->StopChannels(-1, -1); |
371 pMouse->RemoveHoldingItem(); | 421 pMouse->RemoveHoldingItem(); |
413 WaitMessage(); | 463 WaitMessage(); |
414 continue; | 464 continue; |
415 } | 465 } |
416 | 466 |
417 pRenderer->BeginScene(); | 467 pRenderer->BeginScene(); |
418 pRenderer->DrawTextureNew(0, 0, &main_menu_background); | 468 { |
419 | 469 pRenderer->DrawTextureNew(0, 0, &main_menu_background); |
420 MainMenu_EventLoop(); | 470 |
421 GUI_UpdateWindows(); | 471 MainMenu_EventLoop(); |
422 | 472 GUI_UpdateWindows(); |
473 } | |
423 pRenderer->EndScene(); | 474 pRenderer->EndScene(); |
424 pRenderer->Present(); | 475 pRenderer->Present(); |
425 } | 476 } |
426 | 477 |
427 MainMenu_EventLoop(); | |
428 pRenderer->BeginScene(); | 478 pRenderer->BeginScene(); |
429 GUI_UpdateWindows(); | 479 { |
480 MainMenu_EventLoop(); | |
481 GUI_UpdateWindows(); | |
482 } | |
430 pRenderer->EndScene(); | 483 pRenderer->EndScene(); |
431 pRenderer->Present(); | 484 pRenderer->Present(); |
485 | |
432 main_menu_background.Release(); | 486 main_menu_background.Release(); |
433 /*if (pGUIWindow2) | 487 /*if (pGUIWindow2) |
434 { | 488 { |
435 pGUIWindow2->Release(); | 489 pGUIWindow2->Release(); |
436 pGUIWindow2 = 0; | 490 pGUIWindow2 = 0; |
437 }*/ | 491 }*/ |
438 pWindow_MainMenu->Release(); | 492 pWindow_MainMenu->Release(); |
493 pWindow_MainMenu = nullptr; | |
494 | |
439 pIcons_LOD->RemoveTexturesPackFromTextureList(); | 495 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
440 } | 496 } |