Mercurial > mm7
comparison mm7_2.cpp @ 1028:fbde7d8fcdb1
Merge
author | Nomad |
---|---|
date | Tue, 21 May 2013 11:24:35 +0200 |
parents | 67e33708d815 |
children | 7735bdb3c30f |
comparison
equal
deleted
inserted
replaced
1027:5aba2a5047c4 | 1028:fbde7d8fcdb1 |
---|---|
1 #include <io.h> | 1 #include <io.h> |
2 #include <direct.h> | 2 #include <direct.h> |
3 #include <assert.h> | 3 #include <assert.h> |
4 | 4 #include <windows.h> |
5 | |
6 | |
7 #include "VideoPlayer.h" | |
8 #include "Sprites.h" | |
9 #include "BSPModel.h" | |
10 #include "OutdoorCamera.h" | |
11 | |
12 #include "LightmapBuilder.h" | |
13 #include "DecalBuilder.h" | |
14 #include "ParticleEngine.h" | |
15 #include "Mouse.h" | |
16 #include "Keyboard.h" | |
17 #include "CShow.h" | |
18 #include "GammaControl.h" | |
19 #include "stru6.h" | |
20 | |
21 #include "Vis.h" | |
5 #include "MapInfo.h" | 22 #include "MapInfo.h" |
6 #include "Game.h" | 23 #include "Game.h" |
7 #include "GUIWindow.h" | 24 #include "GUIWindow.h" |
8 #include "GUIFont.h" | 25 #include "GUIFont.h" |
9 #include "Party.h" | 26 #include "Party.h" |
10 #include "AudioPlayer.h" | 27 #include "AudioPlayer.h" |
11 #include "Outdoor.h" | 28 #include "Outdoor.h" |
12 #include "IndoorCamera.h" | 29 #include "IndoorCamera.h" |
13 #include "Overlays.h" | 30 #include "Overlays.h" |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | 31 #include "Arcomage.h" |
16 #include "LOD.h" | 32 #include "LOD.h" |
17 #include "Actor.h" | 33 #include "Actor.h" |
18 #include "Allocator.h" | 34 #include "Allocator.h" |
19 #include "Events.h" | 35 #include "Events.h" |
30 #include "stru176.h" | 46 #include "stru176.h" |
31 #include "Time.h" | 47 #include "Time.h" |
32 #include "IconFrameTable.h" | 48 #include "IconFrameTable.h" |
33 #include "GUIProgressBar.h" | 49 #include "GUIProgressBar.h" |
34 #include "Bink_Smacker.h" | 50 #include "Bink_Smacker.h" |
35 #include "TileFrameTable.h" | |
36 #include "PlayerFrameTable.h" | 51 #include "PlayerFrameTable.h" |
37 #include "Awards.h" | |
38 #include "Autonotes.h" | |
39 #include "stru160.h" | |
40 #include "TurnEngine.h" | 52 #include "TurnEngine.h" |
41 #include "FactionTable.h" | 53 #include "FactionTable.h" |
42 #include "StorylineTextTable.h" | 54 #include "StorylineTextTable.h" |
43 #include "Random.h" | 55 #include "Random.h" |
44 #include "CastSpellInfo.h" | 56 #include "CastSpellInfo.h" |
45 #include "stru298.h" | 57 #include "stru298.h" |
46 #include "stru12.h" | |
47 #include "Events2D.h" | 58 #include "Events2D.h" |
48 #include "stru159.h" | |
49 #include "Log.h" | 59 #include "Log.h" |
50 #include "UIHouses.h" | 60 #include "UIHouses.h" |
51 #include "texts.h" | 61 #include "texts.h" |
52 #include "mm7_data.h" | 62 #include "mm7_data.h" |
53 #include "MM7.h" | 63 #include "MM7.h" |
852 } | 862 } |
853 pDialogueNPCCount = 0; | 863 pDialogueNPCCount = 0; |
854 pDialogueWindow->Release(); | 864 pDialogueWindow->Release(); |
855 dialog_menu_id = HOUSE_DIALOGUE_NULL; | 865 dialog_menu_id = HOUSE_DIALOGUE_NULL; |
856 pDialogueWindow = 0; | 866 pDialogueWindow = 0; |
857 pIcons_LOD->_40F9C5(); | 867 pIcons_LOD->SyncLoadedFilesCount(); |
858 v1 = uNumDialogueNPCPortraits; | 868 v1 = uNumDialogueNPCPortraits; |
859 if ( uNumDialogueNPCPortraits != 1 ) | 869 if ( uNumDialogueNPCPortraits != 1 ) |
860 { | 870 { |
861 v2 = 0; | 871 v2 = 0; |
862 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; | 872 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; |
938 { | 948 { |
939 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2); | 949 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2); |
940 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | 950 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); |
941 return; | 951 return; |
942 } | 952 } |
943 taken_item = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, bought_item->uItemID); | 953 taken_item = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); |
944 if ( taken_item ) | 954 if ( taken_item ) |
945 { | 955 { |
946 bought_item->SetIdentified(); | 956 bought_item->SetIdentified(); |
947 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[taken_item - 1], bought_item, 0x24u); | 957 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[taken_item - 1], bought_item, 0x24u); |
948 dword_F8B1E4 = 1; | 958 dword_F8B1E4 = 1; |
1096 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | 1106 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" |
1097 return; | 1107 return; |
1098 } | 1108 } |
1099 } | 1109 } |
1100 } | 1110 } |
1101 v39 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, bought_item->uItemID); | 1111 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); |
1102 if ( v39 ) | 1112 if ( v39 ) |
1103 { | 1113 { |
1104 bought_item->SetIdentified(); | 1114 bought_item->SetIdentified(); |
1105 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1], bought_item, sizeof(ItemGen)); | 1115 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1], bought_item, sizeof(ItemGen)); |
1106 if ( pPlayers[uActiveCharacter]->CanSteal() ) | 1116 if ( pPlayers[uActiveCharacter]->CanSteal() ) |
9922 } | 9932 } |
9923 } | 9933 } |
9924 } | 9934 } |
9925 | 9935 |
9926 //----- (00467F48) -------------------------------------------------------- | 9936 //----- (00467F48) -------------------------------------------------------- |
9927 void __fastcall sub_467F48(signed int a1) | 9937 void CreateMsgScrollWindow( signed int mscroll_id ) |
9928 { | 9938 { |
9929 signed int v1; // esi@1 | 9939 signed int v1; // esi@1 |
9930 | 9940 |
9931 v1 = a1; | 9941 v1 = mscroll_id; |
9932 if ( !pGUIWindow_ScrollWindow && a1 >= 700 ) | 9942 if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) |
9933 { | 9943 { |
9934 if ( a1 <= 782 ) | 9944 if ( mscroll_id <= 782 ) |
9935 { | 9945 { |
9936 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); | 9946 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); |
9937 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); | 9947 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); |
9938 } | 9948 } |
9939 } | 9949 } |
9949 pGUIWindow_ScrollWindow = 0; | 9959 pGUIWindow_ScrollWindow = 0; |
9950 } | 9960 } |
9951 } | 9961 } |
9952 | 9962 |
9953 //----- (00467FB6) -------------------------------------------------------- | 9963 //----- (00467FB6) -------------------------------------------------------- |
9954 char __cdecl CreateScrollWindow() | 9964 void CreateScrollWindow() |
9955 { | 9965 { |
9956 unsigned int v0; // eax@1 | 9966 unsigned int v0; // eax@1 |
9957 char *v1; // ST18_4@3 | 9967 char *v1; // ST18_4@3 |
9958 unsigned int v2; // eax@3 | 9968 unsigned int v2; // eax@3 |
9959 GUIWindow a1; // [sp+Ch] [bp-54h]@1 | 9969 GUIWindow a1; // [sp+Ch] [bp-54h]@1 |
9960 | 9970 |
9983 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | 9993 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; |
9984 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | 9994 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; |
9985 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | 9995 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
9986 sprintf(pTmpBuf, format_4E2D80, v2, v1); | 9996 sprintf(pTmpBuf, format_4E2D80, v2, v1); |
9987 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); | 9997 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); |
9988 return a1.DrawText( | 9998 a1.DrawText( |
9989 pFontSmallnum, | 9999 pFontSmallnum, |
9990 1, | 10000 1, |
9991 LOBYTE(pFontCreate->uFontHeight) - 3, | 10001 LOBYTE(pFontCreate->uFontHeight) - 3, |
9992 0, | 10002 0, |
9993 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], | 10003 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], |