comparison mm7_2.cpp @ 165:572d821561f3

MenuID
author Ritor1
date Thu, 14 Feb 2013 14:48:43 +0600
parents 3a8e7802f241
children d1dde383af89
comparison
equal deleted inserted replaced
164:4b61b82a0bf7 165:572d821561f3
4398 if ( uNumDialogueNPCPortraits > 0 ) 4398 if ( uNumDialogueNPCPortraits > 0 )
4399 { 4399 {
4400 v3 = byte_591180; 4400 v3 = byte_591180;
4401 do 4401 do
4402 { 4402 {
4403 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton( 4403 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6),
4404 *(&_4E5E50_transui_x + v2 + 6 * v1 - 6), 4404 0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0);
4405 *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
4406 0x3Fu,
4407 0x49u,
4408 1,
4409 0,
4410 0x19Au,
4411 v2,
4412 0,
4413 v3,
4414 0,
4415 0,
4416 0);
4417 v1 = uNumDialogueNPCPortraits; 4405 v1 = uNumDialogueNPCPortraits;
4418 ++v2; 4406 ++v2;
4419 v3 += 100; 4407 v3 += 100;
4420 } 4408 }
4421 while ( (signed int)v2 < uNumDialogueNPCPortraits ); 4409 while ( (signed int)v2 < uNumDialogueNPCPortraits );
5099 pAudioPlayer->StopChannels(-1, -1); 5087 pAudioPlayer->StopChannels(-1, -1);
5100 pRenderer->BeginScene(); 5088 pRenderer->BeginScene();
5101 pRenderer->ClearBlack(); 5089 pRenderer->ClearBlack();
5102 pRenderer->EndScene(); 5090 pRenderer->EndScene();
5103 pRenderer->Present(); 5091 pRenderer->Present();
5104 pVideoPlayer->field_40 = 0; 5092 pVideoPlayer->pResetflag = 0;
5105 _449B57_test_bit(pParty->_award_bits, 99); 5093 _449B57_test_bit(pParty->_award_bits, 99);
5106 _this.Load("winbg.pcx", 2); 5094 _this.Load("winbg.pcx", 2);
5107 pRenderer->BeginScene(); 5095 pRenderer->BeginScene();
5108 pRenderer->DrawTextureRGB(0, 0, &_this); 5096 pRenderer->DrawTextureRGB(0, 0, &_this);
5109 pRenderer->EndScene(); 5097 pRenderer->EndScene();
11437 v1 = 255; 11425 v1 = 255;
11438 a4 = a1; 11426 a4 = a1;
11439 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); 11427 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
11440 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); 11428 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
11441 pRenderer->BeginScene(); 11429 pRenderer->BeginScene();
11442 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD ) 11430 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOADINGPROC )
11443 { 11431 {
11444 pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0); 11432 pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0);
11445 if ( a4 ) 11433 if ( a4 )
11446 { 11434 {
11447 v2 = uTextureID_save_up; 11435 v2 = uTextureID_save_up;
11540 else 11528 else
11541 { 11529 {
11542 if ( pGUIWindow_CurrentMenu->field_40 == 3 ) 11530 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
11543 pGUIWindow_CurrentMenu->field_40 = 0; 11531 pGUIWindow_CurrentMenu->field_40 = 0;
11544 } 11532 }
11545 if (GetCurrentMenuID() == MENU_LOAD) 11533 if (GetCurrentMenuID() == MENU_LOADINGPROC)
11546 { 11534 {
11547 //v18 = pGlobalTXT_LocalizationStrings[135]; 11535 //v18 = pGlobalTXT_LocalizationStrings[135];
11548 v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"Загрузка" 11536 v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"Загрузка"
11549 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0); 11537 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0);
11550 v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot); 11538 v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot);
12047 pAudioPlayer->StopChannels(-1, -1); 12035 pAudioPlayer->StopChannels(-1, -1);
12048 pMouse->RemoveHoldingItem(); 12036 pMouse->RemoveHoldingItem();
12049 ++pIcons_LOD->uTexturePacksCount; 12037 ++pIcons_LOD->uTexturePacksCount;
12050 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 12038 if ( !pIcons_LOD->uNumPrevLoadedFiles )
12051 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 12039 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
12052 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); // создание окна 12040 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
12053 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); // создание кнопок 12041 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
12054 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, 12042 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0,
12055 UIMSG_MainMenu_ShowPartyCreationWnd, 0, 78, "", pNew, 0); 12043 UIMSG_MainMenu_ShowPartyCreationWnd, 0, 78, "", pNew, 0);
12056 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); 12044 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
12057 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, 12045 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0,
12058 UIMSG_MainMenu_ShowLoadWindow, 1, 76, "", pLoad, 0); 12046 UIMSG_MainMenu_ShowLoadWindow, 1, 76, "", pLoad, 0);
12070 while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) 12058 while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD)
12071 { 12059 {
12072 POINT pt; 12060 POINT pt;
12073 pMouse->GetCursorPos(&pt); 12061 pMouse->GetCursorPos(&pt);
12074 pWindow = pWindow_MainMenu; 12062 pWindow = pWindow_MainMenu;
12075 if ( GetCurrentMenuID() == MENU_SAVELOAD)//если меню загрузки 12063 if ( GetCurrentMenuID() == MENU_SAVELOAD)
12076 { 12064 {
12077 if ( pCurrentScreen != SCREEN_LOADGAME ) 12065 if ( pCurrentScreen != SCREEN_LOADGAME )
12078 { 12066 {
12079 pTexture_PCX.Release(); 12067 pTexture_PCX.Release();
12080 pTexture_PCX.Load("lsave640.pcx", 0); 12068 pTexture_PCX.Load("lsave640.pcx", 0);
12081 pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 12069 pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
12082 pCurrentScreen = SCREEN_LOADGAME; 12070 pCurrentScreen = SCREEN_LOADGAME;
12083 GameUI_DrawLoadMenu(0);//процесс прорисовки окна Загрузка 12071 GameUI_DrawLoadMenu(0);
12084 } 12072 }
12085 pWindow = pGUIWindow_CurrentMenu; 12073 pWindow = pGUIWindow_CurrentMenu;
12086 } 12074 }
12087 12075
12088 MSG msg; 12076 MSG msg;
12089 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )//ожидание сообщения из внешнего источника 12077 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
12090 { 12078 {
12091 if (msg.message == WM_QUIT) 12079 if (msg.message == WM_QUIT)
12092 Game_DeinitializeAndTerminate(0); 12080 Game_DeinitializeAndTerminate(0);
12093 TranslateMessage(&msg); 12081 TranslateMessage(&msg);
12094 DispatchMessageA(&msg); 12082 DispatchMessageA(&msg);
12101 { 12089 {
12102 pRenderer->BeginScene(); 12090 pRenderer->BeginScene();
12103 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); 12091 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
12104 if (pAsyncMouse) 12092 if (pAsyncMouse)
12105 pAsyncMouse->_46B736_consume_click_lists(1); 12093 pAsyncMouse->_46B736_consume_click_lists(1);
12106 GUI_MainMenuMessageProc();//процедура проверки сообщений поступающих из внешних устройств для всей группы вступительных окон 12094 GUI_MainMenuMessageProc();
12107 GUI_UpdateWindows(); 12095 GUI_UpdateWindows();
12108 if (pAsyncMouse) 12096 if (pAsyncMouse)
12109 pAsyncMouse->_46B736_consume_click_lists(1); 12097 pAsyncMouse->_46B736_consume_click_lists(1);
12110 if (GetCurrentMenuID() != MENU_MAIN)// если не Главное меню 12098 if (GetCurrentMenuID() != MENU_MAIN)
12111 { 12099 {
12112 if (GetCurrentMenuID() == MENU_LOAD)// если меню Загрузка 12100 if (GetCurrentMenuID() == MENU_LOADINGPROC)
12113 { 12101 {
12114 pIcons_LOD->_4114F2(); 12102 pIcons_LOD->_4114F2();
12115 pGUIWindow_CurrentMenu->Release(); 12103 pGUIWindow_CurrentMenu->Release();
12116 pGUIWindow_CurrentMenu = 0; 12104 pGUIWindow_CurrentMenu = 0;
12117 pCurrentScreen = SCREEN_GAME; 12105 pCurrentScreen = SCREEN_GAME;
13975 FinalInitialization(); 13963 FinalInitialization();
13976 13964
13977 Log::Warning(L"MM: entering main loop"); 13965 Log::Warning(L"MM: entering main loop");
13978 while ( 1 ) 13966 while ( 1 )
13979 { 13967 {
13980 MainMenu_Loop(); // прорисовка Главного меню и тут же прорисовка меню Загрузка 13968 MainMenu_Loop();
13981 uGameState = 0; 13969 uGameState = 0;
13982 //LABEL_21: 13970 //LABEL_21:
13983 while ( 1 ) 13971 while ( 1 )
13984 { 13972 {
13985 switch (uGameState) 13973 switch (uGameState)
13986 { 13974 {
13987 case GAME_FINISHED: // выход из игры 13975 case GAME_FINISHED:
13988 pGame->Deinitialize(); 13976 pGame->Deinitialize();
13989 return true; // выход из функции MM_Main в Win_Main 13977 return true;
13990 } 13978 }
13991 if (GetCurrentMenuID() == MENU_FINISHED) // меню Выход 13979 if (GetCurrentMenuID() == MENU_FINISHED)
13992 { 13980 {
13993 uGameState = GAME_FINISHED; 13981 uGameState = GAME_FINISHED;
13994 continue; // в начало цикла 13982 continue;
13995 } 13983 }
13996 if (GetCurrentMenuID() == MENU_NEWGAME) // меню Новая игра 13984 if (GetCurrentMenuID() == MENU_NEWGAME)
13997 { 13985 {
13998 if ( pAudioPlayer->hAILRedbook ) 13986 if ( pAudioPlayer->hAILRedbook )
13999 AIL_redbook_stop(pAudioPlayer->hAILRedbook); // остановить музыку 13987 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
14000 pParty->Reset(); // сброс группы 13988 pParty->Reset();
14001 for (uint k = 0; k < 50; ++k) 13989 for (uint k = 0; k < 50; ++k)
14002 pOtherOverlayList->pOverlays[k].Reset(); 13990 pOtherOverlayList->pOverlays[k].Reset();
14003 strcpy(pCurrentMapName, pStartingMapName); // текущая карта 13991 strcpy(pCurrentMapName, pStartingMapName);
14004 pParty->CreateDefaultParty(0); // создать группу по умолчанию 13992 pParty->CreateDefaultParty(0);
14005 PlayerCreationUI_Initialize(); 13993 PlayerCreationUI_Initialize();
14006 if ( PlayerCreationUI_Loop() ) //процесс создания группы 13994 if ( PlayerCreationUI_Loop() )
14007 { 13995 {
14008 DeleteCCharFont(); 13996 DeleteCCharFont();
14009 break;// выход из цикла 13997 break;
14010 } 13998 }
14011 DeleteCCharFont(); 13999 DeleteCCharFont();
14012 bFlashQuestBook = true; 14000 bFlashQuestBook = true;
14013 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0); //заставка 14001 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);
14014 Autosave(); //автосохранение 14002 Autosave();
14015 //goto LABEL_48; 14003 pGame->Loop();
14016 pGame->Loop(); // процесс игры 14004 if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
14017 break; // выход из цикла 14005 {
14018 } 14006 SetCurrentMenuID(MENU_NEWGAME);
14019 if (GetCurrentMenuID() == MENU_CREDITS) // меню Создатели 14007 uGameState = 0;
14008 continue;
14009 }
14010 break;
14011 }
14012 if (GetCurrentMenuID() == MENU_CREDITS)
14020 { 14013 {
14021 if ( pAudioPlayer->hAILRedbook ) 14014 if ( pAudioPlayer->hAILRedbook )
14022 AIL_redbook_stop(pAudioPlayer->hAILRedbook);// отключить звук 14015 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
14023 extern MENU_STATE __cdecl CreditsMenu__Loop(); 14016 extern MENU_STATE __cdecl CreditsMenu__Loop();
14024 CreditsMenu__Loop(); // процесс воспроизведения окна Создатели 14017 CreditsMenu__Loop();
14025 break; 14018 break;
14026 } 14019 }
14027 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOAD) //??? неизвестно что это 14020 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOADINGPROC)
14028 { 14021 {
14029 uGameState = 0; 14022 uGameState = 0;
14030 } 14023 }
14031 else 14024 else
14032 __debugbreak(); 14025 __debugbreak();
14058 pAsyncMouse->Resume(); 14051 pAsyncMouse->Resume();
14059 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) 14052 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
14060 pAsyncKeyboard->Resume(); 14053 pAsyncKeyboard->Resume();
14061 }*/ 14054 }*/
14062 //LABEL_48: 14055 //LABEL_48:
14063 pGame->Loop(); //game 14056 pGame->Loop();
14064 LABEL_49: 14057 LABEL_49:
14065 if ( uGameState == 3 ) 14058 if ( uGameState == 3 )
14066 __debugbreak(); 14059 __debugbreak();
14067 /*{ 14060 /*{
14068 v12 = 5; 14061 v12 = 5;
14069 SetCurrentMenuID((MENU_STATE)v12); 14062 SetCurrentMenuID((MENU_STATE)v12);
14070 //goto LABEL_21; 14063 //goto LABEL_21;
14071 uGameState = 0; 14064 uGameState = 0;
14072 continue; 14065 continue;
14073 }*/ 14066 }*/
14074 if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )//press NewGame button out GameMenu window 14067 if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
14075 { 14068 {
14076 SetCurrentMenuID(MENU_NEWGAME); 14069 SetCurrentMenuID(MENU_NEWGAME);
14077 uGameState = 0; 14070 uGameState = 0;
14078 continue; 14071 continue;
14079 } 14072 }
14371 case MENU_CREDITS: return L"MENU_CREDITS"; 14364 case MENU_CREDITS: return L"MENU_CREDITS";
14372 case MENU_SAVELOAD: return L"MENU_SAVELOAD"; 14365 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
14373 case MENU_FINISHED: return L"MENU_FINISHED"; 14366 case MENU_FINISHED: return L"MENU_FINISHED";
14374 case MENU_5: return L"MENU_5"; 14367 case MENU_5: return L"MENU_5";
14375 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY"; 14368 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
14376 case MENU_7: return L"MENU_7"; 14369 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC";
14377 case MENU_Credits: return L"MENU_Credits"; 14370 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC";
14378 case MENU_LOAD: return L"MENU_LOAD"; 14371 case MENU_LOADINGPROC: return L"MENU_LOADINGPROC";
14379 case MENU_10: return L"MENU_10"; 14372 case MENU_10: return L"MENU_10";
14373 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE";
14380 default: return L"unk"; 14374 default: return L"unk";
14381 }; 14375 };
14382 }; 14376 };
14383 void SetCurrentMenuID(MENU_STATE uMenu) 14377 void SetCurrentMenuID(MENU_STATE uMenu)
14384 { 14378 {