comparison mm7_2.cpp @ 951:840b78f6c2d3

Слияние
author Ritor1
date Wed, 01 May 2013 23:36:54 +0600
parents c0d0656aa662
children a92a34f9aef5
comparison
equal deleted inserted replaced
950:5e87b0c3f939 951:840b78f6c2d3
288 288
289 uDialogueType = 83; 289 uDialogueType = 83;
290 pDialogueWindow->Release(); 290 pDialogueWindow->Release();
291 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0); 291 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0);
292 pBtn_ExitCancel = pDialogueWindow->CreateButton(471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" 292 pBtn_ExitCancel = pDialogueWindow->CreateButton(471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel"
293 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); 293 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
294 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); 294 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
295 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, UIMSG_0, 0x53u, 0, "", 0); 295 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, UIMSG_0, 0x53u, 0, "", 0);
296 pDialogueWindow->_41D08F(1, 1, 0, 2); 296 pDialogueWindow->_41D08F(1, 1, 0, 2);
297 dialog_menu_id = HOUSE_DIALOGUE_OTHER; 297 dialog_menu_id = HOUSE_DIALOGUE_OTHER;
298 v0 = (int)((char *)window_SpeakInHouse->ptr_1C - 102); 298 v0 = (int)((char *)window_SpeakInHouse->ptr_1C - 102);
431 } 431 }
432 pDialogueWindow->pControlsHead = 0; 432 pDialogueWindow->pControlsHead = 0;
433 pDialogueWindow->pControlsTail = 0; 433 pDialogueWindow->pControlsTail = 0;
434 pDialogueWindow->uNumControls = 0; 434 pDialogueWindow->uNumControls = 0;
435 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 435 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79],
436 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); 436 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
437 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x55u, 0, "", 0); 437 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x55u, 0, "", 0);
438 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x56u, 0, "", 0); 438 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x56u, 0, "", 0);
439 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x57u, 0, "", 0); 439 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x57u, 0, "", 0);
440 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x58u, 0, "", 0); 440 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x58u, 0, "", 0);
441 pDialogueWindow->_41D08F(4, 1, 0, 1); 441 pDialogueWindow->_41D08F(4, 1, 0, 1);
576 pViewport->uViewportTL_Y, 576 pViewport->uViewportTL_Y,
577 pViewport->uViewportBR_X - pViewport->uViewportTL_X, 577 pViewport->uViewportBR_X - pViewport->uViewportTL_X,
578 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, 578 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
579 pRenderer->uTargetGMask | pRenderer->uTargetBMask); 579 pRenderer->uTargetGMask | pRenderer->uTargetBMask);
580 580
581 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr); 581 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
582 pRenderer->_4A6A68( 582 pRenderer->_4A6A68(8, 352 - v0, pTex, pTex->uTextureHeight - v0);
583 8u,
584 352 - v0,
585 pTex,
586 (pTex ? pTex->uTextureHeight : 26) - v0);
587 583
588 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428); 584 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
589 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0); 585 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);
590 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0); 586 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
591 pRenderer->EndScene(); 587 pRenderer->EndScene();
768 } 764 }
769 ItemGen * item_spellbook = &pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i]; 765 ItemGen * item_spellbook = &pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i];
770 item_spellbook->Reset(); 766 item_spellbook->Reset();
771 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].uItemID = pItemNum; 767 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].uItemID = pItemNum;
772 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].Identified(); 768 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].Identified();
773 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[pItemNum].pIconName, TEXTURE_16BIT_PALETTE)]; 769 ItemsInShopTexture[i] = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[pItemNum].pIconName, TEXTURE_16BIT_PALETTE);
774 } 770 }
775 return; 771 return;
776 } 772 }
777 773
778 //----- (004BCA33) -------------------------------------------------------- 774 //----- (004BCA33) --------------------------------------------------------
5527 if ( a1 < 67 ) 5523 if ( a1 < 67 )
5528 { 5524 {
5529 v4 = 255; 5525 v4 = 255;
5530 v1 = 15; 5526 v1 = 15;
5531 v2 = 235; 5527 v2 = 235;
5532 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4); 5528 return TargetColor(v2, v1, v4);
5533 } 5529 }
5534 goto LABEL_21; 5530 goto LABEL_21;
5535 } 5531 }
5536 LABEL_15: 5532 LABEL_15:
5537 if ( a1 < 56 ) 5533 if ( a1 < 56 )
5547 v2 = 128; 5543 v2 = 128;
5548 LABEL_13: 5544 LABEL_13:
5549 v4 = v2; 5545 v4 = v2;
5550 LABEL_30: 5546 LABEL_30:
5551 v1 = v2; 5547 v1 = v2;
5552 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4); 5548 return TargetColor(v2, v1, v4);
5553 } 5549 }
5554 goto LABEL_15; 5550 goto LABEL_15;
5555 } 5551 }
5556 LABEL_8: 5552 LABEL_8:
5557 if ( a1 < 34 ) 5553 if ( a1 < 34 )
5558 { 5554 {
5559 v4 = 255; 5555 v4 = 255;
5560 v1 = 128; 5556 v1 = 128;
5561 LABEL_32: 5557 LABEL_32:
5562 v2 = 0; 5558 v2 = 0;
5563 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4); 5559 return TargetColor(v2, v1, v4);
5564 } 5560 }
5565 goto LABEL_11; 5561 goto LABEL_11;
5566 } 5562 }
5567 } 5563 }
5568 else 5564 else
5571 { 5567 {
5572 v4 = 0; 5568 v4 = 0;
5573 v1 = 85; 5569 v1 = 85;
5574 LABEL_23: 5570 LABEL_23:
5575 v2 = 255; 5571 v2 = 255;
5576 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4); 5572 return TargetColor(v2, v1, v4);
5577 } 5573 }
5578 } 5574 }
5579 if ( a1 >= 23 ) 5575 if ( a1 >= 23 )
5580 goto LABEL_8; 5576 goto LABEL_8;
5581 v4 = 255; 5577 v4 = 255;
5582 v1 = 212; 5578 v1 = 212;
5583 v2 = 150; 5579 v2 = 150;
5584 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4); 5580 return TargetColor(v2, v1, v4);
5585 } 5581 }
5586 5582
5587 //----- (004583B0) -------------------------------------------------------- 5583 //----- (004583B0) --------------------------------------------------------
5588 LevelDecoration::LevelDecoration() 5584 LevelDecoration::LevelDecoration()
5589 { 5585 {
6648 6644
6649 pIcons_LOD->_inlined_sub2(); 6645 pIcons_LOD->_inlined_sub2();
6650 6646
6651 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 6647 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
6652 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); 6648 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
6653 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0,
6654 UIMSG_MainMenu_ShowPartyCreationWnd, 0, 78, "", pNew, 0);
6655 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); 6649 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
6656 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0,
6657 UIMSG_MainMenu_ShowLoadWindow, 1, 76, "", pLoad, 0);
6658 auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); 6650 auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
6659 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0,
6660 UIMSG_ShowCredits, 2, 67, "", pCredits, 0);
6661 auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); 6651 auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
6662 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, 6652
6663 UIMSG_ExitToWindows, 3, 0, "", pExit, 0); 6653 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0);
6654 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", pLoad, 0);
6655 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0, UIMSG_ShowCredits, 2, 'C', "", pCredits, 0);
6656 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 3, 0, "", pExit, 0);
6657
6664 pTexture_PCX.Release(); 6658 pTexture_PCX.Release();
6665 pTexture_PCX.Load("title.pcx", 0); 6659 pTexture_PCX.Load("title.pcx", 0);
6666 SetCurrentMenuID(MENU_MAIN); 6660 SetCurrentMenuID(MENU_MAIN);
6667 SetForegroundWindow(hWnd); 6661 SetForegroundWindow(hWnd);
6668 SendMessageW(hWnd, WM_ACTIVATEAPP, 1, 0); 6662 SendMessageW(hWnd, WM_ACTIVATEAPP, 1, 0);
6825 6819
6826 case WM_COMMAND: 6820 case WM_COMMAND:
6827 { 6821 {
6828 switch (wParam) 6822 switch (wParam)
6829 { 6823 {
6830 case 101: 6824 case 103: pRenderer->SavePCXScreenshot(); return 0;
6825
6826 case 101: // Quit game
6831 case 40001: 6827 case 40001:
6832 { 6828 {
6833 v38 = 0; 6829 v38 = 0;
6834 v37 = 0; 6830 v37 = 0;
6835 v36 = 2; 6831 v36 = 2;
6836 v35 = ::hWnd; 6832 v35 = ::hWnd;
6837 SendMessageA(::hWnd, WM_DESTROY, v37, v38); 6833 SendMessageA(::hWnd, WM_DESTROY, v37, v38);
6838 } 6834 }
6839 return 0; 6835 return 0;
6840 6836
6841 case 103:
6842 pRenderer->SavePCXScreenshot();
6843 return 0;
6844 6837
6845 case 104: 6838 case 104:
6846 pRenderer->ChangeBetweenWinFullscreenModes(); 6839 pRenderer->ChangeBetweenWinFullscreenModes();
6847 if ( pArcomageGame->bGameInProgress ) 6840 if ( pArcomageGame->bGameInProgress )
6848 pArcomageGame->field_F6 = 1; 6841 pArcomageGame->field_F6 = 1;
6849 return 0; 6842 return 0;
6850 6843
6851 case 40007: 6844 case 40007: pParty->SetGold(pParty->uNumGold + 10000); return 0;
6852 pParty->SetGold(pParty->uNumGold + 10000); 6845 case 40008: GivePartyExp(20000); return 0;
6853 return 0; 6846 case 40013: pParty->SetGold(0); return 0;
6854
6855 case 40008:
6856 GivePartyExp(20000);
6857 return 0;
6858
6859 case 40013:
6860 pParty->SetGold(0);
6861 return 0;
6862 6847
6863 case 40059: 6848 case 40059:
6864 for (uint i = 0; i < 4; ++i) 6849 for (uint i = 0; i < 4; ++i)
6865 pParty->pPlayers[i].uSkillPoints = 50; 6850 pParty->pPlayers[i].uSkillPoints = 50;
6866 return 0; 6851 return 0;
6867 6852
6868 case 40044://condition Afraid/fear 6853 case 40029: pPlayers[uActiveCharacter]->SetPertified(true); return 0;
6869 pPlayers[uActiveCharacter]->pConditions[3] = 1; 6854 case 40030: pPlayers[uActiveCharacter]->SetWeak(true); return 0;
6870 return 0; 6855 case 40031: pPlayers[uActiveCharacter]->SetPoison3(true); return 0;
6871 6856 case 40032: pPlayers[uActiveCharacter]->SetPoison2(true); return 0;
6872 case 40043://condition Asleep 6857 case 40033: pPlayers[uActiveCharacter]->SetPoison1(true); return 0;
6873 pPlayers[uActiveCharacter]->pConditions[2] = 1; 6858 case 40034: pPlayers[uActiveCharacter]->SetDisease3(true); return 0;
6874 return 0; 6859 case 40035: pPlayers[uActiveCharacter]->SetDisease2(true); return 0;
6875 6860 case 40036: pPlayers[uActiveCharacter]->SetDisease1(true); return 0;
6876 case 40037://condition Curse 6861 case 40037: pPlayers[uActiveCharacter]->SetCursed(true); return 0;
6877 pPlayers[uActiveCharacter]->pConditions[0] = 1; 6862 case 40038: pPlayers[uActiveCharacter]->SetInsane(true); return 0;
6878 return 0; 6863 case 40039: pPlayers[uActiveCharacter]->SetDrunk(true); return 0;
6879 6864 case 40040: pPlayers[uActiveCharacter]->SetUnconcious(true); return 0;
6880 case 40036://condition Disease1 6865 case 40041: pPlayers[uActiveCharacter]->SetDead(true); return 0;
6881 pPlayers[uActiveCharacter]->pConditions[7] = 1; 6866 case 40042: pPlayers[uActiveCharacter]->SetEradicated(true); return 0;
6882 return 0; 6867 case 40043: pPlayers[uActiveCharacter]->SetAsleep(true); return 0;
6883 6868 case 40044: pPlayers[uActiveCharacter]->SetAfraid(true); return 0;
6884 case 40035://condition Disease2 6869 case 40045: pPlayers[uActiveCharacter]->SetParalyzed(true); return 0;
6885 pPlayers[uActiveCharacter]->pConditions[9] = 1; 6870 case 40073: pPlayers[uActiveCharacter]->SetZombie(true); return 0;
6886 return 0;
6887
6888 case 40034://condition Disease3
6889 pPlayers[uActiveCharacter]->pConditions[11] = 1;
6890 return 0;
6891
6892 case 40041://condition Dead
6893 pPlayers[uActiveCharacter]->pConditions[14] = 1;
6894 return 0;
6895
6896 case 40039://condition Drunk
6897 pPlayers[uActiveCharacter]->pConditions[4] = 1;
6898 return 0;
6899
6900 case 40042://condition Eradicated
6901 pPlayers[uActiveCharacter]->pConditions[16] = 1;
6902 return 0;
6903
6904 case 40038://condition Isane
6905 pPlayers[uActiveCharacter]->pConditions[5] = 1;
6906 return 0;
6907
6908 case 40045://condition Paralized
6909 pPlayers[uActiveCharacter]->pConditions[12] = 1;
6910 return 0;
6911
6912 case 40033://condition Poison1
6913 pPlayers[uActiveCharacter]->pConditions[6] = 1;
6914 return 0;
6915
6916 case 40032://condition Poison2
6917 pPlayers[uActiveCharacter]->pConditions[8] = 1;
6918 return 0;
6919
6920 case 40031://condition Poison3
6921 pPlayers[uActiveCharacter]->pConditions[10] = 1;
6922 return 0;
6923
6924 case 40029://condition Stone
6925 pPlayers[uActiveCharacter]->pConditions[15] = 1;
6926 return 0;
6927
6928 case 40040://condition Unconscious
6929 pPlayers[uActiveCharacter]->pConditions[13] = 1;
6930 return 0;
6931
6932 case 40030://condition Weak
6933 pPlayers[uActiveCharacter]->pConditions[1] = 1;
6934 return 0;
6935
6936 case 40073://condition Zombie
6937 pPlayers[uActiveCharacter]->pConditions[17] = 1;
6938 return 0;
6939
6940 } 6871 }
6941 } 6872 }
6942 return DefWindowProcA(hWnd, Msg, wParam, lParam); 6873 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6943 }; 6874 };
6944 6875
9942 a1.uFrameY += 12; 9873 a1.uFrameY += 12;
9943 a1.uFrameHeight -= 12; 9874 a1.uFrameHeight -= 12;
9944 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; 9875 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
9945 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; 9876 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
9946 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; 9877 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName;
9947 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 9878 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
9948 sprintf(pTmpBuf, format_4E2D80, v2, v1); 9879 sprintf(pTmpBuf, format_4E2D80, v2, v1);
9949 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); 9880 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
9950 return a1.DrawText( 9881 return a1.DrawText(
9951 pFontSmallnum, 9882 pFontSmallnum,
9952 1, 9883 1,