annotate mm7_2.cpp @ 13:17150bdf321e

исправлено неполное воспроизведение роликов, бинков
author Серик@ПончиК
date Fri, 12 Oct 2012 21:18:16 +0600
parents 4acbadf78023
children 509744251c8e
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <io.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include <direct.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "GUIButton.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "GUIFont.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 #include "PaletteManager.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 #include "stru287.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 #include "stru157.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 #include "TileFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 #include "PlayerFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 #include "Awards.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 #include "Autonotes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #include "stru160.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #include "FactionTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 #include "StorylineTextTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 #include "Random.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 #include "stru277.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 #include "stru298.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 #include "stru12.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 #include "stru351.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 #include "Events2D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 #include "stru159.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 //----- (004B4F4F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 char *__cdecl sub_4B4F4F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 const char *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 const char *v1; // ST10_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 unsigned __int16 v2; // ST0C_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 GUIWindow v5; // [sp+8h] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 memcpy(&v5, ptr_507BC0, sizeof(v5));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 v0 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 v1 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 v5.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 v5.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v5.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 return v5.DrawText2(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 //----- (004B68EA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 bool __fastcall sub_4B68EA(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 int *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 v2 = &dword_4F0E10[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v3 = 8 * *((char *)v2 + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v3])) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 if ( v1 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 //----- (004B7911) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 void __cdecl sub_4B7911()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 int v1; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 int v2; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 GUIFont *v3; // ST20_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 int v4; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 MonsterInfo *v5; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 unsigned int v6; // ST20_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 char *v7; // ST1C_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 unsigned int v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 int v9; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 char *v10; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 signed int v11; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 signed int i; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 GUIWindow *v14; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 __int64 v15; // qax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 signed int v16; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 int v17; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 unsigned __int8 v18; // sf@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 char **v19; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 GUIButton *v20; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 GUIButton *v21; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 unsigned int v23; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 unsigned __int16 v24; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 GUIWindow a1; // [sp+Ch] [bp-110h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 GUIWindow w; // [sp+60h] [bp-BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 GUIWindow _this; // [sp+B4h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 int v28; // [sp+108h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 int v29; // [sp+10Ch] [bp-10h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 int v30; // [sp+110h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 int v31; // [sp+114h] [bp-8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 _this.DrawText2(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 if ( pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 v11 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 for ( i = 0; i < v11; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 pOutString = (GUIFont *)((char *)pOutString + v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 v29 = (100 - (signed int)pOutString) / v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v16 = v15 - HIDWORD(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 LODWORD(v15) = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 HIDWORD(v15) = v15 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v17 = (v16 >> 1) - v29 / 2 + 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v18 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 pOutString = (GUIFont *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v31 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v19 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 v20 = v14->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 v20->uY = v29 + v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v23 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 v21->uHeight = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v17 = v23 + v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 v21->uW = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 v24 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 if ( pDialogueWindow->field_2C_focus_id != v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 _this.DrawText2(pFontArrus, 0, v23, v24, *v19, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 pOutString = (GUIFont *)((char *)pOutString + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 while ( (signed int)pOutString < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 if ( dword_F8B19C != 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 if ( dword_F8B19C != 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 if ( ptr_507BC0->field_40 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 sprintfex(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 _this.DrawText2(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 _this.DrawText2(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 v3 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v2 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 if ( v1 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 if ( v1 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 v2 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 if ( v2 > pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 v2 = pParty->uFine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 Party::TakeGold(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 pParty->uFine -= v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 if ( pParty->uFine < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 pParty->uFine = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 if ( ptr_507BC0->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 v5 = &pMonsterStats->pInfos[word_F8B1A0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v7 = v5->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 sprintfex(pTmpBuf, &byte_4F0F98, v8, v7, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 ptr_F8B1E8 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 memcpy(&a1, pDialogueWindow, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 w.uFrameWidth = 458;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 w.uFrameZ = 457;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 if ( 352 - v9 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 352 - v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 (pTex ? pTex->uTextureHeight : 26) - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 // F8B1A0: using guessed type __int16 word_F8B1A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 //----- (004B7D7E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 void __cdecl _4B7D7E_bank()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 int v1; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 unsigned int v3; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 GUIFont *v4; // ST10_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 int v6; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 unsigned int v7; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 unsigned __int16 v8; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 unsigned __int16 v9; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 char *v10; // [sp-8h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 char *v11; // [sp-4h] [bp-6Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 __int16 v13[2]; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 __int16 v14[2]; // [sp+64h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 _this.DrawText2(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 if ( dword_F8B19C == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 if ( v6 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 v7 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 pParty->uNumGoldInBank += v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 if ( v1 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v10 = pGlobalTXT_LocalizationStrings[60];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 if ( dword_F8B19C != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 ptr_507BC0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 if ( v2 > pParty->uNumGoldInBank )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 v3 = pParty->uNumGoldInBank;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 Party::SetGold(pParty->uNumGold + v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 pParty->uNumGoldInBank -= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 v10 = pGlobalTXT_LocalizationStrings[244];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 sprintfex(pTmpBuf, "%s\n%s", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 _this.DrawText2(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 _this.DrawText2(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 v4 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 v8 = v14[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 if ( pDialogueWindow->field_2C_focus_id != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 v8 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 _this.DrawText2(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 v9 = v14[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 if ( pDialogueWindow->field_2C_focus_id != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v9 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 _this.DrawText2(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 //----- (004B8285) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 void __cdecl sub_4B8285_prolly_draw_arcomage_result()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 Player *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 signed int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 signed int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 GUIWindow *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 signed int v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 unsigned int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 int v11; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 unsigned int v12; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 int v14; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 GUIButton *v15; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 GUIButton *v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 int v17; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 char *v18; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 int v19; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 unsigned int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 int v21; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 unsigned __int16 v23; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 int v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 int v25; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 char *v26; // esi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 int v27; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 unsigned int v28; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 unsigned int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int v30; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 signed int v31; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 unsigned int v32; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 GUIWindow *v33; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 int v34; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 int v35; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 int v36; // esi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 char v37; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 GUIButton *v38; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 int v39; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 int v40; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 int v41; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 int v42; // ecx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 unsigned int v43; // edx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 int v44; // edx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 int v45; // ecx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 int v46; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 int v47; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 signed int v48; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 signed int i; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 int v50; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 GUIWindow *v51; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 _QWORD v52; // qax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 signed int v53; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 int v54; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 GUIButton *v55; // esi@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 const char **v56; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 int v57; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 unsigned int v58; // ecx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 Player *v59; // edx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 unsigned __int16 v60; // ax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 int v61; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 int v62; // edi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 char *v63; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 GUIFont *v64; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 GUIFont *v65; // edi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 unsigned int v66; // [sp-10h] [bp-284h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 int v68; // [sp-Ch] [bp-280h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 char *v69; // [sp-8h] [bp-27Ch]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 int v70; // [sp-8h] [bp-27Ch]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 unsigned int v71; // [sp-4h] [bp-278h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 const char *v72; // [sp-4h] [bp-278h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 unsigned int v73; // [sp-4h] [bp-278h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 char Dest; // [sp+Ch] [bp-268h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 char v75; // [sp+70h] [bp-204h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 char a1; // [sp+D4h] [bp-1A0h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 char v77; // [sp+138h] [bp-13Ch]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 GUIWindow v79; // [sp+1F0h] [bp-84h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 char *Str[2]; // [sp+244h] [bp-30h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 unsigned int v81; // [sp+24Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 unsigned __int8 v82; // [sp+253h] [bp-21h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 int v83; // [sp+254h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 __int16 v84[2]; // [sp+258h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 Player *v85; // [sp+25Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 int v86; // [sp+260h] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 int v89; // [sp+268h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 GUIFont *pOutString; // [sp+270h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 memcpy(&v79, ptr_507BC0, sizeof(v79));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 v85 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 v1 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 v79.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 v79.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 v79.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 v81 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 *(int *)v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 //v2 = p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 v2 = p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 *(float *)&v83 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 *(float *)&v89 = v2 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 v3 = (signed __int64)(*(float *)&v89 * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 v4 = v3 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 if ( v4 < v3 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 v4 = v3 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 pOutString = (GUIFont *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 pOutString = (GUIFont *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 v7 = v6 * (100 - v85->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 if ( v7 < v6 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 v7 = v6 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 v83 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 if ( dword_F8B19C > 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 if ( dword_F8B19C == 102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 v65 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 pOutString = pFontArrus;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
549 strcpy(pTmpBuf, pNPCTopics[354].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 v62 = v65->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 if ( 352 - v62 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 v62 = pFontCreate->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 352 - v62,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 (pTex ? pTex->uTextureHeight : 26) - v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v63 = FitTextInAWindow(pTmpBuf, pOutString, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v64 = pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 if ( dword_F8B19C != 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 if ( dword_F8B19C != 104 || pArcomageGame->bGameInProgress == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 if ( pArcomageGame->uGameResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 if ( pArcomageGame->uGameResult == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 strcpy(pTmpBuf, v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 LABEL_97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 v69 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 v67 = v84[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
599 strcpy(pTmpBuf, pNPCTopics[(uint)ptr_507BC0->ptr_1C + 247].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v62 = v61 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 352 - (v61 + 7),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 (pTex ? pTex->uTextureHeight : 26) - (v61 + 7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 v64 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 ptr_507BC0->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 if ( dword_F8B19C != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 if ( dword_F8B19C == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 if ( pParty->uNumGold >= (unsigned int)pOutString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 Party::TakeGold((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 v27 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 sub_4B1D27();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 pMessageQueue_50CBD0->pMessages[0].param = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 if ( dword_F8B19C != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 v8 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 *(float *)&v89 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v9 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 if ( (signed int)pOutString < v9 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 pOutString = (GUIFont *)(v9 / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 v10 = v8->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 v11 = v10 + v8->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 if ( (signed int)v10 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 v12 = v8->GetControl(v10)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 if ( byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v12] && !v85->pActiveSkills[v12] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 v13 = pFontArrus->CalcTextHeight(pSkillNames[v12], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 v89 += v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 while ( (signed int)v10 < v8->field_38 + v8->field_28 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 if ( v86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 v79.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 pOutString = (GUIFont *)((149 - v89) / v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 if ( (149 - v89) / v86 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 v14 = (149 - v86 * (signed int)pOutString - v89) / 2 - (signed int)pOutString / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 v89 = v8->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 v83 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 if ( v89 < v89 + v8->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 v86 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v15 = v8->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 v16 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 v17 = v15->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 if ( !byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v17] || v85->pActiveSkills[v17] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 v16->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 v16->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 v16->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 v18 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 v16->uY = (unsigned int)((char *)pOutString + v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 Str[1] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 v19 = pFontArrus->CalcTextHeight(v18, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 v20 = v16->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 v21 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 v16->uHeight = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 v22 = v19 + v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 v16->uW = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 v83 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 v23 = v84[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 if ( pDialogueWindow->field_2C_focus_id != v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 v23 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 v79.DrawText2(pFontArrus, 0, v20, v23, Str[1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 v24 = v8->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 ++v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 v25 = v8->field_38 + v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 while ( v89 < v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 goto LABEL_97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 *(_QWORD *)Str = pParty->uNumFoodRations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 pPlayers[uActiveCharacter]->PlaySound(67, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 if ( pParty->uNumGold >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v28 = *(int *)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 if ( pDialogueWindow->field_2C_focus_id != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 v28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 sprintfex(&Dest, format_4E2DC8, v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 strcat(&Dest, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 v90 = pFontArrus->CalcTextHeight(&Dest, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 strcat(&Dest, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 v29 = *(int *)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 if ( pDialogueWindow->field_2C_focus_id != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 v29 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 sprintfex(&a1, format_4E2DC8, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 sprintfex(pTmpBuf2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 pGlobalTXT_LocalizationStrings[86],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 strcat(&a1, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 strcat(&a1, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 v30 = *(int *)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 if ( pDialogueWindow->field_2C_focus_id != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 v30 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 sprintfex(&v77, format_4E2DC8, v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 strcat(&v77, pGlobalTXT_LocalizationStrings[160]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 strcat(&v77, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v87 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v31 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 if ( v31 >= 108 && v31 <= 120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 v32 = *(int *)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 if ( pDialogueWindow->field_2C_focus_id != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 v32 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 sprintfex(&v75, format_4E2DC8, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 strcat(&v75, pGlobalTXT_LocalizationStrings[611]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 v87 = pFontArrus->CalcTextHeight(&v75, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 v33 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 Str[1] = (char *)pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 v34 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 v35 = v34 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 v37 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 pOutString = (GUIFont *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 if ( !(v37 ^ __OFSUB__(v34, v35)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 sprintfex(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 v69 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v67 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 v66 = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 LABEL_98:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v79.DrawText2(pFontArrus, 0, v66, v67, v69, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 v38 = v33->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 if ( v38->uControlParam == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 v46 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v38->uHeight = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 v38->uY = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v41 = v46 + 145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 if ( v38->uControlParam == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 v44 = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 v45 = v90 + v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 v38->uHeight = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v38->uY = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 v41 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 if ( v38->uControlParam == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 if ( v38->uControlParam == 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 v39 = v90 + 3 * v36 + v87 + v88 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v33 = (GUIWindow *)Str[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v40 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 v38->uHeight = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v38->uY = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v41 = v39 + v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 v38->uW = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 v47 = v33->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 pOutString = (GUIFont *)((char *)pOutString + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 if ( (signed int)pOutString >= v33->field_28 + v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 v42 = v90 + v88 + 2 * v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v43 = v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 v38->uY = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v38->uHeight = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 v41 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 v48 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 if ( pParty->HasItem(0x28Bu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 v48 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 for ( i = 0; i < v48; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v50 = pFontArrus->CalcTextHeight(pShopOptions[i], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 pOutString = (GUIFont *)((char *)pOutString + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 v86 = (174 - (signed int)pOutString) / v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 v52 = 174 - v48 * (174 - (signed int)pOutString) / v48 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 v53 = v52 - HIDWORD(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 LODWORD(v52) = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 HIDWORD(v52) = v52 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 v54 = (v53 >> 1) - v86 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 v37 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 v89 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 if ( v37 ^ __OFSUB__((int)v52, HIDWORD(v52)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 v85 = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 pOutString = (GUIFont *)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v55 = v51->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 v56 = (const char **)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 v55->uY = v86 + v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 v57 = pFontArrus->CalcTextHeight(*v56, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 v58 = v55->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v59 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 v55->uHeight = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 v54 = v57 + v58 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 v55->uW = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v60 = v84[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 if ( (Player *)pDialogueWindow->field_2C_focus_id != v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 v60 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 v79.DrawText2(pFontArrus, 0, v58, v60, *(const char **)&pOutString->cFirstChar, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 v85 = (Player *)((char *)v85 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 pOutString = (GUIFont *)((char *)pOutString + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 ++v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 while ( v89 < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 //----- (004B8E3D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 void *__cdecl GenerateShopItems()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 GUIWindow *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 int v3; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 int v5; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 bool v6; // ebp@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 void *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 signed int v9; // [sp-Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 v2 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 while ( v2 > 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 if ( v2 <= 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 v6 = v1 > 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 v7 = v6 + 2 * v2 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v4 = word_4F0498[5 * v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v5 = *(short *)&aTooManyStation[2 * (5 * (v6 + 2 * v2) + rand() % 4) + 10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 if ( v2 <= 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 v4 = word_4F0576[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 v9 = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 if ( v2 <= 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 if ( v1 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 v4 = word_4F0578[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 v9 = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 v5 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 5] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 _t->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v3 = 5 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v4 = word_4F03FE[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v5 = word_4F0400[5 * v2 + rand() % 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 result = v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 *(int *)&pParty->field_16154[4 * (int)result] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 //----- (004B910F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 char *__cdecl sub_4B910F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 char *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 signed int v2; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 unsigned int v3; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 ItemGen *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 unsigned __int8 v6; // dl@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 char *v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 int v9; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 int v10; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 signed int v11; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 int v12; // ST08_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 int v14; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 char **v15; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 int v16; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 GUIWindow *v17; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 int v18; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 int v19; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 unsigned __int8 v20; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 GUIButton *v21; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 const char **v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 int v23; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 unsigned int v24; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 unsigned __int16 v26; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 signed int v27; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 int v28; // ST08_4@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 int v29; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 GUIWindow *v30; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 void *v31; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 signed int v32; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 unsigned int v33; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 int v34; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 unsigned int v35; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 int v36; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 __int32 v37; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 GUIButton *v38; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 GUIButton *v39; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 int v40; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 char *v41; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 int v42; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 unsigned int v43; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 const char **v44; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 int v45; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 unsigned __int16 v46; // ax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 int v47; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 const char **v48; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 unsigned int v49; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 Texture *v50; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 int v51; // edi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 int v52; // esi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 Texture *v53; // ST1C_4@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 int v54; // edi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 signed int v55; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 SHORT v56; // di@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 bool v57; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 const char *v58; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 POINT *v59; // esi@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 LONG v60; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 int v61; // eax@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 int v62; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 ItemGen *v63; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 int v64; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 int v65; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 char **v66; // edi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 int v67; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 GUIWindow *v68; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 int v69; // edx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 int v70; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 GUIButton *v71; // esi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 const char **v72; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 int v73; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 unsigned int v74; // ecx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 Player *v75; // edx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 unsigned __int16 v76; // ax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 GUIWindow *v77; // [sp-18h] [bp-110h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 int v78; // [sp-14h] [bp-10Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 ItemGen *v79; // [sp-10h] [bp-108h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 int v80; // [sp-10h] [bp-108h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 void *v81; // [sp-Ch] [bp-104h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 int v83; // [sp-8h] [bp-100h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 char *v84; // [sp-8h] [bp-100h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 __int64 *v85; // [sp-4h] [bp-FCh]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 unsigned int v86; // [sp-4h] [bp-FCh]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 POINT v87; // [sp+Ch] [bp-ECh]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 POINT v88; // [sp+14h] [bp-E4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 POINT v89; // [sp+1Ch] [bp-DCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 POINT v90; // [sp+24h] [bp-D4h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 POINT v91; // [sp+2Ch] [bp-CCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 POINT v92; // [sp+34h] [bp-C4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 POINT v93; // [sp+3Ch] [bp-BCh]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 POINT v94; // [sp+44h] [bp-B4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 POINT v95; // [sp+4Ch] [bp-ACh]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 POINT v96; // [sp+54h] [bp-A4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 POINT v97; // [sp+5Ch] [bp-9Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 POINT a2; // [sp+64h] [bp-94h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 POINT v99; // [sp+6Ch] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 POINT v100; // [sp+74h] [bp-84h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 GUIWindow v101; // [sp+7Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 char *Str; // [sp+D0h] [bp-28h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 __int32 v103; // [sp+D4h] [bp-24h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 int v104; // [sp+D8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 int v105; // [sp+DCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 POINT v106; // [sp+E0h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 Player *_this; // [sp+E8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 int v108; // [sp+ECh] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 const char **v109; // [sp+F0h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 memcpy(&v101, ptr_507BC0, sizeof(v101));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v101.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 v101.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v101.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 v66 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 ++v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 v65 += v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 while ( (signed int)v66 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 v109 = (const char **)((174 - v65) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 result = (char *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 v69 = (int)&result[pDialogueWindow->field_28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v20 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 v106.y = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 if ( v20 ^ __OFSUB__((int)result, (int)v69) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 v108 = (int)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 v71 = v68->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 v72 = (const char **)v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 v71->uY = (unsigned int)((char *)v109 + v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 v74 = v71->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 v75 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v71->uHeight = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v70 = v73 + v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v71->uW = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v76 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 if ( (Player *)pDialogueWindow->field_2C_focus_id != v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v76 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 v101.DrawText2(pFontArrus, 0, v74, v76, *(const char **)v108, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 v108 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 ++v106.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 result = (char *)(pDialogueWindow->field_28 + pDialogueWindow->field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 result = (char *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v30 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 v31 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v106.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 v108 = v32 * (100 - _this->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 if ( v108 < v32 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 v108 = v32 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 v33 = v30->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 v34 = v33 + v30->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 if ( (signed int)v33 >= v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 goto LABEL_105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 v35 = v30->GetControl(v33)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v35] && !_this->pActiveSkills[v35] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 v36 = pFontArrus->CalcTextHeight(pSkillNames[v35], &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 v106.y += v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 while ( (signed int)v33 < v30->field_28 + v30->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 LABEL_105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 v7 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 v84 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 v82 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 v101.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 v108 = (149 - v106.y) / (signed int)v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 if ( (149 - v106.y) / (signed int)v109 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 v108 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 result = (char *)v30->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 v37 = (149 - (signed int)v109 * v108 - v106.y) / 2 - v108 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 v106.y = (LONG)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 v103 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 if ( (signed int)result < (signed int)&result[v30->field_28] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 v109 = (const char **)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 v38 = v30->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 v40 = v38->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v40] || _this->pActiveSkills[v40] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 v39->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 v39->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 v39->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 v41 = pSkillNames[v40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 v39->uY = v108 + v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 Str = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 v42 = pFontArrus->CalcTextHeight(v41, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v43 = v39->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 v44 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v39->uHeight = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 v45 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v39->uW = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v103 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 v46 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 if ( (const char **)pDialogueWindow->field_2C_focus_id != v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 v46 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 v101.DrawText2(pFontArrus, 0, v43, v46, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 v47 = v30->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 ++v106.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 result = (char *)(v30->field_28 + v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 v27 = pMouse->GetCursorPos(&v99)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 result = (char *)pMouse->GetCursorPos(&v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 result = (char *)pMouse->GetCursorPos(&v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 result = (char *)(9 * (int)result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 if ( _this->field_1F5[4 * (int)result + 15] & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 v83 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 v79 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 v28 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 v29 = _this->_490EEE(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 v28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v5 = (char *)pMerchantsRepairPhrases[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v15 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 v14 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v103 = (174 - v14) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 result = (char *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v18 = (int)&result[pDialogueWindow->field_28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 v20 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 _this = (Player *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 if ( v20 ^ __OFSUB__((int)result, v18) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 v108 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 v109 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 v21 = v17->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 v22 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 v21->uY = v103 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v24 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v25 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 v21->uHeight = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 v19 = v24 + v23 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 v21->uW = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v26 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 if ( pDialogueWindow->field_2C_focus_id != v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 v26 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 v101.DrawText2(pFontArrus, 0, v24, v26, *v109, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 ++v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 result = (char *)(pDialogueWindow->field_28 + pDialogueWindow->field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 while ( (signed int)_this < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 v11 = pMouse->GetCursorPos(&v96)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 result = (char *)pMouse->GetCursorPos(&v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 result = (char *)pMouse->GetCursorPos(&v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 v83 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 v79 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 v13 = _this->_490EEE(v79, 1, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 v5 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 result = (char *)(dword_F8B19C - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 v2 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 result = (char *)pMouse->GetCursorPos(&v100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 result = (char *)pMouse->GetCursorPos(&v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 v83 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 v4 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 if ( !(v4->uAttributtes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 v9 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 v10 = _this->_490EEE(v4, 1, v9, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v5 = (char *)pMerchantsIdentifyPhrases[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v6 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 v7 = sub_495461(v5, v6, v79, (char *)v81, v83, v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 v84 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v80 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 v78 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 return v101.DrawText2(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 v49 = word_F8B158[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 v50 = dword_F8B168[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v49 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 v48 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 v48 = (const char **)((char *)v48 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 v109 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 while ( (signed int)v48 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)ptr_507BC0->ptr_1C] + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v52 = word_F8B158[(signed int)v109] + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 v53 = dword_F8B168[(signed int)v109];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 while ( (signed int)v109 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v56 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v57 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 Str = (char *)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 if ( v56 && v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 v58 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v58 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 v58 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 sub_4B46A5(v58, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 if ( v106.x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 v59 = pMouse->GetCursorPos(&v91);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v106.x = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v61 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v62 = 9 * (v60 + 12 * v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v63 = (ItemGen *)&pParty->field_777C[v62];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 if ( !v56 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v64 = _this->_490EEE(v63, 1, v61, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v5 = (char *)pMerchantsBuyPhrases[v64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 v5 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 result = v101._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 //----- (004B9CC6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 POINT *__cdecl sub_4B9CC6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 POINT *result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 GUIWindow *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 unsigned int v3; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 void *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 signed int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 unsigned int v6; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 unsigned int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 int v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 GUIButton *v11; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 GUIButton *v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 char *v14; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 unsigned int v16; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 int v17; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 int v18; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 unsigned __int16 v19; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 int v20; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 char *v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 int v22; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 char **v23; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 int v24; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 GUIWindow *v25; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 int v26; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 int v27; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 unsigned __int8 v28; // sf@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 GUIButton *v29; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 const char **v30; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 int v31; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 unsigned int v32; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 Player *v33; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 int v34; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 unsigned __int16 v35; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 signed int v36; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 ItemGen *v37; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 char *v38; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 unsigned __int8 v39; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 int v40; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 int v41; // ST08_4@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 signed int v43; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 int v44; // ST08_4@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 int v45; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 Texture *v46; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 unsigned int v47; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 unsigned int v48; // esi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 int v49; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 Texture *v50; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 unsigned int v51; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 unsigned int v52; // esi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 int v53; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 Texture *v54; // ecx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 unsigned int v55; // edi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 unsigned int v56; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 int v57; // edx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 Texture *v58; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 unsigned int v59; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 unsigned int v60; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 int v61; // edx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 signed int v62; // ecx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 SHORT v63; // di@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 bool v64; // eax@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 const char *v65; // ecx@112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 POINT *v66; // esi@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 int v67; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 int v68; // eax@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 int v69; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 ItemGen *v70; // esi@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 int v71; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 int v72; // edi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 char **v73; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 int v74; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 GUIWindow *v75; // ecx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 int v76; // edx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 int v77; // edi@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 GUIButton *v78; // esi@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 const char **v79; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 int v80; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 unsigned int v81; // ecx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 Player *v82; // edx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 unsigned __int16 v83; // ax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 GUIWindow *v84; // [sp-18h] [bp-F0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 int v85; // [sp-14h] [bp-ECh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 int v86; // [sp-10h] [bp-E8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 ItemGen *v87; // [sp-10h] [bp-E8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 void *v89; // [sp-Ch] [bp-E4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 char *v90; // [sp-8h] [bp-E0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 int v91; // [sp-8h] [bp-E0h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 unsigned int v92; // [sp-4h] [bp-DCh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 __int64 *v93; // [sp-4h] [bp-DCh]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 POINT v94; // [sp+Ch] [bp-CCh]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 POINT v95; // [sp+14h] [bp-C4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 POINT v96; // [sp+1Ch] [bp-BCh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 POINT v97; // [sp+24h] [bp-B4h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 POINT v98; // [sp+2Ch] [bp-ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 POINT v99; // [sp+34h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 POINT v100; // [sp+3Ch] [bp-9Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 POINT v101; // [sp+44h] [bp-94h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 POINT v102; // [sp+4Ch] [bp-8Ch]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 POINT a2; // [sp+54h] [bp-84h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 GUIWindow v104; // [sp+5Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 int v105; // [sp+B0h] [bp-28h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 int v106; // [sp+B4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 char *Str; // [sp+B8h] [bp-20h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 int v108; // [sp+BCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 __int32 v109; // [sp+C0h] [bp-18h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 Player *_this; // [sp+C4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 const char **v111; // [sp+C8h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 unsigned int v112; // [sp+CCh] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 int v114; // [sp+D4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 memcpy(&v104, ptr_507BC0, sizeof(v104));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v104.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 v104.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 v104.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 v73 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 v72 += v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 while ( (signed int)v73 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 Str = (char *)((174 - v72) / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 result = (POINT *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 v76 = (int)((char *)result + pDialogueWindow->field_28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 v28 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 v112 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 if ( v28 ^ __OFSUB__((int)result, v76) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 v78 = v75->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 v79 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 v78->uY = (unsigned int)&Str[v77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 v81 = v78->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 v82 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 v78->uHeight = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 v77 = v81 + v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 v78->uW = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 v83 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 if ( (Player *)pDialogueWindow->field_2C_focus_id != v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 v83 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 v104.DrawText2(pFontArrus, 0, v81, v83, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 ++v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 result = (POINT *)(pDialogueWindow->field_28 + pDialogueWindow->field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 || (v43 = pMouse->GetCursorPos(&v99)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 result = pMouse->GetCursorPos(&v102),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 || (result = pMouse->GetCursorPos(&v100), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 v91 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 v87 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 v44 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 v45 = _this->_490EEE(v87, 4, v44, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v38 = (char *)pMerchantsSellPhrases[v45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 result = pMouse->GetCursorPos(&v101),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 || (result = pMouse->GetCursorPos(&v97), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 v91 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 v37 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 if ( !(v37->uAttributtes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 v41 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 v42 = _this->_490EEE(v37, 4, v41, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 v38 = (char *)pMerchantsIdentifyPhrases[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 v38 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 v39 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 v21 = sub_495461(v38, v39, v87, (char *)v89, v91, v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 v90 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 v88 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 v86 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v85 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 v23 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 v24 = pFontArrus->CalcTextHeight(*v23, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 v22 += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 while ( (signed int)v23 < (signed int)&pShopOptions[2] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 Str = (char *)((174 - v22) / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 v25 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 result = (POINT *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 v26 = (int)((char *)result + pDialogueWindow->field_28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v27 = (2 * (87 - (174 - v22) / 2) - v22) / 2 - (174 - v22) / 2 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v28 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 v112 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 if ( v28 ^ __OFSUB__((int)result, v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v29 = v25->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v30 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 v29->uY = (unsigned int)&Str[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 v31 = pFontArrus->CalcTextHeight(*v30, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v32 = v29->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v33 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 v29->uHeight = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 v34 = v31 + v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 v29->uW = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v27 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 v35 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 if ( (Player *)pDialogueWindow->field_2C_focus_id != v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 v35 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 v104.DrawText2(pFontArrus, 0, v32, v35, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 v25 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 ++v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 result = (POINT *)(pDialogueWindow->field_28 + pDialogueWindow->field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 result = (POINT *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( dword_F8B19C != 96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 v2 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 v4 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 v111 = (const char **)(v5 * (100 - _this->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 if ( (signed int)v111 < v5 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 v111 = (const char **)(v5 / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 v6 = v2->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 v7 = v6 + v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 if ( (signed int)v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 v8 = v2->GetControl(v6)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v8] && !_this->pActiveSkills[v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 v9 = pFontArrus->CalcTextHeight(pSkillNames[v8], &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 v112 += v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 while ( (signed int)v6 < v2->field_28 + v2->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 v104.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 v111 = (const char **)((signed int)(149 - v112) / v114);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 if ( (signed int)(149 - v112) / v114 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 v111 = (const char **)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 result = (POINT *)v2->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 v10 = (signed int)(149 - v114 * (int)v111 - v112) / 2 - (signed int)v111 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 v112 = (unsigned int)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 v105 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 if ( (signed int)result < (signed int)((char *)result + v2->field_28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 v114 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 v11 = v2->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 v13 = v11->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v13] || _this->pActiveSkills[v13] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 v12->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 v12->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 v12->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v14 = pSkillNames[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 v12->uY = (unsigned int)((char *)v111 + v105);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 Str = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v15 = pFontArrus->CalcTextHeight(v14, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v16 = v12->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v17 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 v12->uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 v18 = v16 + v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 v12->uW = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 v105 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 v19 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 if ( pDialogueWindow->field_2C_focus_id != v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 v19 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v104.DrawText2(pFontArrus, 0, v16, v19, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 v20 = v2->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 ++v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 result = (POINT *)(v2->field_28 + v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 v21 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 v90 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 v88 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 return (POINT *)v104.DrawText2(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 v46 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 v47 = 152 - v46->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 if ( (signed int)v47 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 v49 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 if ( (signed int)v48 > 457 - v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 v48 = 457 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 if ( (signed int)v48 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v48 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 pRenderer->DrawTextureTransparent(v48, v47, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 v50 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 v51 = 308 - v50->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 if ( (signed int)v51 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 v53 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 if ( (signed int)v52 > 457 - v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 v52 = 457 - v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 if ( (signed int)v52 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v52 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 pRenderer->DrawTextureTransparent(v52, v51, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 v54 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 v55 = 152 - v54->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 if ( (signed int)v55 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 v57 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 if ( (signed int)v56 > 457 - v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v56 = 457 - v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 if ( (signed int)v56 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v56 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 pRenderer->DrawTextureTransparent(v56, v55, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 v58 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v59 = 308 - v58->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 if ( (signed int)v59 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 v61 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 if ( (signed int)v60 > 457 - v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v60 = 457 - v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 if ( (signed int)v60 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 v60 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 pRenderer->DrawTextureTransparent(v60, v59, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 v63 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 v64 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 Str = (char *)v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 if ( v63 && v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 v65 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 v65 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 v65 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 sub_4B46A5(v65, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 return (POINT *)v104._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 v66 = pMouse->GetCursorPos(&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 v109 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 v68 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 v69 = 9 * (v67 + 12 * v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 v70 = (ItemGen *)&pParty->field_777C[v69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 if ( !v63 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 v71 = _this->_490EEE(v70, 4, v68, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v38 = (char *)pMerchantsBuyPhrases[v71];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v38 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 //----- (004BA928) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 void __cdecl sub_4BA928()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 signed int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 unsigned int v2; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 ItemGen *v3; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 unsigned __int8 v4; // dl@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 char *v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 int v7; // ST08_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 signed int v9; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 unsigned int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 char *v11; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 int v12; // ST08_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 unsigned __int8 v14; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 char *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 char **v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 char **v18; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 int v19; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 GUIWindow *v20; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 int v21; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 int v22; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 int v23; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 unsigned __int8 v24; // sf@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 GUIButton *v25; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 GUIButton *v26; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 int v27; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 unsigned int v28; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 Player *v29; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 unsigned __int16 v30; // ax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 signed int v31; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 unsigned int v32; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 int v33; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 int v34; // ST08_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 int v35; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 char *v36; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 GUIWindow *v37; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 signed int v38; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 unsigned int v39; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 int v40; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 unsigned int v41; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 int v43; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 GUIButton *v44; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 GUIButton *v45; // esi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 int v46; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 char *v47; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 int v48; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 unsigned int v49; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 int v50; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 int v51; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 unsigned __int16 v52; // ax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 int v53; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 int v54; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 signed int v55; // ebx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 Texture *v56; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 unsigned int v57; // edi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 Texture *v58; // ST1C_4@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 int v59; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 int v60; // edi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 signed int v61; // ebx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 Texture *v62; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 int v63; // edi@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 Texture *v64; // ST1C_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 unsigned int v65; // ST18_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 int v66; // eax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 int v67; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 signed int v68; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 SHORT v69; // bx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 bool v70; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 const char *v71; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 void *v72; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 POINT *v73; // esi@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 int v74; // ecx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 int v75; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 int v76; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 ItemGen *v77; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 unsigned __int8 v78; // bl@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 char **v79; // edi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 int v80; // ebx@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 char **v81; // esi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 int v82; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 GUIWindow *v83; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 int v84; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 int v85; // edx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 int v86; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 GUIButton *v87; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 GUIButton *v88; // esi@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 int v89; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 unsigned int v90; // ecx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 int v91; // edx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 unsigned __int16 v92; // ax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 signed int v93; // edx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 POINT *v94; // edi@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 __int32 v95; // ecx@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 void *v96; // ST14_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 unsigned __int8 v97; // bl@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 ItemGen *v98; // ST10_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 int v99; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 char *v100; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 const char *v101; // ST18_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 unsigned __int16 v102; // ST14_2@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 int v103; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 signed int v104; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 Texture *v105; // eax@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 int v106; // ebx@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 Texture *v107; // ST1C_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 unsigned int v108; // ST18_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 int v109; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 int v110; // ebx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 unsigned int v112; // [sp-14h] [bp-118h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 int v113; // [sp-14h] [bp-118h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 ItemGen *v114; // [sp-10h] [bp-114h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 unsigned int v115; // [sp-10h] [bp-114h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 ItemGen *v116; // [sp-10h] [bp-114h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 int v117; // [sp-10h] [bp-114h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 void *v118; // [sp-Ch] [bp-110h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 void *v120; // [sp-Ch] [bp-110h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 char *v121; // [sp-8h] [bp-10Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 int v122; // [sp-8h] [bp-10Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 unsigned int v123; // [sp-4h] [bp-108h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 __int64 *v124; // [sp-4h] [bp-108h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 int v125; // [sp-4h] [bp-108h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v126; // [sp-4h] [bp-108h]@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 int v127; // [sp-4h] [bp-108h]@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 POINT v128; // [sp+Ch] [bp-F8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 POINT v129; // [sp+14h] [bp-F0h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 char v130; // [sp+1Ch] [bp-E8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 POINT a2; // [sp+24h] [bp-E0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 POINT v132; // [sp+2Ch] [bp-D8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 POINT v133; // [sp+34h] [bp-D0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 char v134; // [sp+3Ch] [bp-C8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 POINT v135; // [sp+44h] [bp-C0h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 POINT v136; // [sp+4Ch] [bp-B8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 POINT v137; // [sp+54h] [bp-B0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 POINT v138; // [sp+5Ch] [bp-A8h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 POINT v139; // [sp+64h] [bp-A0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 POINT v140; // [sp+6Ch] [bp-98h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 POINT v141; // [sp+74h] [bp-90h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 POINT v142; // [sp+7Ch] [bp-88h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 POINT v143; // [sp+84h] [bp-80h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 GUIWindow v144; // [sp+8Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 char *Str; // [sp+E0h] [bp-24h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 int v146; // [sp+E4h] [bp-20h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 int v147; // [sp+E8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 int v148; // [sp+ECh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 __int32 v149; // [sp+F0h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 Player *_this; // [sp+F4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 int v152; // [sp+FCh] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 int v153; // [sp+100h] [bp-4h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 memcpy(&v144, ptr_507BC0, sizeof(v144));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 v144.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 v144.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 v144.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 if ( dword_F8B19C == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 sub_4B46A5(pGlobalTXT_LocalizationStrings[195], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 v149 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 ++v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 while ( v93 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 if ( v149 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 v94 = pMouse->GetCursorPos(&v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 v95 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 if ( v149 && v149 != -65536 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 --v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 v96 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 v97 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 v99 = _this->_490EEE(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 (int)ptr_507BC0->ptr_1C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 v100 = sub_495461((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 v101 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 v102 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 v144.DrawText2(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 v104 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 v105 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 if ( v104 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, dword_F8B168[v104]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 v109 = v153 + v110 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 v106 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v107 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 v108 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 v109 = v152 + v153 + 640 * v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], dword_F8B168[v104], v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 ++v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 while ( v104 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 v79 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 v81 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 v80 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 while ( (signed int)v81 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 v152 = (174 - v80) / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 v84 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 v85 = v84 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 v24 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 _this = (Player *)pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 if ( v24 ^ __OFSUB__(v84, v85) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 v87 = v83->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 v88 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 v87->uY = v152 + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 v90 = v88->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 v91 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 v88->uHeight = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 v86 = v90 + v89 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 v88->uW = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 v92 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 if ( pDialogueWindow->field_2C_focus_id != v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 v92 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 v144.DrawText2(pFontArrus, 0, v90, v92, *v79, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 while ( (signed int)_this < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 v152 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 v37 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 v38 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 if ( (signed int)_this < v38 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 _this = (Player *)(v38 / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 v39 = v37->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 v40 = v37->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 if ( (signed int)v39 < (signed int)(v39 + v40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 v41 = v37->GetControl(v39)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v41] && !v0->pActiveSkills[v41] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 v152 += v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 while ( (signed int)v39 < v37->field_28 + v37->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 if ( v153 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 v144.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 _this = (Player *)((149 - v152) / v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 if ( (149 - v152) / v153 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 _this = (Player *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 v152 = v37->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 v146 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 if ( v152 < v152 + v37->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 v44 = v37->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v45 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 v46 = v44->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v46] || v0->pActiveSkills[v46] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 v45->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 v45->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 v45->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v47 = pSkillNames[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 v45->uY = (unsigned int)((char *)_this + v146);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 Str = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v49 = v45->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 v50 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 v45->uHeight = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 v51 = v49 + v48 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v45->uW = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v146 = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 v52 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 if ( pDialogueWindow->field_2C_focus_id != v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v52 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 v144.DrawText2(pFontArrus, 0, v49, v52, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v53 = v37->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 ++v152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 v54 = v37->field_28 + v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 while ( v152 < v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 v36 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 v121 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v119 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 v113 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 v112 = (unsigned int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v144.DrawText2(pFontArrus, v112, v115, v119, v121, v123);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 v56 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 if ( v55 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 0x7Eu, dword_F8B168[v55]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v59 = v60 + v153 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v57 = 98 - v56->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v58 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v59 = v153 + v152 + 640 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], dword_F8B168[v55], v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 while ( v55 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 v62 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 if ( v61 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, dword_F8B168[v61]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 v66 = v153 + v67 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 v63 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 v64 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 v65 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 v66 = v152 + v153 + 640 * v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], dword_F8B168[v61], v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 while ( v61 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 v149 = (__int32)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v69 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 v70 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 Str = (char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 if ( v69 == (short)v11 || (char *)v70 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 v71 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 v71 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 v71 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 sub_4B46A5(v71, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 if ( (char *)v149 != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 v73 = pMouse->GetCursorPos(&v136);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 if ( !v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v149 = v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 v75 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 v76 = 9 * (v74 - 1 + 12 * v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v77 = (ItemGen *)&pParty->field_777C[v76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 v77 = (ItemGen *)&pParty->field_C59C[v76 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 if ( v69 == (short)v11 || Str == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 v78 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v14 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v15 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v14 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 v36 = sub_495461(v15, v14, v116, (char *)v120, v122, v124);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 v121 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 v117 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 v113 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 v144._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 || (v31 = pMouse->GetCursorPos(&v135)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 pMouse->GetCursorPos(&v140)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 || pMouse->GetCursorPos(&v138)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 v122 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 v116 = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 v34 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 v35 = v0->_490EEE((ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 v15 = (char *)pMerchantsRepairPhrases[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 v16 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 v18 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v19 = pFontArrus->CalcTextHeight(*v18, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 v17 += v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 while ( (signed int)v18 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 v146 = (174 - v17) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 v21 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 v22 = v21 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 v24 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 v152 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 if ( v24 ^ __OFSUB__(v21, v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v25 = v20->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 v25->uY = v146 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v28 = v26->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v29 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v26->uHeight = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v23 = v28 + v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v26->uW = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 v30 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 if ( (Player *)pDialogueWindow->field_2C_focus_id != v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 v30 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 v144.DrawText2(pFontArrus, 0, v28, v30, *v16, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 ++v152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 while ( v152 < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 || (v9 = pMouse->GetCursorPos(&v139)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 pMouse->GetCursorPos(&v137)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 || pMouse->GetCursorPos(&v129)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 v122 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 v116 = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v10 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v13 = v0->_490EEE(v116, 2, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 v15 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 if ( pMouse->GetCursorPos(&v141)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 if ( pMouse->GetCursorPos(&v143)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 v3 = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 if ( v3->uAttributtes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 v4 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 v7 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v8 = v0->_490EEE(v3, 2, v7, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v4 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 v5 = (char *)pMerchantsIdentifyPhrases[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v6 = sub_495461(v5, v4, v114, (char *)v118, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 v121 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 //----- (004BB756) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 signed int __fastcall sub_4BB756(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 unsigned int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 unsigned int v3; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 char *v4; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 int v5; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 int v6; // ST38_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 char *v7; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 int v8; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 int v9; // ST30_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 int v10; // ST44_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 int v11; // ST48_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 int v12; // ST4C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 int v13; // ST50_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 int v14; // ST3C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 int v15; // ST40_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 int v16; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 int v17; // ST38_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 Player *v18; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 int v19; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 SoundID v21; // [sp-20h] [bp-54h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 signed int v22; // [sp-1Ch] [bp-50h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 unsigned int v23; // [sp-18h] [bp-4Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 signed int v24; // [sp-14h] [bp-48h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 signed int v25; // [sp-10h] [bp-44h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 int v26; // [sp-10h] [bp-44h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 int v27; // [sp-Ch] [bp-40h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 unsigned int v28; // [sp-Ch] [bp-40h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 unsigned int v29; // [sp-8h] [bp-3Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 __int16 v30; // [sp-8h] [bp-3Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 int v31; // [sp-4h] [bp-38h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 int v32; // [sp-4h] [bp-38h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 if ( a1 > 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 if ( a1 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 if ( a1 == 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 dword_50C9DC = 195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 ptr_50C9E0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 if ( a1 == 42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 v26 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 if ( a1 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 if ( a1 != 52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 v26 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 _42777D_CastSpell_UseWand_ShootArrow(v26, 0, v28, v30, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 pParty->pPartyBuffs[18].Apply(pParty->uTimePlayed + 46080, 3u, 0, v20, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 pParty->pPartyBuffs[18].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 v21 = (SoundID)12040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 pAudioPlayer->PlaySound(v21, v22, v23, v24, v25, v27, v29, v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 if ( a1 == 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 v21 = (SoundID)203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 pParty->pPartyBuffs[7].Apply(pParty->uTimePlayed + 30720, 3u, 1u, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 pParty->pPartyBuffs[7].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 v21 = (SoundID)11090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 if ( a1 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 v18 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 v18->sHealth = v18->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 while ( (signed int)v18 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 if ( a1 == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 v7 = (char *)&pParty->pPlayers[0].pConditions[15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 v8 = *((int *)v7 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 v9 = *((int *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 v10 = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 v11 = *((int *)v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 v12 = *((int *)v7 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 v13 = *((int *)v7 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 v14 = *((int *)v7 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 v15 = *((int *)v7 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 v16 = *((int *)v7 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 v17 = *((int *)v7 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 memset(v7 - 120, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 *((int *)v7 + 2) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 *((int *)v7 + 3) = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 *(int *)v7 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 *((int *)v7 + 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 *((int *)v7 - 1) = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 *((int *)v7 + 8) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 *((int *)v7 + 9) = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 *((int *)v7 + 4) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 *((int *)v7 - 2) = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 *((int *)v7 + 5) = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 *((int *)v7 + 1585) = ((Player *)(v7 - 120))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 v7 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 while ( (signed int)v7 < (signed int)&pParty->pHirelings[1].evtb );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 if ( a1 == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 v4 = (char *)&pParty->pPlayers[0].pActiveSkills[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 v5 = *((int *)v4 - 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 v6 = *((int *)v4 - 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 memset(v4 - 280, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 *(int *)v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 *((int *)v4 + 1) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 *((int *)v4 + 1545) = ((Player *)(v4 - 280))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 v4 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 while ( (signed int)v4 < (signed int)&pParty->field_777C[22] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 if ( a1 == 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 Party::GiveFood(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 if ( pParty->uNumFoodRations > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 pParty->uNumFoodRations = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 if ( a1 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 // 50C9DC: using guessed type int dword_50C9DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 //----- (004BBA85) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3135 const char *sub_4BBA85_bounties()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 signed __int64 v1; // qax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 int i; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 int v4; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 __int16 v5; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 char v6; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 Player *v7; // ebx@16
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3145 const char *result; // eax@19
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 uDialogueType = 83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3149 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 471u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 pGlobalTXT_LocalizationStrings[34],// "Cancel"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3161 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 pDialogueWindow->_41D08F(1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 v0 = (int)((char *)ptr_507BC0->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v0 + 1], pParty->field_3C.field_0[2 * v0]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 pParty->field_75A[v0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v1 = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 pParty->field_3C.field_0[2 * v0] = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 pParty->field_3C.field_0[2 * v0 + 1] = HIDWORD(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 for ( i = rand(); ; i = rand() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 v3 = i % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 pParty->field_750[v0] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 if ( (unsigned __int16)v3 < 0x73u || (unsigned __int16)v3 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 if ( ((unsigned __int16)v3 < 0xEBu || (unsigned __int16)v3 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 && ((unsigned __int16)v3 < 0x85u || (unsigned __int16)v3 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 && ((unsigned __int16)v3 < 0x97u || (unsigned __int16)v3 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 && ((unsigned __int16)v3 < 0xC4u || (unsigned __int16)v3 > 0xC6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 v4 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 v5 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 v6 = pParty->field_75A[v4] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 word_F8B1A0 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v6 = v5 == 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3196 result = pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 if ( v6 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3198 result = pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v5].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 v7 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 v7->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 while ( (signed int)v7 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v4]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 pParty->field_750[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 pParty->field_75A[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3216 result = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 dword_F8B1A4 = (char *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 //----- (004BBCDD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 void __cdecl sub_4BBCDD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 signed int v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 __int16 v2; // cx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 int v3; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 Player *v4; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 GUIButton *v5; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 GUIButton *v6; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 size_t v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 if ( pParty->field_7B5_in_arena_quest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 if ( pParty->field_7B5_in_arena_quest == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 uDialogueType = 92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 v1 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 v2 = *(short *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 if ( *(short *)v1 == 5 || v2 == 11 || v2 == 19 || (v3 = *((int *)v1 + 159)) != 0 && (v3 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 v1 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 if ( v0 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 uDialogueType = 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 v4 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 while ( (signed int)v4 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 party_finds_gold(dword_F8B1B4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 pParty->field_7B5_in_arena_quest = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 uDialogueType = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 pParty->vPosition.x = 3849;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 pParty->vPosition.z = 5770;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 pParty->vPosition.y = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 uDialogueType = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 v5 = pDialogueWindow->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 v6 = v5->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 pAllocator->FreeChunk(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 pDialogueWindow->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 pDialogueWindow->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 pDialogueWindow->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 pGlobalTXT_LocalizationStrings[79],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x55u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x56u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x57u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x58u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 pDialogueWindow->_41D08F(4, 1, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 // F8B1B4: using guessed type int dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 //----- (004BBF61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 size_t v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 int monster_id; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 __int16 v6; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 Actor *v7; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 MonsterInfo *v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 MonsterDesc *v10; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 unsigned __int16 *v11; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 int v12; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 int v13; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 __int16 x_; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 __int16 v15; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 __int16 v16; // [sp+10h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 signed int ya; // [sp+1Ch] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 monster_id = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 v15 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 if ( (signed int)uNumActors < 500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 && ((signed int)pAllocator->uBigBufferSizeAligned >> 10) - ((signed int)pAllocator->uNextFreeOffsetInBigBuffer >> 10) >= 2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 v6 = pIndoor->GetSector(x, y, z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 v16 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v7 = &pActors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 v7->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v8 = monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v9 = &pMonsterStats->pInfos[monster_id];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 v10 = &pMonsterList->pMonsters[v8 - 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 strcpy(v7->pActorName, v9->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v7->sCurrentHP = LOWORD(v9->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 memcpy(&v7->pMonsterInfo, v9, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v7->word_000086_some_monster_id = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v7->uActorRadius = v10->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 v7->uActorHeight = v10->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 v7->uMovementSpeed = v10->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 v7->vInitialPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v7->vPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 BYTE2(v7->uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v7->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v7->pMonsterInfo.uTreasureLevel = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v7->pMonsterInfo.uTreasureDiceSides = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v7->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v7->pMonsterInfo.uTreasureDropChance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v7->vInitialPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v7->vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 v7->vInitialPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v7->vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v7->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v7->uSectorID = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v7->uGroup = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v7->pMonsterInfo.uHostilityType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v7->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v11 = v10->pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 ya = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 pSoundList->_4A9A67((signed __int16)*v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 --ya;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 while ( ya );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 //----- (004BC109) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 void __cdecl ArenaFight()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 char *v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 Player *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 int v3; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 signed int v4; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 signed __int64 v5; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 signed int v6; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 char *v7; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 int v8; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 int v9; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 int v10; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 unsigned __int8 v11; // sf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 unsigned __int8 v12; // of@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 signed int v13; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 int v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 int v15; // edx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 int v16; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 signed int v17; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 int v18; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 int i; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 int monster_y; // ST18_4@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 int v21; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 signed int v22; // [sp-4h] [bp-144h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 __int16 v23[100]; // [sp+Ch] [bp-134h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 GUIWindow window; // [sp+D4h] [bp-6Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 int v26; // [sp+134h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 int v27; // [sp+138h] [bp-8h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 int num_monsters; // [sp+13Ch] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 pParty->field_7B5_in_arena_quest = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 memcpy(&window, pDialogueWindow, sizeof(window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 window.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 window.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 pRenderer->SetGameRenderStates();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 pRenderer->FillRect2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 pViewport->uViewportZ - pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 pViewport->uViewportW - pViewport->uViewportY + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 LOWORD(pRenderer->uTargetGMask) | LOWORD(pRenderer->uTargetBMask));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 352 - v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 (pTex ? pTex->uTextureHeight : 26) - v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 pParty->vPosition.x = 3849;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 pParty->vPosition.z = 5770;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 pParty->vPosition.y = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v2 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v3 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 if ( v3 > v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 v26 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 while ( (signed int)v2 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 num_monsters = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v5 = (signed __int64)((double)v26 * 1.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 LODWORD(v5) = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 num_monsters = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 v4 /= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 num_monsters = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 if ( v4 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 if ( v4 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 if ( num_monsters > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 num_monsters = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 if ( v4 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 if ( num_monsters < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 num_monsters = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 v7 = (char *)&pMonsterStats->pInfos[1].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 if ( v7[8] != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 if ( !MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 v8 = (unsigned __int8)*v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 if ( v8 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 if ( v8 <= num_monsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 v23[v6++] = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 v7 += 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 num_monsters = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 if ( v6 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 num_monsters = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 if ( num_monsters > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 v12 = __OFSUB__(v9, num_monsters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 v11 = v9 - num_monsters < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 *((short *)&window.pControlsTail + v9 + 1) = v23[v10 % v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 while ( v11 ^ v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v17 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v22 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 v17 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 v22 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 v18 = v16 % v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 v14 = v18 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 v15 = rand() % 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 v13 = 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 v14 = v15 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 v13 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 v14 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 v13 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 for ( dword_F8B1B4 = v26 * v13; i < v14; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 monster_y = pMonsterArenaPlacements[i].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 v21 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 _4BBF61_summon_actor((unsigned __int16)monster_ids[v21 % num_monsters], pMonsterArenaPlacements[i].x, monster_y, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 //----- (004BC8D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 Texture *__cdecl sub_4BC8D5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 GUIWindow *v5; // ebp@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 Texture *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 int v7; // [sp+10h] [bp-4h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 v0 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 v1 = (char *)ptr_507BC0->ptr_1C - 139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 if ( v3 < 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 if ( v3 <= 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 v0 = rand() % word_4F0F30[(signed int)v1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 + 345;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 if ( v3 == 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 v4 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 if ( v3 == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 v4 = rand() % 3 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 if ( v3 != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 v4 = rand() % 2 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 if ( v0 == 487 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 v0 = 486;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v5 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 _u->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 *(&dword_F8B164 + v2) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 while ( v2 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 //----- (004BCA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 GUIButton *__cdecl sub_4BCA33()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3696 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 pGlobalTXT_LocalizationStrings[74],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 return pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 //----- (004BCACC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 void __fastcall sub_4BCACC_bounties(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 signed int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 Player *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 signed int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 GUIWindow *v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 unsigned int v9; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 int v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 int v11; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 int v12; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 __int16 v13; // bp@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 int v14; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 GUIWindow *v15; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 int v16; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 int v17; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 __int16 v20; // ax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 __int16 v21; // ax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 __int16 v22; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 __int16 v23; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 __int16 v24; // ax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 int v25; // esi@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 __int16 v26; // ax@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 char v27; // zf@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 Player *v28; // edi@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 int v29; // eax@204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 void *v30; // esi@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 unsigned __int64 v31; // qax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 signed int v32; // edi@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 int v33; // eax@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 unsigned int v34; // eax@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 Player *v35; // edi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 signed int v36; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 int v37; // ecx@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 int v38; // esi@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 int v39; // edx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 void *v40; // edi@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 unsigned __int64 v41; // qax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 void *v42; // eax@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 signed int v43; // edi@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 int v44; // edx@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 int v45; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 unsigned int v46; // eax@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 void *v47; // eax@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 signed int v48; // edi@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 int v49; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 int v50; // eax@256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 unsigned int v51; // eax@257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 void *v52; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 signed int v53; // edi@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 int v54; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 signed int v55; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 int v56; // [sp+14h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 v55 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 if ( !pDialogueWindow->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 if ( v2 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v6 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v7 = v6->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v4 += v5++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 while ( v5 < v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 && (signed __int64)v6->uExperience < 1000 * v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 && (v1 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 + pParty->uDaysPlayed % 7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 || dword_F8B198 != 23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 || v55 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3812 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 ptr_5076F4 = pDialogueWindow->CreateButton(
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3814 526,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3815 445,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3816 75,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3817 33,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, nullstring, (Texture *)v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 if ( uActiveCharacter != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 dword_F8B19C = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 if ( v3 < 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 v9 = pIcons_LOD->LoadTexture((&off_4F03B8)[4 * v3], TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 dword_F8B164 = &pIcons_LOD->pTextures[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 if ( v3 > 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 if ( v3 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 if ( v3 != 23 && v3 != 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 if ( v3 != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 if ( v3 <= (signed int)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 if ( v3 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 if ( v3 <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 if ( v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 v34 = pIcons_LOD->LoadTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 pItemsTable->pItems[v33].pIconName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 while ( v32 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 sub_4BC8D5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 v31 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 + (signed __int64)((double)(0xA8C000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 if ( v3 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 if ( v55 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 v10 = (int)((char *)v8->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 v56 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 v11 = 8 * v10 + 11325428;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 pParty->field_75A[v12] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 *(_QWORD *)v11 = (signed __int64)((double)(309657600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v14 = rand() % 258;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v15 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 pParty->field_750[v12] = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 v16 = (int)((char *)v15->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 v18 = v17 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 v20 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 v21 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 v22 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 v23 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 v24 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 v10 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 v25 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 v26 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 v27 = pParty->field_75A[v25] == v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 word_F8B1A0 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 v27 = v26 == v13;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4079 v29 = (int)pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 if ( v27 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4081 v29 = (int)pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 dword_F8B1A4 = (char *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 if ( v26 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 v28 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 v28->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 while ( (signed int)v28 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 pParty->field_750[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 pParty->field_75A[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 v1 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4101 dword_F8B1A4 = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 if ( v55 == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 if ( v55 > 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 switch ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 case 96:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4119 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 sub_4B3703((void *)dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 case 101:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4124 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 dword_F8B19C = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 dword_F8B19C = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 dword_F8B19C = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 if ( v55 != 95 && v55 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 if ( v55 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 dword_F8B19C = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 if ( v55 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 dword_F8B19C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 if ( v55 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 if ( v55 > 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 if ( v55 <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 v35 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 if ( v37 < v36 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 v37 = v36 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 v38 = (int)(&v35->uIntelligence + v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 if ( !*(short *)v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 if ( pParty->uNumGold < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 if ( dword_F8B198 == 30 || dword_F8B198 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 v39 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 v39 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 Party::TakeGold(v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 *(short *)v38 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 v35->PlaySound(78, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 if ( v55 == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4201 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 dword_F8B19C = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 sub_421B2C_PlaceInInventory_or_DropPickedItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 GenerateShopItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 sub_4B8F94();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 v40 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 v41 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 pParty->field_3C.field_50[2 * (int)v40] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 if ( v55 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 v49 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 v54 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 //----- (004BD8B5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 signed int __cdecl sub_4BD8B5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 int v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 int v1; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 unsigned int v2; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 const char *v3; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 pKeyActionMap->_459ED1(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 if ( array_5913D8[6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 if ( dword_F8B19C != 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 && dword_F8B19C != 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 && dword_F8B19C != 97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 && dword_F8B19C != 5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 && dword_F8B19C != 4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 && dword_F8B164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 dword_F8B164->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 dword_F8B164 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 if ( v0 && v0 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 if ( v0 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 _4B4224_UpdateNPCTopics((int)((char *)array_5913D8[6] - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 if ( v0 != 94 && v0 != 96 && v0 != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 if ( v0 == 3 || v0 == 5 || v0 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 dword_F8B19C = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 if ( v0 != 102 && v0 != 103 && v0 != 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 sub_4B3B42(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 dword_F8B19C = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 if ( uNumDialogueNPCPortraits != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 ptr_5076F4 = ptr_507BC0->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 if ( uNumDialogueNPCPortraits > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 v3 = byte_591180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 *(&_4E5E50_transui_x + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 0x3Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 0x49u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 0x19Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 v2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 v3 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 while ( (signed int)v2 < uNumDialogueNPCPortraits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 //----- (004BDB56) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 void __cdecl sub_4BDB56_buy_skill____()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 Player *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 signed int v1; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 unsigned int v2; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 int v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 float v4; // ST1C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 signed int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 signed int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 char v7; // zf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 const char *v9; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 signed int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 unsigned int v11; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 int v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 void *v13; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 signed int v14; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 unsigned int v15; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 GUIWindow *v16; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 POINT *v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 int v18; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 void *v19; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 ItemGen *v20; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 float v21; // ST1C_4@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 signed int v22; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 int v23; // ebx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 int v24; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 int v26; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 Player *v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 POINT *v28; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 int v29; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 void *v30; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 int v31; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 ItemGen *v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 float v33; // ST1C_4@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 signed int v34; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 int v35; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 bool v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 unsigned int v37; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 int v38; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 int v39; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 int v40; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 int v41; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 int v42; // esi@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 signed int v43; // ebx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 int v44; // ecx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 unsigned __int16 *pSkill; // esi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 signed int v46; // [sp-18h] [bp-CCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 unsigned int v47; // [sp-14h] [bp-C8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 signed int v48; // [sp-10h] [bp-C4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 signed int v49; // [sp-Ch] [bp-C0h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 int v50; // [sp-8h] [bp-BCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 int v51; // [sp-4h] [bp-B8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 unsigned int v52; // [sp-4h] [bp-B8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 int v53; // [sp+0h] [bp-B4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 unsigned int v54; // [sp+0h] [bp-B4h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 int v55; // [sp+0h] [bp-B4h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 int v56; // [sp+0h] [bp-B4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 POINT v57; // [sp+10h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 POINT v58; // [sp+18h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 POINT v59; // [sp+20h] [bp-94h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 POINT v60; // [sp+28h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 POINT v61; // [sp+30h] [bp-84h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 POINT v62; // [sp+38h] [bp-7Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 POINT v63; // [sp+40h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 POINT v64; // [sp+48h] [bp-6Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 POINT v65; // [sp+50h] [bp-64h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 POINT v66; // [sp+58h] [bp-5Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 POINT v67; // [sp+60h] [bp-54h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 POINT a2; // [sp+68h] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 POINT v69; // [sp+70h] [bp-44h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 POINT v70; // [sp+78h] [bp-3Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 POINT v71; // [sp+80h] [bp-34h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 POINT v72; // [sp+88h] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 bool v73; // [sp+90h] [bp-24h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 int v74; // [sp+94h] [bp-20h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 int a6; // [sp+98h] [bp-1Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 int a3; // [sp+9Ch] [bp-18h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 Player *v77; // [sp+A0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 unsigned int v79; // [sp+A8h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 int v80; // [sp+ACh] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 ItemGen *_this; // [sp+B0h] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 v77 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 if ( dword_F8B19C > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 if ( dword_F8B19C < 36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 if ( dword_F8B19C <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 v42 = dword_F8B19C - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 v44 = v43 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 if ( v44 < v43 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 v44 = v43 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v42] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 pSkill = &v0->pActiveSkills[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 if ( !*pSkill )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 if ( pParty->uNumGold < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 v13 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 v55 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 Party::TakeGold(v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 *pSkill = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 v51 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 if ( dword_F8B19C != 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 sub_421EA6_OnInventoryLeftClick();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 if ( dword_F8B19C == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 v17 = pMouse->GetCursorPos(&v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 v19 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 //v21 = p2DEvents_minus1__20[13 * (signed int)v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 _this = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 v22 = v20->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 v23 = v0->_4B8142(v22, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 v80 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 if ( pParty->uNumGold < v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 v9 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 v20->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 memcpy(&v0->pDarkSpellbook.bIsSpellAvailable[36 * v25 + 5], v20, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 v54 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 v9 = pGlobalTXT_LocalizationStrings[563]; // "Pack is Full!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 v28 = pMouse->GetCursorPos(&v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 if ( !v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 v31 = 9 * (v29 - 1 + 12 * (int)v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 v32 = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 _this = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 _this = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 v32 = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 v34 = v32->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 v80 = v0->_4B8142(v34, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 LOWORD(v35) = GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 v74 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v36 = v0->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 uNumSeconds = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 v73 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 v37 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 a3 = pMapStats->pInfos[v37]._steal_perm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 v38 = GetPartyReputation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 if ( v73 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 if ( !uNumSeconds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 if ( pParty->uNumGold < v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 if ( uNumSeconds != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 if ( uNumSeconds != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 v39 = v0->AddItem(0xFFFFFFFFu, v32->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 v32->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v7 = v73 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 v40 = (int)((char *)v0 + 36 * v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 memcpy((void *)(v40 + 496), v32, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 v41 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 if ( uNumSeconds == 1 || uNumSeconds == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 *(char *)(v40 + 517) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 dword_F8B1E4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 viewparams->bRedrawGameUI = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 _this->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 v27 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 v51 = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 v27->PlaySound(v51, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 v14 = pMouse->GetCursorPos(&v71)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 if ( pMouse->GetCursorPos(&v67)->x <= 13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 || pMouse->GetCursorPos(&v65)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 v16 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 if ( sub_4BDAAF((ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5], (int)ptr_507BC0->ptr_1C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 v51 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 v0->PlaySound(79, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 pAudioPlayer->PlaySound(SOUND_27, v46, v47, v48, v49, v50, v52, v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 v10 = pMouse->GetCursorPos(&v62)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 v79 = (v10 >> 5) + 14 * ((pMouse->GetCursorPos(&v66)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 if ( pMouse->GetCursorPos(&v58)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 if ( pMouse->GetCursorPos(&v64)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 v12 = (int)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v11 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 if ( !(*(char *)(v12 + 20) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 *(int *)(v12 + 20) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 v0->PlaySound(73, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 v9 = pGlobalTXT_LocalizationStrings[569];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 v51 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 v79 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v70)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 if ( pMouse->GetCursorPos(&v60)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 if ( pMouse->GetCursorPos(&v72)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 v3 = (int)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 auto _v = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 v5 = _v->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 v6 = v0->_4B81C3(v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 v7 = (*(char *)(v3 + 20) & 2) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 v80 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 v8 = *(int *)(v3 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 LOBYTE(v8) = v8 & 0xFD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 *(int *)(v3 + 20) = v8 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 v0->PlaySound(74, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 v9 = pGlobalTXT_LocalizationStrings[570];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 ShowStatusBarString(v9, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 HousePlaySomeSound((unsigned int)v13, v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 v51 = 79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 v27 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 //----- (004BE386) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 void __fastcall log_error(const char *pMessage)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 FILE *f; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 FILE *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 v1 = pMessage;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 f = fopen("errorlog.txt", "a");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v3 = f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 if ( f )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 fprintf(f, "%s\n", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 fflush(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 //----- (004BE3BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 FrameTableTxtLine *texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 signed int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 unsigned int v4; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 FrameTableTxtLine *result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 signed int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 static struct FrameTableTxtLine static_stru_F8BA58; // weak
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 static_stru_F8BA58.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 if ( _this && *_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 v2 = (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 v4 = _this - (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 v5 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 if ( v5 != 32 && v5 != 44 && v5 != 9 || v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 if ( v5 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 if ( v2[v4 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 if ( static_stru_F8BA58.field_0 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 while ( (unsigned int)v2 < (unsigned int)&unk_F8BA50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 memcpy(a2, &static_stru_F8BA58, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 // F8BA58: using guessed type FrameTableTxtLine static_stru_F8BA58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 //----- (004BE485) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 FrameTableTxtLine *result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 unsigned int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 stru_F8B5E8.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 if ( pString && *pString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 v2 = (char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 v7 = pString - (const char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 v5 = v2[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 if ( v5 == ',' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 if ( v5 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 if ( v5 == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 if ( v2[v7 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 if ( stru_F8B5E8.field_0 < 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 if ( (unsigned int)v2 < (unsigned int)&unk_F8B5E0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 memcpy(a2, &stru_F8B5E8, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 // F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 //----- (004BE571) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 int i; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 result = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 if ( a3 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 for ( i = 0; i < a3; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 if ( a1 == a2[i] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 if ( i == a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 a2[a3] = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 result = a3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 //----- (004BF91E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 unsigned int __thiscall GameOverMenu(void *ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 unsigned int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 char *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 char *v4; // ST24_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 int v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 char *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 char *v7; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 char *v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 char *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 unsigned int v10; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 MSG Msg; // [sp+88h] [bp-48h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 void *v15; // [sp+A8h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 char *pInString; // [sp+ACh] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 unsigned int v17; // [sp+B0h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 unsigned int v19; // [sp+B8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 int v20; // [sp+BCh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 int i; // [sp+C0h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 v15 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 //RGBTexture::RGBTexture(&this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 BYTE1(dword_6BE364_game_settings_1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 pRenderer->ClearBlack();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 _449B57_test_bit(pParty->_award_bits, 99);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 _this.Load("winbg.pcx", 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 pRenderer->DrawTextureRGB(0, 0, &_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 free(_this.pPixels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 _this.pPixels = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5113 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 pWindow.uFrameX = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 pWindow.uFrameY = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 pWindow.uFrameWidth = 469;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 pWindow.uFrameHeight = 338;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 pWindow.uFrameZ = 543;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 pWindow.uFrameW = 397;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 pFont = LoadFont("endgame.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 99) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 v1 = pGlobalTXT_LocalizationStrings[675];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 result = _449B57_test_bit(pParty->_award_bits, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 if ( !(short)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 v1 = pGlobalTXT_LocalizationStrings[676];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 pInString = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 v23 = pParty->uTimePlayed - 138240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 v17 = v19 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 pWindow.DrawText2(pFont, 1u, 0x23u, 1u, pGlobalTXT_LocalizationStrings[9], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 v3 = pParty->pPlayers[0].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 v23 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 v4 = pClassNames[(unsigned __int8)v3[17]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 v5 = ((Player *)(v3 - 168))->GetBaseLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 pWindow.DrawText2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 pFont,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 v23 += __PAIR__(*(int *)(i - 4), *(int *)(i - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 i += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 if ( i >= (signed int)&pParty->pPickedItem.uNumCharges )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 v23 = (signed __int64)v23 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 pWindow.DrawText2(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 v7 = pGlobalTXT_LocalizationStrings[56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 if ( v17 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 v7 = pGlobalTXT_LocalizationStrings[57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 v8 = pGlobalTXT_LocalizationStrings[146];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 if ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 v8 = pGlobalTXT_LocalizationStrings[148];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 v9 = pGlobalTXT_LocalizationStrings[245];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 if ( v14 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 v9 = pGlobalTXT_LocalizationStrings[132];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 sprintfex(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 pRenderer->pBeforePresentFunction();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 pRenderer->_49F1BC("MM7_Win.Pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 pAllocator->FreeChunk(pFont);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 if ( v15 == (void *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 LODWORD(v23) = GetTickCount() + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 while ( (unsigned int)v23 > GetTickCount() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 v10 = PeekMessageA(&Msg, 0, 0, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 pMessageQueue_50CBD0->uNumMessages = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 pKeyActionMap->uLastKeyPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 while ( !pKeyActionMap->uLastKeyPressed );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
5259
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 //----- (004C0262) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 void Viewport::SetScreen(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 unsigned int x; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 unsigned int z; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 unsigned int w; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 char no_3d; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 if ( (signed int)uX > (signed int)uZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 z = uZ ^ uX ^ uZ; // swap x and z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 x = z ^ uZ ^ uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 if ( (signed int)uY > (signed int)uW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 w = uW ^ uY ^ uW; // swap y and w
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 y = w ^ uW ^ uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 this->uScreenX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 this->uScreenY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 this->uScreenZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 this->uScreenW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 no_3d = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 this->uScreenWidth = z - x + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 this->uScreenCenterX = (signed int)(z + x) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 if ( no_3d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 v10 = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 this->uScreenHeight = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 this->uScreenCenterY = this->uScreenW - ((unsigned __int64)(this->field_30 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 this->uScreenHeight = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 this->uScreenCenterY = (signed int)(w + y) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 SetViewport(this->uScreenX, this->uScreenY, this->uScreenZ, this->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 //----- (004C02F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 void Viewport::_4C02F8(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 unsigned int v2; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 v2 = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 this->field_30 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 SetScreen(this->uScreenX, this->uScreenY, this->uScreenZ, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 //----- (004C0312) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 void Viewport::SetViewport(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 unsigned int x; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 unsigned int z; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 unsigned int w; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 if ( (signed int)uX < (signed int)this->uScreenX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 x = this->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 if ( (signed int)uY < (signed int)this->uScreenY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 y = this->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 if ( (signed int)uZ > (signed int)this->uScreenZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 z = this->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 if ( (signed int)uW > (signed int)this->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 w = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 this->uViewportY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 this->uViewportX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 this->uViewportZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 this->uViewportW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 //----- (004D6FB0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 __int16 v8; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 int v9; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 unsigned __int8 v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 v11 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 v10 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 if ( v10 ^ v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 v7 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 v8 = *(short *)(*(int *)(v1 + 52) + 2 * v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 *(short *)result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 //----- (004D705A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 int /*__usercall*/ sr_sub_4D705A/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 unsigned int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 unsigned int v8; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 __int16 v9; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 unsigned int v10; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 unsigned int v11; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 unsigned __int8 v12; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 unsigned __int8 v13; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 v10 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 v11 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 v11 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 v10 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 if ( (signed int)v11 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 v11 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 if ( (signed int)v10 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 v10 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 + (*(int *)(v1 + 12) & (v11 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 + ((*(int *)(v1 + 8) & v10) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 v13 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 v12 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 if ( v12 ^ v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 v8 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 v8 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 v7 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 if ( (signed int)v8 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 v8 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 if ( (signed int)v7 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 v7 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v9 = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 + (*(int *)(v1 + 12) & (v8 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 + ((*(int *)(v1 + 8) & v7) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 //----- (004D714C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 int __cdecl sr_sub_4D714C(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 unsigned __int16 v9; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 unsigned int *v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 int v11; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 int v12; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 unsigned __int8 v13; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 unsigned __int8 v14; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 v12 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 *(short *)(result + 2) = v2->field_34_palette[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 v14 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 v13 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 v8 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 v9 = v2->field_34_palette[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 v10 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 v11 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 *v10 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 *(v10 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 // 4D714C: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 //----- (004D71F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 int __cdecl sr_sub_4D71F8(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 unsigned int v9; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 unsigned __int16 v10; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 unsigned int *v11; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 int v12; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 int v13; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 unsigned int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 unsigned __int8 v15; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 unsigned __int8 v16; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 v13 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 v14 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 v14 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 v13 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 if ( (signed int)v14 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 v14 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 if ( v13 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 v13 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 *(short *)(result + 2) = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 + (v2->field_C & (v14 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 + ((v2->field_8 & (unsigned int)v13) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 v16 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 v15 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 if ( v15 ^ v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 v8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 v9 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 v8 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 if ( (signed int)v9 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 v9 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 if ( v8 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 v8 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 v10 = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 + (v2->field_C & (v9 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 + ((v2->field_8 & (unsigned int)v8) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 v11 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 v12 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 *(short *)result = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 *(v11 - 1) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 // 4D71F8: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 //----- (004D72EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 int /*__usercall*/ sr_sub_4D72EC/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 unsigned int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 unsigned int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 unsigned int v10; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 unsigned int v11; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 int v12; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 unsigned __int8 v13; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 unsigned __int8 v14; // of@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 v10 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 v11 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 v10 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 v11 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 if ( (signed int)v10 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 v10 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 if ( (signed int)v11 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 v11 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 v12 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 + (*(int *)(v1 + 12) & (v10 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 + ((*(int *)(v1 + 8) & v11) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 v14 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v13 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 v7 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v8 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 v7 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 v8 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 if ( (signed int)v7 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v7 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 if ( (signed int)v8 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 v8 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 + (*(int *)(v1 + 12) & (v7 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 + ((*(int *)(v1 + 8) & v8) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 *(short *)result = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 //----- (004D73DF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 int /*__usercall*/ sr_sub_4D73DF/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 unsigned __int8 v9; // sf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 unsigned __int8 v10; // of@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v8 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 if ( *(char *)(*(int *)(v1 + 56) + v8 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 v10 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 v9 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 if ( v9 ^ v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 v7 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 if ( *(char *)(*(int *)(v1 + 56) + v7 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 *(short *)result = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 + v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 //----- (004D754B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 void __cdecl sr_sub_4D754B(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 v5 = *((char *)a1->pTextureLOD + (a1->field_C & (v3 >> 16)) + (((unsigned int)v4 & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 a1->pColorBuffer = v11 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 a1->pDepthBuffer = v12 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 //----- (004D7630) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 void __cdecl sr_sub_4D7630(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 unsigned __int16 *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 unsigned __int16 v7; // bx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 unsigned __int16 *v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 unsigned int *v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 int v11; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 int v12; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 int v13; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 int v14; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873 v14 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 v3 = *((char *)a1->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 v4 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 v5 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 if ( v5 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 v5 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 if ( a2->field_8 - v5 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 v6 = a2->field_8 - v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 v3 += v6 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 v4 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 v7 = v4[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 v8 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 v9 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 *v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 *v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 a1->pColorBuffer = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 a1->pDepthBuffer = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v11 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 v12 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 v13 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 a1->field_30 = a1->field_4 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 a1->field_2C = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 v2 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 while ( v14 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 //----- (004D76ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 void __cdecl sr_sub_4D76ED(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 v5 = *((char *)a1->pTextureLOD + (a1->field_C & (v3 >> 16)) + (((unsigned int)v4 & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 v7 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 a1->pColorBuffer = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 a1->pDepthBuffer = v12 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 //----- (004D77D2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 void __cdecl sr_sub_4D77D2(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 unsigned __int16 *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 unsigned __int16 *v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984 int v6; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 unsigned __int16 v8; // bx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 unsigned int *v10; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 unsigned int *v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 int v13; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 int v14; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 int v15; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 v3 = a1->pTextureLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002 v4 = *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005 v5 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 if ( *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 v6 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 if ( v6 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 v6 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 if ( a2->field_8 - v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 v7 = a2->field_8 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 v4 += v7 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 v5 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 v8 = v5[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 v9 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 *a1->pColorBuffer = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 *v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 v11 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 a1->pDepthBuffer = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 v12 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 v13 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 v14 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 a1->field_30 = a1->field_4 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 a1->field_2C = v14 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 v2 = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 while ( v15 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 //----- (004D789A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 void __cdecl sr_sub_4D789A(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 int v7; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 int v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 unsigned __int16 v9; // bx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 int v10; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 unsigned int *v11; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 unsigned int *v12; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 int v13; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 int v15; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 v5 = *((char *)a1->pTextureLOD + (a1->field_C & (v3 >> 16)) + (((unsigned int)v4 & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 v11 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 *a1->pColorBuffer = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 *v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 v12 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 a1->pDepthBuffer = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 //----- (00451007) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6117 int stru350::sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6118 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6119 int a10, int a11)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6120 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6121 int v11; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6122 int result; // eax@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6123 int v13; // edi@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6124 int v14; // ecx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 double v15; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 double v16; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 float v17; // ST3C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 float v18; // ST38_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 unsigned int v19; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 int v21; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 unsigned int v22; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 unsigned int v23; // eax@29
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6134 unsigned __int16 *v24; // ecx@29
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6135 int v25; // edi@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6136 int v26; // ecx@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 double v27; // st7@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 double v28; // st6@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 float v29; // ST34_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 float v30; // ST30_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 unsigned int v31; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 int v32; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 int v33; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 unsigned int v34; // ecx@50
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6145 unsigned __int16 v35; // ax@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6146 unsigned __int16 *v36; // ecx@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6147 int v37; // edi@58
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6148 int v38; // ecx@60
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 double v39; // st7@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 double v40; // st6@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 float v41; // ST34_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 float v42; // ST30_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 unsigned int v43; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 int v44; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 int v45; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 unsigned int v46; // ecx@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 char v47; // al@79
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6158 unsigned __int16 *v48; // ecx@79
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6159 int v49; // edi@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6160 int v50; // ecx@88
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 double v51; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 double v52; // st6@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 float v53; // ST34_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 float v54; // ST30_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 unsigned int v55; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 int v56; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 int v57; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 unsigned int v58; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 unsigned int v59; // eax@107
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6170 unsigned __int16 *v60; // ecx@107
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6171 int v61; // edi@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6172 int v62; // ecx@113
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 double v63; // st7@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 double v64; // st6@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 float v65; // ST34_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 float v66; // ST30_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 unsigned int v67; // esi@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 int v68; // eax@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 int v69; // eax@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 unsigned int v70; // ecx@128
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6181 unsigned __int16 v71; // ax@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6182 unsigned __int16 *v72; // ecx@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6183 int v73; // edi@136
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6184 int v74; // ecx@138
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 double v75; // st7@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 double v76; // st6@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 float v77; // ST34_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 float v78; // ST30_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 unsigned int v79; // esi@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 int v80; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 int v81; // eax@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 unsigned int v82; // ecx@153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 char v83; // al@157
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6194 unsigned __int16 *v84; // ecx@157
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6195 int v85; // edi@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6196 int v86; // ecx@166
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 double v87; // st7@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 double v88; // st6@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 float v89; // ST34_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 float v90; // ST30_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 unsigned int v91; // esi@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 signed int v92; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 int v93; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 int v94; // eax@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 unsigned int v95; // ecx@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 unsigned int v96; // eax@185
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6207 unsigned __int16 *v97; // ecx@185
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6208 int v98; // edi@189
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6209 int v99; // ecx@191
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 double v100; // st7@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 double v101; // st6@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 float v102; // ST34_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 float v103; // ST30_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 unsigned int v104; // esi@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 signed int v105; // eax@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 int v106; // eax@196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 int v107; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 unsigned int v108; // ecx@206
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6219 unsigned __int16 v109; // ax@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6220 unsigned __int16 *v110; // ecx@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6221 int v111; // edi@214
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6222 int v112; // ecx@216
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 double v113; // st7@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 double v114; // st6@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 float v115; // ST34_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 float v116; // ST30_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 unsigned int v117; // esi@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 signed int v118; // eax@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 int v119; // eax@221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 int v120; // eax@223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 unsigned int v121; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 char v122; // al@235
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6233 unsigned __int16 *v123; // ecx@235
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 double v124; // [sp+Ch] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 double v125; // [sp+Ch] [bp-7Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 double v126; // [sp+Ch] [bp-7Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 double v127; // [sp+Ch] [bp-7Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6238 //double v128; // [sp+Ch] [bp-7Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6239 uint _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 double v129; // [sp+Ch] [bp-7Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 double v130; // [sp+Ch] [bp-7Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 double v131; // [sp+Ch] [bp-7Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 double v132; // [sp+Ch] [bp-7Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 double v133; // [sp+14h] [bp-74h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 double v134; // [sp+14h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 double v135; // [sp+14h] [bp-74h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 double v136; // [sp+14h] [bp-74h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6248 //double v137; // [sp+14h] [bp-74h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6249 uint _v137;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 double v138; // [sp+14h] [bp-74h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 double v139; // [sp+14h] [bp-74h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 double v140; // [sp+14h] [bp-74h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 double v141; // [sp+14h] [bp-74h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 double v142; // [sp+1Ch] [bp-6Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 double v143; // [sp+1Ch] [bp-6Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 double v144; // [sp+1Ch] [bp-6Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 double v145; // [sp+1Ch] [bp-6Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6258 //double v146; // [sp+1Ch] [bp-6Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6259 uint _v146;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 double v147; // [sp+1Ch] [bp-6Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 double v148; // [sp+1Ch] [bp-6Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 double v149; // [sp+1Ch] [bp-6Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 double v150; // [sp+1Ch] [bp-6Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 double v151; // [sp+24h] [bp-64h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 double v152; // [sp+24h] [bp-64h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 double v153; // [sp+24h] [bp-64h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 double v154; // [sp+24h] [bp-64h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6268 //double v155; // [sp+24h] [bp-64h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6269 uint _v155;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 double v156; // [sp+24h] [bp-64h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 double v157; // [sp+24h] [bp-64h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 double v158; // [sp+24h] [bp-64h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 double v159; // [sp+24h] [bp-64h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 int v160; // [sp+3Ch] [bp-4Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 int v161; // [sp+40h] [bp-48h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 int v162; // [sp+44h] [bp-44h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 int v163; // [sp+44h] [bp-44h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 int v164; // [sp+44h] [bp-44h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 int v165; // [sp+44h] [bp-44h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 int v166; // [sp+44h] [bp-44h]@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 int v167; // [sp+44h] [bp-44h]@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 int v168; // [sp+44h] [bp-44h]@194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 int v169; // [sp+44h] [bp-44h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 int v170; // [sp+48h] [bp-40h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 int v171; // [sp+48h] [bp-40h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 int v172; // [sp+48h] [bp-40h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 int v173; // [sp+48h] [bp-40h]@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 int v174; // [sp+48h] [bp-40h]@141
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6289 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 int *v176; // [sp+50h] [bp-38h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 int *v177; // [sp+50h] [bp-38h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 int *v178; // [sp+50h] [bp-38h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 int *v179; // [sp+50h] [bp-38h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 int *v180; // [sp+50h] [bp-38h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 int *v181; // [sp+50h] [bp-38h]@143
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6296 char *v182; // [sp+50h] [bp-38h]@169
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6297 char *v183; // [sp+50h] [bp-38h]@194
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6298 char *v184; // [sp+50h] [bp-38h]@219
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6299 unsigned __int16 *v185; // [sp+54h] [bp-34h]@38
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6300 unsigned __int16 *v186; // [sp+54h] [bp-34h]@63
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6301 unsigned __int16 *v187; // [sp+54h] [bp-34h]@91
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6302 unsigned __int16 *v188; // [sp+54h] [bp-34h]@116
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6303 unsigned __int16 *v189; // [sp+54h] [bp-34h]@141
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 signed int v190; // [sp+54h] [bp-34h]@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 signed int v191; // [sp+54h] [bp-34h]@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 signed int v192; // [sp+54h] [bp-34h]@220
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6307 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6308 unsigned __int16 *v194; // [sp+5Ch] [bp-2Ch]@32
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6309 unsigned __int16 *v195; // [sp+5Ch] [bp-2Ch]@57
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6310 unsigned __int16 *v196; // [sp+5Ch] [bp-2Ch]@85
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6311 unsigned __int16 *v197; // [sp+5Ch] [bp-2Ch]@110
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6312 unsigned __int16 *v198; // [sp+5Ch] [bp-2Ch]@135
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6313 unsigned __int16 *v199; // [sp+5Ch] [bp-2Ch]@163
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6314 unsigned __int16 *v200; // [sp+5Ch] [bp-2Ch]@188
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6315 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6316 //stru350 *v202; // [sp+60h] [bp-28h]@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6317 int v203; // [sp+64h] [bp-24h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6318 int v204; // [sp+64h] [bp-24h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6319 int v205; // [sp+64h] [bp-24h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6320 int v206; // [sp+64h] [bp-24h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6321 int v207; // [sp+64h] [bp-24h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6322 int v208; // [sp+64h] [bp-24h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6323 int v209; // [sp+64h] [bp-24h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6324 int v210; // [sp+64h] [bp-24h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6325 int v211; // [sp+64h] [bp-24h]@218
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 float v212; // [sp+6Ch] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 float v213; // [sp+6Ch] [bp-1Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 float v214; // [sp+6Ch] [bp-1Ch]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 float v215; // [sp+6Ch] [bp-1Ch]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 float v216; // [sp+6Ch] [bp-1Ch]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 float v217; // [sp+6Ch] [bp-1Ch]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 float v218; // [sp+6Ch] [bp-1Ch]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 float v219; // [sp+6Ch] [bp-1Ch]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 float v220; // [sp+6Ch] [bp-1Ch]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 float v221; // [sp+70h] [bp-18h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 float v222; // [sp+70h] [bp-18h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 float v223; // [sp+70h] [bp-18h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 float v224; // [sp+70h] [bp-18h]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 float v225; // [sp+70h] [bp-18h]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 float v226; // [sp+70h] [bp-18h]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 float v227; // [sp+70h] [bp-18h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 float v228; // [sp+70h] [bp-18h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 float v229; // [sp+70h] [bp-18h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 signed int v230; // [sp+74h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 signed int v231; // [sp+78h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 signed int v232; // [sp+78h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 signed int v233; // [sp+78h] [bp-10h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 signed int v234; // [sp+78h] [bp-10h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 signed int v235; // [sp+78h] [bp-10h]@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 signed int v236; // [sp+78h] [bp-10h]@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 signed int v237; // [sp+78h] [bp-10h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 signed int v238; // [sp+78h] [bp-10h]@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 signed int v239; // [sp+78h] [bp-10h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 __int64 v240; // [sp+7Ch] [bp-Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 __int64 v241; // [sp+7Ch] [bp-Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 __int64 v242; // [sp+7Ch] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 __int64 v243; // [sp+7Ch] [bp-Ch]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 __int64 v244; // [sp+7Ch] [bp-Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 __int64 v245; // [sp+7Ch] [bp-Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 unsigned int v246; // [sp+7Ch] [bp-Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 unsigned int v247; // [sp+7Ch] [bp-Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 unsigned int v248; // [sp+7Ch] [bp-Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 unsigned int v249; // [sp+80h] [bp-8h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 unsigned int v250; // [sp+80h] [bp-8h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 unsigned int v251; // [sp+80h] [bp-8h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 unsigned int v252; // [sp+84h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 unsigned int v253; // [sp+84h] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 unsigned int v254; // [sp+84h] [bp-4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 unsigned int v255; // [sp+84h] [bp-4h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 unsigned int v256; // [sp+84h] [bp-4h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 unsigned int v257; // [sp+84h] [bp-4h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 unsigned int v258; // [sp+84h] [bp-4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 unsigned int v259; // [sp+84h] [bp-4h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 unsigned int v260; // [sp+84h] [bp-4h]@218
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6375 signed int a6a; // [sp+A0h] [bp+18h]@10
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6376 float a6s; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6377 float a6t; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6378 unsigned int a6b; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6379 signed int a6c; // [sp+A0h] [bp+18h]@35
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6380 float a6u; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6381 float a6v; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6382 unsigned int a6d; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6383 signed int a6e; // [sp+A0h] [bp+18h]@60
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6384 float a6w; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6385 float a6x; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6386 unsigned int a6f; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6387 signed int a6g; // [sp+A0h] [bp+18h]@88
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6388 float a6y; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6389 float a6z; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6390 unsigned int a6h; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6391 signed int a6i; // [sp+A0h] [bp+18h]@113
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6392 float a6ba; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6393 float a6bb; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6394 unsigned int a6j; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6395 signed int a6k; // [sp+A0h] [bp+18h]@138
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6396 float a6bc; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6397 float a6bd; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6398 unsigned int a6l; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6399 signed int a6m; // [sp+A0h] [bp+18h]@166
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6400 float a6be; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6401 float a6bf; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6402 unsigned int a6n; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6403 signed int a6o; // [sp+A0h] [bp+18h]@191
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6404 float a6bg; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6405 float a6bh; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6406 unsigned int a6p; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6407 signed int a6q; // [sp+A0h] [bp+18h]@216
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6408 float a6bi; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6409 float a6bj; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6410 unsigned int a6r; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6411 int a9a; // [sp+ACh] [bp+24h]@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6412 int a9b; // [sp+ACh] [bp+24h]@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6413 int a9c; // [sp+ACh] [bp+24h]@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6414 int a9d; // [sp+ACh] [bp+24h]@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6415 int a9e; // [sp+ACh] [bp+24h]@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6416 int a9f; // [sp+ACh] [bp+24h]@189
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 v11 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6419 result = this->field_0.field_C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6420 //v202 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 if ( result != 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6428 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6433 if ( result != 32 || (result = (int)pDst, v193 = pDst, v231 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6435 v13 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6436 a9a = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 v14 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6440 a6a = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6441 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 LABEL_30:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6444 v193 = (unsigned __int16 *)((char *)v193 + a9a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 ++v231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 result = v231;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6447 if ( v231 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6451 v221 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6452 v212 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6453 v15 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6454 v16 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6457 a6s = (double)a6a / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6458 v151 = floorf(a6s + 0.5f);//a6s + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 v203 = v14 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6460 a6t = (double)(v14 + 1) / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6461 v142 = floorf(a6t + 0.5f);//a6t + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 v17 = (double)v231 / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6463 v133 = floorf(v17 + 0.5f);//v17 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 v18 = (double)(v231 + 1) / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6465 v124 = floorf(v18 + 0.5f);//v18 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v252 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6468 a6b = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 v240 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 if ( SLODWORD(v133) < SLODWORD(v124) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 v22 = (unsigned int)v240 / ((LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6476 a6b /= v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v252 /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 HIDWORD(v240) /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 if ( v22 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 v22 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6482 v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 v24 = v193;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6484 v193 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6485 *(_DWORD *)v24 = v23;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 v14 = v203;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6487 a6a = v203;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6488 if ( v203 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 v160 = LODWORD(v124) - LODWORD(v133);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6492 v175 = &pSrc[2 * (LODWORD(v151) + srcPitch * LODWORD(v133))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 while ( SLODWORD(v151) >= SLODWORD(v142) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 LABEL_24:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6496 v175 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 --v160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 if ( !v160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 v176 = (int *)v175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 v161 = LODWORD(v142) - LODWORD(v151);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 v20 = *v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 v13 = v20 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6511 v21 = _450FB1(v20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 LODWORD(v240) = v13 + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 ++v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 --v161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 if ( !v161 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 LODWORD(v240) = ((unsigned int)v21 >> 24) + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 LABEL_22:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6527 a6b += BYTE2(v21);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 v252 += BYTE1(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 HIDWORD(v240) += (unsigned __int8)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6532 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6533 v194 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v232 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6535 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6537 v25 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6538 a9b = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 v26 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6542 a6c = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6543 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 LABEL_55:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6546 v194 = (unsigned __int16 *)((char *)v194 + a9b);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 ++v232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 result = v232;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6549 if ( v232 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6553 v222 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6554 v213 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6555 v27 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6556 v28 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6559 a6u = (double)a6c / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6560 v125 = a6u + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 v204 = v26 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6562 a6v = (double)(v26 + 1) / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6563 v134 = a6v + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 v29 = (double)v232 / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 v143 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 v30 = (double)(v232 + 1) / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 v152 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 v31 = (LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 v253 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6570 a6d = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 v241 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 if ( SLODWORD(v143) < SLODWORD(v152) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 v34 = (unsigned int)v241 / ((LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 if ( v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6578 a6d /= v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 v253 /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 HIDWORD(v241) /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 if ( v34 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 v34 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6584 v35 = _450F55(HIDWORD(v241) | ((v253 | ((a6d | (v34 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 v36 = v194;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6586 ++v194;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6587 *v36 = v35;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 v26 = v204;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6589 a6c = v204;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6590 if ( v204 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 v170 = LODWORD(v152) - LODWORD(v143);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6594 v185 = &pSrc[2 * (LODWORD(v125) + srcPitch * LODWORD(v143))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 while ( SLODWORD(v125) >= SLODWORD(v134) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 LABEL_49:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6598 v185 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 --v170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 if ( !v170 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 v177 = (int *)v185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 v162 = LODWORD(v134) - LODWORD(v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 v32 = *v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 v25 = v32 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6613 v33 = _450FB1(v32);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 LODWORD(v241) = v25 + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 ++v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 --v162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 if ( !v162 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 LODWORD(v241) = ((unsigned int)v33 >> 24) + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 LABEL_47:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6629 a6d += BYTE2(v33);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 v253 += BYTE1(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 HIDWORD(v241) += (unsigned __int8)v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6634 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6635 v195 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 v233 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6637 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6639 v37 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 v38 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6643 a6e = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6644 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 LABEL_80:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6647 v195 = (unsigned __int16 *)((char *)v195 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 ++v233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 result = v233;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6650 if ( v233 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6654 v223 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6655 v214 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6656 v39 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6657 v40 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6660 a6w = (double)a6e / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6661 v126 = a6w + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 v205 = v38 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6663 a6x = (double)(v38 + 1) / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6664 v135 = a6x + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 v41 = (double)v233 / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 v144 = v41 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 v42 = (double)(v233 + 1) / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 v153 = v42 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 v43 = (LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 v254 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6671 a6f = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 v242 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 if ( SLODWORD(v144) < SLODWORD(v153) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 v46 = (unsigned int)v242 / ((LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6679 a6f /= v43;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 v254 /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 HIDWORD(v242) /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 if ( v46 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 v46 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6685 v47 = _450F55(HIDWORD(v242) | ((v254 | ((a6f | (v46 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6686 v48 = v195;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6687 v195 = (unsigned __int16 *)((char *)v195 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6688 *(_BYTE *)v48 = v47;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 v38 = v205;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6690 a6e = v205;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6691 if ( v205 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 v171 = LODWORD(v153) - LODWORD(v144);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6695 v186 = &pSrc[2 * (LODWORD(v126) + srcPitch * LODWORD(v144))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 while ( SLODWORD(v126) >= SLODWORD(v135) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 LABEL_74:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6699 v186 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 --v171;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 if ( !v171 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 v178 = (int *)v186;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 v163 = LODWORD(v135) - LODWORD(v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 v44 = *v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 v37 = v44 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6714 v45 = _450FB1(v44);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 LODWORD(v242) = v37 + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 --v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 ++v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 --v163;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 if ( !v163 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 LODWORD(v242) = ((unsigned int)v45 >> 24) + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 LABEL_72:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6730 a6f += BYTE2(v45);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 v254 += BYTE1(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 HIDWORD(v242) += (unsigned __int8)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6735 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6740 if ( result != 32 || (result = (int)pDst, v196 = pDst, v234 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6742 v49 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6743 a9c = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 v50 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6747 a6g = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6748 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 LABEL_108:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6751 v196 = (unsigned __int16 *)((char *)v196 + a9c);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 ++v234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 result = v234;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6754 if ( v234 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6758 v224 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6759 v215 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6760 v51 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6761 v52 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6764 a6y = (double)a6g / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6765 v127 = a6y + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 v206 = v50 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6767 a6z = (double)(v50 + 1) / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6768 v136 = a6z + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 v53 = (double)v234 / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 v145 = v53 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 v54 = (double)(v234 + 1) / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 v154 = v54 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 v55 = (LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 v255 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6775 a6h = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 v243 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 if ( SLODWORD(v145) < SLODWORD(v154) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 v58 = (unsigned int)v243 / ((LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6783 a6h /= v55;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v255 /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 HIDWORD(v243) /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 if ( v58 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 v58 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6789 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 v60 = v196;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6791 v196 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6792 *(_DWORD *)v60 = v59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v50 = v206;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6794 a6g = v206;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6795 if ( v206 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 v172 = LODWORD(v154) - LODWORD(v145);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6799 v187 = &pSrc[LODWORD(v127) + srcPitch * LODWORD(v145)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 while ( SLODWORD(v127) >= SLODWORD(v136) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 LABEL_102:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6803 v187 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 --v172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 if ( !v172 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 v179 = (int *)v187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 v164 = LODWORD(v136) - LODWORD(v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6812 v56 = *(_WORD *)v179;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 v49 = v56 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6818 v57 = _450FB1(v56);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 LODWORD(v243) = v49 + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 --v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 v179 = (int *)((char *)v179 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 --v164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 if ( !v164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 LODWORD(v243) = ((unsigned int)v57 >> 24) + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 LABEL_100:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6834 a6h += BYTE2(v57);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 v255 += BYTE1(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 HIDWORD(v243) += (unsigned __int8)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6839 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6840 v197 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 v235 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6842 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6844 v61 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6845 a9d = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 v62 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6849 a6i = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6850 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 LABEL_133:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6853 v197 = (unsigned __int16 *)((char *)v197 + a9d);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 ++v235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 result = v235;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6856 if ( v235 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6860 v225 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6861 v216 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6862 v63 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6863 v64 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6866 a6ba = (double)a6i / v225 * v216;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6867 _v128 = floorf(a6ba + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6868 //v128 = a6ba + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 v207 = v62 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6870 a6bb = (double)(v62 + 1) / v225 * v216;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6871 //v137 = a6bb + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6872 _v137 = floorf(a6bb + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 v65 = (double)v235 / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6874 //v146 = v65 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6875 _v146 = floorf(v65 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 v66 = (double)(v235 + 1) / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6877 //v155 = v66 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6878 _v155 = floorf(v66 + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6879 //v67 = (LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6880 v67 = (_v155 - _v146) * (_v137 - _v128);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 v256 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6882 a6j = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 v244 = 0i64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6884 //if ( SLODWORD(v146) < SLODWORD(v155) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6885 if (_v146 < _v155)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 LABEL_128:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6888 //v70 = (unsigned int)v244 / ((LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128)));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6889 v70 = (unsigned int)v244 / ((_v155 - _v146) * (_v137 - _v128));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 if ( v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6892 a6j /= v67;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 v256 /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 HIDWORD(v244) /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 if ( v70 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 v70 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6898 v71 = _450F55(HIDWORD(v244) | ((v256 | ((a6j | (v70 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 v72 = v197;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6900 ++v197;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6901 *v72 = v71;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 v62 = v207;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6903 a6i = v207;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6904 if ( v207 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 goto LABEL_133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6907 //v173 = LODWORD(v155) - LODWORD(v146);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6908 v173 = _v155 - _v146;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6909 //v188 = &pSrc[LODWORD(v128) + srcPitch * LODWORD(v146)];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6910 v188 = &pSrc[_v128 + srcPitch * _v146];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6911 //while ( SLODWORD(v128) >= SLODWORD(v137) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6912 while (_v128 >= _v137)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 LABEL_127:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6915 v188 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 --v173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 if ( !v173 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 v180 = (int *)v188;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6921 //v165 = LODWORD(v137) - LODWORD(v128);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6922 v165 = _v137 - _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6925 v68 = *(_WORD *)v180;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 v61 = v68 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6931 v69 = _450FB1(v68);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 LODWORD(v244) = v61 + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 if ( v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v180 = (int *)((char *)v180 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 --v165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 if ( !v165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 goto LABEL_127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 LODWORD(v244) = ((unsigned int)v69 >> 24) + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 LABEL_125:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6947 a6j += BYTE2(v69);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v256 += BYTE1(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 HIDWORD(v244) += (unsigned __int8)v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6952 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6953 v198 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 v236 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6955 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6957 v73 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 v74 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6961 a6k = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6962 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 LABEL_158:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6965 v198 = (unsigned __int16 *)((char *)v198 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 ++v236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 result = v236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6968 if ( v236 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6972 v226 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6973 v217 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6974 v75 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6975 v76 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6978 a6bc = (double)a6k / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6979 v129 = a6bc + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 v208 = v74 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6981 a6bd = (double)(v74 + 1) / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6982 v138 = a6bd + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 v77 = (double)v236 / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 v147 = v77 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 v78 = (double)(v236 + 1) / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 v156 = v78 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 v257 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 v79 = (LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6989 a6l = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 v245 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 if ( SLODWORD(v147) < SLODWORD(v156) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 LABEL_153:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v82 = (unsigned int)v245 / ((LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 if ( v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6997 a6l /= v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v257 /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 HIDWORD(v245) /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 if ( v82 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 v82 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7003 v83 = _450F55(HIDWORD(v245) | ((v257 | ((a6l | (v82 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7004 v84 = v198;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7005 v198 = (unsigned __int16 *)((char *)v198 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7006 *(_BYTE *)v84 = v83;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 v74 = v208;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7008 a6k = v208;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7009 if ( v208 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 goto LABEL_158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 v174 = LODWORD(v156) - LODWORD(v147);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7013 v189 = &pSrc[LODWORD(v129) + srcPitch * LODWORD(v147)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 while ( SLODWORD(v129) >= SLODWORD(v138) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 LABEL_152:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7017 v189 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 --v174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 if ( !v174 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 goto LABEL_153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 v166 = LODWORD(v138) - LODWORD(v129);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 v181 = (int *)v189;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7026 v80 = *(_WORD *)v181;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 v73 = v80 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7032 v81 = _450FB1(v80);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 LODWORD(v245) = v73 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 --v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 v181 = (int *)((char *)v181 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 --v166;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 if ( !v166 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 LODWORD(v245) = ((unsigned int)v81 >> 24) + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 LABEL_150:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7048 a6l += BYTE2(v81);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 v257 += BYTE1(v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 HIDWORD(v245) += (unsigned __int8)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7053 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 if ( result == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7056 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7057 v201 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 v239 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7059 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7061 v111 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 v112 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7065 a6q = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7066 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 goto LABEL_236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7068 v229 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7069 v220 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7070 v113 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7071 v114 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7074 a6bi = (double)a6q / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7075 v132 = a6bi + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 v211 = v112 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7077 a6bj = (double)(v112 + 1) / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7078 v141 = a6bj + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 v115 = (double)v239 / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 v150 = v115 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 v116 = (double)(v239 + 1) / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 v159 = v116 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 v251 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 v260 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7086 a6r = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 v248 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 if ( SLODWORD(v150) >= SLODWORD(v159) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 goto LABEL_231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 v169 = LODWORD(v159) - LODWORD(v150);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7091 v184 = (char *)pSrc + srcPitch * LODWORD(v150);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 v118 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 v192 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 while ( v118 < SLODWORD(v141) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7098 v119 = (unsigned __int8)v184[v192];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 v111 = v119 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7104 v120 = _450FB1(v119);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 v248 += v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 if ( !v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 --v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 goto LABEL_228;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 v248 += (unsigned int)v120 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7119 a6r += BYTE2(v120);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 v260 += BYTE1(v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 v251 += (unsigned __int8)v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 LABEL_228:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 ++v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 v118 = v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7126 v184 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 --v169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 while ( v169 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 LABEL_231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 if ( v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7134 a6r /= v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 v260 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 v251 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 if ( v121 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 v121 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7140 v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7141 v123 = v201;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7142 v201 = (unsigned __int16 *)((char *)v201 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7143 *(_BYTE *)v123 = v122;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 v112 = v211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7145 a6q = v211;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7146 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7147 while ( v211 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 LABEL_236:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7149 v201 = (unsigned __int16 *)((char *)v201 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 ++v239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 result = v239;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7152 if ( v239 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 if ( result == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7159 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7160 v200 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 v238 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7162 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7164 v98 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7165 a9f = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 v99 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7169 a6o = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7170 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 goto LABEL_211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7172 v228 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7173 v219 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7174 v100 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7175 v101 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7178 a6bg = (double)a6o / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7179 v131 = a6bg + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 v210 = v99 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7181 a6bh = (double)(v99 + 1) / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7182 v140 = a6bh + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 v102 = (double)v238 / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 v149 = v102 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 v103 = (double)(v238 + 1) / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 v158 = v103 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 v250 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v259 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7190 a6p = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v247 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 if ( SLODWORD(v149) >= SLODWORD(v158) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 goto LABEL_206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v168 = LODWORD(v158) - LODWORD(v149);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7195 v183 = (char *)pSrc + srcPitch * LODWORD(v149);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v105 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v191 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 while ( v105 < SLODWORD(v140) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7202 v106 = (unsigned __int8)v183[v191];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 v98 = v106 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7208 v107 = _450FB1(v106);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 v247 += v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 if ( !v98 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 --v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 goto LABEL_203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 v247 += (unsigned int)v107 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7223 a6p += BYTE2(v107);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 v259 += BYTE1(v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 v250 += (unsigned __int8)v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 LABEL_203:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 ++v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 v105 = v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7230 v183 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 --v168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 while ( v168 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 LABEL_206:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 if ( v104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7238 a6p /= v104;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v259 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 v250 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 if ( v108 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 v108 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7244 v109 = _450F55(v250 | ((v259 | ((a6p | (v108 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 v110 = v200;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7246 ++v200;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7247 *v110 = v109;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 v99 = v210;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7249 a6o = v210;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7250 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7251 while ( v210 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 LABEL_211:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7253 v200 = (unsigned __int16 *)((char *)v200 + a9f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 ++v238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 result = v238;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7256 if ( v238 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7261 if ( result != 32 || (result = (int)pDst, v199 = pDst, v237 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7263 v85 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7264 a9e = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 v86 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7268 a6m = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7269 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 goto LABEL_186;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7271 v227 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7272 v218 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7273 v87 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7274 v88 = (double)srcHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7275 do
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7276 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7277 a6be = (double)a6m / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7278 v130 = a6be + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 v209 = v86 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7280 a6bf = (double)(v86 + 1) / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7281 v139 = a6bf + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 v89 = (double)v237 / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 v148 = v89 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 v90 = (double)(v237 + 1) / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 v157 = v90 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 v249 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 v258 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7289 a6n = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v246 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 if ( SLODWORD(v148) >= SLODWORD(v157) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 v167 = LODWORD(v157) - LODWORD(v148);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7294 v182 = (char *)pSrc + srcPitch * LODWORD(v148);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 v92 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 v190 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 while ( v92 < SLODWORD(v139) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7301 v93 = (unsigned __int8)v182[v190];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 v85 = v93 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7307 v94 = _450FB1(v93);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 v246 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 if ( !v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 --v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 goto LABEL_178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 v246 += (unsigned int)v94 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7322 a6n += BYTE2(v94);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 v258 += BYTE1(v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 v249 += (unsigned __int8)v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 LABEL_178:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 ++v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 v92 = v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7329 v182 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 --v167;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 while ( v167 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 if ( v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7337 a6n /= v91;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v258 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 v249 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 if ( v95 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 v95 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7343 v96 = _450F55(v249 | ((v258 | ((a6n | (v95 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 v97 = v199;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7345 v199 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7346 *(_DWORD *)v97 = v96;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 v86 = v209;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7348 a6m = v209;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7349 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7350 while ( v209 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 LABEL_186:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7352 v199 = (unsigned __int16 *)((char *)v199 + a9e);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 ++v237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 result = v237;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7355 if ( v237 < dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7368
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7369
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 //----- (0044E1EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 int TextureFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 TextureFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 const void *v5; // ST0C_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 void *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 FILE *v7; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 signed int v9; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 int v11; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 int v12; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 signed int j; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 TextureFrame *v15; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 int v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 int k; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 FrameTableTxtLine v20; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 int v21; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 char *Str1; // [sp+280h] [bp-84h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 char *Str; // [sp+284h] [bp-80h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 int v24; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 int v25; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 int Argsa; // [sp+30Ch] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 Abortf("CTextureFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 v25 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 if ( v21 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 Abortf("CTextureFrameTable::load, too few arguments, %s line %i.", Args, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 v4 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 v5 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 v2->uNumTextures = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 v2->pTextures = (TextureFrame *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 Abortf("CTextureFrameTable::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 v2->uNumTextures = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 fseek(v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 strcpy(v2->pTextures[v2->uNumTextures].pTextureName, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 v2->pTextures[v2->uNumTextures].uAnimTime = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 for ( v2->pTextures[v2->uNumTextures].uFlags = 0; v9 < v21; ++v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 if ( !_strcmpi((&Str1)[4 * v9], "New") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 v10 = (int)&v2->pTextures[v2->uNumTextures].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 *(char *)v10 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 ++v2->uNumTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 if ( (signed int)(v2->uNumTextures - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 v13 = (int)&v2->pTextures[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 if ( !(*(char *)(v13 + 38) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 *(char *)(v13 + 18) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 while ( v11 < (signed int)(v2->uNumTextures - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 for ( j = 0; j < (signed int)v2->uNumTextures; *(short *)(Argsa + 16) = v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 v15 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 Argsa = (int)&v15[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 v16 = *(short *)(Argsa + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 if ( *(char *)(Argsa + 18) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 for ( k = (int)&v15[j]; *(char *)(k + 18) & 1; k += 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 v16 += *(short *)(k + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 LOWORD(v16) = v15[j].uAnimTime + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 //----- (0044F57C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 void *__fastcall SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *a2, int a3, int a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 MapInfo *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 SpawnPointMM7 *v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 char v8; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 int v9; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 int v11; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 int v12; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 int v13; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 int v14; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 int v15; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 int v16; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 int v17; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 int v18; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 int v19; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v20; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 Actor *v22; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int v23; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 signed int v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 int v25; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 unsigned __int16 v26; // ax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 MonsterDesc *v27; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 signed int v28; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 __int16 v29; // cx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 __int16 v30; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 __int16 v31; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 int v32; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 int v33; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 int v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 int v36; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 int v37; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 int v38; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 int v39; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 std::string v40; // [sp-18h] [bp-100h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 void *v41; // [sp-14h] [bp-FCh]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 void *v42; // [sp-10h] [bp-F8h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 size_t v43; // [sp-Ch] [bp-F4h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 const char *v44; // [sp-8h] [bp-F0h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 char *v45; // [sp-4h] [bp-ECh]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 char Str; // [sp+Ch] [bp-DCh]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 char Str2; // [sp+2Ch] [bp-BCh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 char v48; // [sp+A4h] [bp-44h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 void *Src; // [sp+A8h] [bp-40h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 int v50; // [sp+ACh] [bp-3Ch]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 char Source; // [sp+B0h] [bp-38h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 int v52; // [sp+D0h] [bp-18h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 void *v53; // [sp+D4h] [bp-14h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 int v54; // [sp+D8h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 int v55; // [sp+DCh] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 int v56; // [sp+E0h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 int v57; // [sp+E4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 v5 = pMapInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 result = (void *)pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 result = (void *)(uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 v8 = (a2->uAttributes & 1) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 result = (void *)(a2->uAttributes & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 v8 = (char)result == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 if ( !v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 result = (void *)(a2->uIndex - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 v56 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 switch ( (int)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 v9 = pMapInfo->uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 v11 = v5->uEncounterMonster1AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 v45 = v5->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 v12 = v10 % (v11 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 v13 = v5->field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v9 = pMapInfo->uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 v14 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 v15 = v5->uEncounterMonster2AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 v45 = v5->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 v12 = v14 % (v15 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 v13 = v5->field_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v9 = pMapInfo->uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 v17 = v5->uEncounterMonster3AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 v45 = v5->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 v12 = v16 % (v17 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 v13 = v5->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 v57 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 v56 = v9 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 result = strcpy(&Source, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 result = (void *)sprintfex(&Source, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 if ( Source == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 v57 += a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 if ( v57 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 strcpy(&Str2, &Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v56 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 v18 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 result = (void *)(v56 + uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 if ( (signed int)(v56 + uNumActors) >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 v19 = v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 v20 = v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 v21 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v55 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 a4 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 a3 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 v54 = pIndoor->GetSector(v19, v20, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 result = (void *)((((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 v52 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 if ( v18 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 v22 = &pActors[uNumActors];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 pActors[uNumActors].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 v23 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 v24 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 v25 = (unsigned __int16)word_4E8152[3 * v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 if ( v23 >= v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 if ( v23 < v25 + (unsigned __int16)word_4E8152[3 * v57 + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 if ( v24 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 if ( v24 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 if ( v24 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 sprintfex(&Str2, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 v26 = pMonsterList->GetMonsterByName(&Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 v50 = (signed __int16)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 v45 = &Str2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 if ( (signed __int16)v26 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 sprintfex(&Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 MessageBoxA(nullptr, &Str, nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 v27 = &pMonsterList->pMonsters[(signed __int16)v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 v28 = pMonsterStats->_4563FF(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 v28 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 Src = (char *)&pMonsterStats + 88 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 strcpy(v22->pActorName, *(const char **)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 v43 = 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 v42 = Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 v29 = *((short *)Src + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 v41 = &v22->pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 v22->sCurrentHP = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 memcpy(v41, v42, v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 v22->word_000086_some_monster_id = v50 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 v22->uActorRadius = v27->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 v22->uActorHeight = v27->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 v22->uMovementSpeed = v27->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 v30 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 v22->vInitialPosition.x = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 v22->vPosition.x = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 v31 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 v22->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 v22->vInitialPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 v22->vPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 v22->vInitialPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 v22->vPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 v22->uSectorID = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 v22->uGroup = v6->uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 v22->PrepareSprites((char)v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 v22->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 v32 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 v33 = v32 % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 v34 = stru_5C6E00->SinCos(v32 % 2048);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 a4 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 a3 = (unsigned __int64)(v34 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 v55 = a3 + v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 v35 = stru_5C6E00->SinCos(v33 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 a4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 a3 = (unsigned __int64)(v35 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 a4 = a3 + v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v36 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 a3 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 v37 = pIndoor->GetSector(v55, a4, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 if ( v37 == v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 v38 = _46CEC3_get_floor_level(v55, a4, a3, v37, (int *)&v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 if ( v38 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 if ( abs(v38 - a3) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 a3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 v22->uAttributes |= 0x080000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 v53 = (char *)v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 result = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 while ( (signed int)v53 < v56 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 //----- (0044FA4C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 signed int v3; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 char *v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 signed int result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 Actor *v6; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 char *v7; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 MonsterDesc *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 unsigned __int16 v9; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 int v10; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 int v11; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 int v12; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 const char *v15; // [sp-4h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 unsigned __int16 v16; // [sp+0h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 int v17; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 int v18; // [sp+8h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 int v19; // [sp+Ch] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 size_t v20; // [sp+10h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 int v21; // [sp+14h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 int v22; // [sp+18h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 unsigned int v23; // [sp+1Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 v16 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 v17 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 if ( a2 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 v15 = "Elemental Light C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 if ( a2 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 v15 = "Elemental Light B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 v15 = "Elemental Light A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v20 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 while ( *(short *)v4 != Removed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 if ( v3 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 v20 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v22 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v6 = &pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 v7 = (char *)&pMonsterStats->pInfos[v23 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v6->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v8 = &pMonsterList->pMonsters[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 strcpy(v6->pActorName, *(const char **)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 v6->sCurrentHP = *((short *)v7 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 memcpy(&v6->pMonsterInfo, v7, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 v6->word_000086_some_monster_id = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 v6->uActorRadius = v8->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v6->uActorHeight = v8->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 v9 = v8->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v6->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 v6->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v6->pMonsterInfo.uExp = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 v6->uMovementSpeed = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 v10 = rand() % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(v10) * (signed __int64)v19) >> 16) + pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 v18 = stru_5C6E00->SinCos(v10 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 v23 = (unsigned __int64)(v18 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 v12 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 v13 = (unsigned __int64)(v18 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 v6->vInitialPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 v14 = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 LOWORD(v12) = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 v6->vInitialPosition.z = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 v6->vPosition.z = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 LOWORD(v12) = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 v6->vPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v6->vInitialPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 v6->vPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v6->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 v6->uSectorID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 v6->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 v6->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 v6->uAlly = 9999;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 v6->uGroup = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 v6->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 v6->uAIState = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 v6->uCurrentActionLength = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 v6->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 || (v22 = pParty->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 result = pIndoor->GetSector(v11, v14, pParty->vPosition.y),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 result == v21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 && (result = _46CEC3_get_floor_level(v11, v14, v22, result, &v18), result != -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 && (result = abs(result - v22), result <= 1024) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 if ( v20 == uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 v6->uSummonerID = 8 * v17 | 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 result = v6->pActorBuffs[2].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 pParty->uTimePlayed + (signed __int64)((double)(a3 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 //----- (0044FFD8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 MapInfo *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 SpawnPointMM7 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 signed int v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 signed __int64 v12; // qtt@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 signed int v15; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 unsigned __int16 v16; // dx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 char *v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 unsigned __int16 v18; // ax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 int v19; // ST0C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 int v20; // ST08_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 int v21; // ST04_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 int v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 signed int v23; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 unsigned __int16 v24; // dx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 char *v25; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 unsigned __int16 v26; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 int v27; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 int v28; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 int v29; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 __int16 v30; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 int v32; // [sp+7Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 int v33; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 int v34; // [sp+84h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 v4 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 v5 = v4 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 v6 = 2 * (v2->field_2F + 7 * v3->uIndex) - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 v7 = (unsigned __int8)byte_4E8168[v6 + 16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 v8 = (unsigned __int8)byte_4E8168[v6 + 17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 v32 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 v9 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 v10 = v8 - v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 v12 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 result = v9 / v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 v13 = v33 + (unsigned __int64)(v12 % v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 if ( v13 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 if ( v32 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 if ( v32 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 v19 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 v20 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 v21 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 v22 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 if ( v3->uIndex == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 v14 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 if ( v3->uIndex != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 if ( v3->uIndex == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v14 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 if ( v3->uIndex != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 if ( v3->uIndex == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 v14 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 if ( v3->uIndex != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 while ( v16 != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 if ( v15 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 v18 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 a1a.stru_24.uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 a1a.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 a1a.stru_24.uAdditionalValue = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 v14 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 a1a.stru_24.uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 v14 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 a1a.stru_24.uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 v14 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 a1a.stru_24.uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 result = a1a.stru_24.GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 while ( v24 != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 if ( v23 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v26 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 a1a.uObjectDescID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 a1a.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 v27 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 v28 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 v29 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 a1a.vPosition.y = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 a1a.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 a1a.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 a1a.uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 a1a.vPosition.z = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 a1a.vPosition.x = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 a1a.field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 a1a.field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 a1a.field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 v30 = pIndoor->GetSector(v28, v27, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 a1a.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 a1a.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 a1a.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 a1a.uSectorID = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 return a1a.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 //----- (00450218) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 void __cdecl sub_450218_prolly_generate_chests_loot()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 Chest *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 MapInfo *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 ItemGen *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 signed int v8; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 int v10; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 int v11; // ebp@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 signed int v13; // ebp@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 ItemGen *v14; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 signed int v15; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 signed __int64 v16; // qtt@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 int v17; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 signed int v18; // [sp+10h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 int v19; // [sp+14h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 MapInfo *v20; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 Chest *v21; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 int v22; // [sp+20h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 signed int v23; // [sp+24h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 v18 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v0 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 v1 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 v2 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 v21 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 v20 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 v3 = v1->mm7__vector_pItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 v23 = 140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 if ( (v3->uItemID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 v4 = rand() % 5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 v5 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 v6 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 v7 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v8 = v6 - v5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 v9 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 v19 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 if ( v9 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 if ( v18 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 if ( v18 < 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 v10 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 if ( v19 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 v10 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 if ( v19 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 v10 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 v3->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 v10 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v3->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 v3->uAdditionalValue = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 v11 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 if ( v11 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 v22 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 if ( v12 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 v14 = &v21->mm7__vector_pItems[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 while ( v14->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 if ( v13 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 v15 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v18 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 if ( v15 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 if ( v15 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 pItemsTable->GenerateItem(v19, 0, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v14->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 v17 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 if ( v19 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v17 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 v14->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 v17 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 if ( v19 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v17 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 v14->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 v17 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 v14->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 v14->uAdditionalValue = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 v12 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 --v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v17 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 v10 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 v3->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 v10 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 v3->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 pItemsTable->GenerateItem(v9, 0, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 v3->GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 v2 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 --v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 while ( v23 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v1 = v21 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 while ( (signed int)v21 < (signed int)&uNumChests );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 //----- (00450521) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 signed int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 unsigned __int16 v9; // cx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 char *v10; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 unsigned __int16 v11; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 LayingItem a1; // [sp+8h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 v6 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 v10 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 while ( v9 != *(short *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 v10 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 if ( v8 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 a1.uObjectDescID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 a1.vPosition.y = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 a1.vPosition.x = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 a1.vPosition.z = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 a1.uFacing = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 a1.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 a1.uSectorID = pIndoor->GetSector(a3, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 return a1.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 //----- (0045063B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 int __fastcall sub_45063B(MapInfo *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 Actor *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 signed __int64 v4; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 int v6; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 int v9; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 int v12; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 int v14; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 int v16; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 int v17; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 int v20; // [sp+24h] [bp-20h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 MapInfo *v21; // [sp+28h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 int v22; // [sp+2Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 int v23; // [sp+30h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 int v24; // [sp+34h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 int v25; // [sp+38h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 int v26; // [sp+3Ch] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 int v27; // [sp+40h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 v24 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 v3 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 v22 = v3->pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 v4 = (signed __int64)((double)v22 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 if ( (int)v4 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 if ( v2 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 v6 = rand() % 1024 + 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 v20 = stru_5C6E00->SinCos(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 v20 = stru_5C6E00->SinCos(v7 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 v19.uIndex = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 v19.vPosition.y = v23 + pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 v19.vPosition.z = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 v19.vPosition.z = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 v19.vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 v23 + pParty->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 pParty->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 &v26,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 &v27,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 v9 = abs(v19.vPosition.y - pOutdoor->pBModels[v8].vBoundingCenter.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 v10 = abs(v19.vPosition.x - pOutdoor->pBModels[v8].vBoundingCenter.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 if ( sub_4621DA(v10, v9, 0) < pOutdoor->pBModels[v8].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 if ( v23 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 v11 = v25 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 if ( v25 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 v11 = v25 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 v12 = rand() % 512 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 v13 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 v15 = stru_5C6E00->SinCos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 v20 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 v23 = (unsigned __int64)(v15 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 v16 = stru_5C6E00->SinCos(v14 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 v20 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 v23 = (unsigned __int64)(v16 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 v19.vPosition.y = v23 + pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 v19.vPosition.z = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 v19.uIndex = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 if ( v17 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 v18 = _46CEC3_get_floor_level(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 v19.vPosition.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 if ( v18 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 if ( abs(v18 - pParty->vPosition.y) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 while ( v26 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 v11 = v26 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 SpawnEncounter(v21, &v19, 0, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 result = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 //----- (00450929) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 int LevelDecoration::GetGlobalEvent()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 LevelDecoration *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 signed int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 int v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 int v9; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 int v12; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 int v13; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 v2 = v1->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 if ( v2 > 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 switch ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 case 209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 result = rand() % 7 + 183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 case 210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 result = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 case 211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 result = 151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 case 212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 result = 152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 case 213:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 result = 153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 case 214:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 result = 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 case 215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 result = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 case 216:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 result = 156;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 case 217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 result = 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 case 218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 result = 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 case 219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 result = 159;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 result = 160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 case 221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 result = 161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 if ( v2 == 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 result = rand() % 7 + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 if ( v2 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 v9 = v2 - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 return rand() % 6 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 v10 = v9 - 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 return 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 v11 = v10 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 if ( !v11 || (v12 = v11 - 3) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 return 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 v13 = v12 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 return rand() % 7 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 if ( v13 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 return rand() % 7 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 if ( v2 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 return 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 v3 = v2 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 return 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 v4 = v3 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 return 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 return rand() % 4 + 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 v6 = v5 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 return 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 v7 = v6 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 return 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 if ( v7 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 return 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 //----- (00450AAA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 void *__cdecl RespawnGlobalDecorations()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 LevelDecoration *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 result = memset(stru_5E4C90.field_4B, 0, 0x7Du);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 v3 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 if ( !v3->field_16_event_id )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 result = (void *)v3->IsInteractive();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 if ( v0 < 124 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 v3->field_1C = v0 + 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 stru_5E4C90.field_4B[v0++] = v3->GetGlobalEvent();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 while ( v2 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 //----- (00450B0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 bool __fastcall SpawnActor(unsigned int uMonsterID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 MonsterDesc *v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 MonsterInfo *v4; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 Vec3_int_ v5; // ST08_12@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 unsigned int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 Actor *v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 Actor actor; // [sp+4h] [bp-350h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 v1 = uMonsterID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 if ( uNumActors == 499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 v3 = &pMonsterList->pMonsters[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 v4 = &pMonsterStats->pInfos[v1 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 memset(&actor, 0, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 strcpy(actor.pActorName, v4->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 actor.sCurrentHP = LOWORD(v4->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 actor.word_000086_some_monster_id = v1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 actor.uActorRadius = v3->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 actor.uActorHeight = v3->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 actor.uMovementSpeed = v3->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 v5 = pParty->vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 actor.vInitialPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 actor.vPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 actor.uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 actor.vInitialPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 actor.vPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 actor.vInitialPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 actor.vPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 pSprites_LOD->DeleteSomeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 pPaletteManager->ResetNonTestLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 v6 = uNumActors - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 if ( dword_5C6DF8 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 dword_5C6DF8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 v6 = uNumActors++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 v7 = &pActors[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 memcpy(v7, &actor, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 v7->PrepareSprites(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 //----- (00450DA3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 int __cdecl GetAlertStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 result = pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 //----- (00450DDE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 stru350 *stru350::_450DDE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8725 _450DF1(&stru_4E82A4, &stru_4E82A4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 return this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8729
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 //----- (00450DF1) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8731 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8732 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8733 //stru350 *v3; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8734 //void *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 unsigned int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 int v6; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 unsigned int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 int v9; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 int v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 int v11; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 int v12; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 unsigned int v13; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 int v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 unsigned int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 int v18; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 char v19; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 unsigned int v20; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 int v21; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 unsigned int v23; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 int v24; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 int v26; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 int v27; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 unsigned int v28; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 int v29; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 int v30; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 int v31; // ecx@35
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8762 int v32; // edi@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 int v33; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 unsigned int i; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 int v35; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 unsigned int v36; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 int v37; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 int v38; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8770 //v3 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8771 memcpy(&field_0, p1, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8772 memcpy(&field_20, p2, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8773 //result = memcpy(&v3->field_20, p2, 0x20u);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8774 //LOBYTE(result) = 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8775 if (field_0.field_4 & 1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8776 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8777 v5 = field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 while ( !(v5 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 while ( v5 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8791 field_40 = 32 - v7 - v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8792 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8793 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8794 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8795 field_40 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8796 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8797 v8 = field_0.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 while ( !(v8 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 while ( v8 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 v11 = 24 - v10 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8813 field_48 = v11;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8814 v13 = field_0.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 while ( !(v13 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 while ( v13 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 v15 = 16 - v14;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8828 v16 = field_0.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8829 field_50 = v15 - v12;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 while ( !(v16 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 while ( v16 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8843 v19 = (field_20.field_4 & 1) == 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8844 field_58 = v17 - v18 + 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8847 field_44 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8848 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8849 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8850 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8851 v20 = field_20.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 while ( !(v20 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 while ( v20 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8865 field_44 = 32 - v22 - v21;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8866 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8867 v23 = field_20.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 while ( !(v23 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 while ( v23 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 v26 = 24 - v25 - v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8883 field_4C = v26;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8884 v28 = field_20.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 while ( !(v28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 while ( v28 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 v31 = 16 - v29 - v27;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8899 v32 = field_20.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8900 field_54 = v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 for ( i = v32; !(i & 1); i >>= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 i >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 while ( i & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 v35 = 32 - v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 v36 = v32;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8912 field_5C = v35 - v30;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 while ( !(v36 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 while ( v36 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8926 field_5C = v37 - v38 + 8;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8927 return true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8928 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8929
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 //----- (00450F55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 unsigned int stru350::_450F55(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8936 int v2 = a2 & stru_4E82A4.field_1C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8937 if (field_20.field_4 & 1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 v2 = (unsigned int)v2 >> this->field_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8939 return v2 & field_20.field_1C |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8940 field_20.field_10 & ((a2 & (unsigned int)stru_4E82A4.field_10) >> field_4C) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8941 field_20.field_14 & ((a2 & (unsigned int)stru_4E82A4.field_14) >> field_54) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8942 field_20.field_18 & ((a2 & (unsigned int)stru_4E82A4.field_18) >> field_5C);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8943 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 //----- (00450FB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 int stru350::_450FB1(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8948 int v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8949 int v4 = field_0.field_4 & 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8951 v2 = a2 & field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8953 v2 <<= field_40;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8954 return v2 | ((a2 & field_0.field_10) << field_48) | ((a2 & field_0.field_14) << field_50) | ((a2 & field_0.field_18) << field_58);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 //----- (00452442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 int v4; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 __int16 v5; // ST14_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 __int16 v6; // dx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 __int16 v8; // ST10_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 unsigned __int16 v10; // dh@1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 int v12; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 __int16 a3a; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 v5 = a2 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 v6 = (unsigned __int16)a4 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 v8 = a1 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 a3a = (unsigned __int16)a3 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 LOWORD(v7) = a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 LOWORD(v7) = a3a & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 LOWORD(v9) = v9 & 0x1C00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 v11 = v7 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 LOWORD(v7) = v5 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 v12 = v7 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 LOWORD(v7) = v8 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 return ((v8 & 7) + (v5 & 7) + (a3a & 7) + (v6 & 7)) | (v7 + v12) | ((v8 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 + (v5 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 + v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 //----- (0045281E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 // Calculates atan2(y/x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 // return value: angle in integer format (multiplier of Pi/1024)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 unsigned int stru193_math::Atan2(int x, int y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 stru193_math *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 signed int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 unsigned int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 signed int v9; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 signed __int64 v10; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 unsigned int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 int v12; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 int v13; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 int v14; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 unsigned int v15; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 signed int v16; // [sp-4h] [bp-10h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 v4 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 v5 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 v6 = abs(y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 if ( v5 < 65536 && v6 >> 15 >= v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 if ( !x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 result = v3->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 if ( y <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 result += v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 if ( y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 if ( x <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 x = -x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 if ( y >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 v16 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 if ( y >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 v4 = -y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 v9 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 LODWORD(v10) = v4 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 HIDWORD(v10) = v4 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 v11 = v3->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 v12 = v10 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 if ( v12 <= v3->pTanTable[(signed int)v3->uIntegerHalfPi >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 v11 = (signed int)v3->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 v7 = (signed int)v3->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 v13 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 v14 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 while ( v13 < v14 && v12 >= v3->pTanTable[v13] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 if ( v9 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 v15 = v3->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 if ( v9 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 return v13 + v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 if ( v9 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 return v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 v15 = v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 return v15 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 if ( x <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 result = v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 //----- (00452969) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 stru193_math::stru193_math()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 stru193_math *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 double v3; // ST18_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 signed int v7; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 this->uIntegerDoublePi = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 this->uIntegerPi = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 this->uIntegerHalfPi = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 this->uDoublePiMask = 2047;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 this->uPiMask = 1023;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 this->uHalfPiMask = 511;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 this->pTanTable[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 this->pCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 this->pInvCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 v2 = (char *)&this->pInvCosTable[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 v3 = (double)v7 * 3.141592653589793 * 0.0009765625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 *((int *)v2 - 1040) = (signed __int64)(tan(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 *((int *)v2 - 520) = (signed __int64)(cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 *(int *)v2 = (signed __int64)(1.0 / cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 while ( v7 < (signed int)v1->uIntegerHalfPi );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 v4 = v1->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 if ( v4 < 520 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 v5 = (int)&v1->pCosTable[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 v6 = 520 - v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 *(int *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 *(int *)(v5 + 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 *(int *)(v5 - 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 v5 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 //----- (00452A9E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 signed int __fastcall sub_452A9E(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 int v2; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 if ( a1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 v4 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 result *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 v2 = ((unsigned int)v3 >> 30) | 4 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 v5 = 2 * result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 v3 *= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 if ( v2 >= (unsigned int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 v2 -= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 if ( a1 - result * result >= (unsigned int)(result - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 //----- (00452AE2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 int __fastcall MakeColorMaskFromBitDepth(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 signed __int64 v1; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 v1 = 4294967296i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 if ( a1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 LODWORD(v1) = HIDWORD(v1) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 HIDWORD(v1) *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 --a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 while ( a1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 //----- (00452AF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 void *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 unsigned __int16 *v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 unsigned int i; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 v4 = a1 | (a1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 *pPixels = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 v3 = pPixels + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 --uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 for ( i = uNumPixels & 1; i; --i ) // leftover pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 *v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 //----- (00452B2E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 unsigned int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 v2 = uDiceSides;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 if ( uDiceSides )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 if ( (signed int)uNumDice > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 v5 = uNumDice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 v3 += rand() % v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 //----- (00452B95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 void __cdecl SetSomeItemsNames()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 memset(&stru_5E4C50, 0, sizeof(stru_5E4C50));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 //----- (00452C30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 char *RemoveQuotes(char *Str)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 if ( *Str == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 Str[strlen(Str) - 1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 v1 = Str + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 //----- (00452C49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 void __cdecl InitializeGameText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 //char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 char *v1; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 int v2; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 //char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 //v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 if (pGlobalTXT_Raw)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 pAllocator->FreeChunk(pGlobalTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 pGlobalTXT_Raw = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 pGlobalTXT_Raw = (char *)pEvents_LOD->LoadRaw("global.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 strtok(pGlobalTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 strtok(nullptr, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 for (uint i = 0; i < 677; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 char *p = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 while (*++p != '\t' && *p);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 pGlobalTXT_LocalizationStrings[i] = RemoveQuotes(p + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 aMonthNames[2] = pGlobalTXT_LocalizationStrings[417];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 aMonthNames[3] = pGlobalTXT_LocalizationStrings[418];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 aMonthNames[4] = pGlobalTXT_LocalizationStrings[419];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 aMonthNames[5] = pGlobalTXT_LocalizationStrings[420];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 aMonthNames[6] = pGlobalTXT_LocalizationStrings[421];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 aCharacterConditionNames[0] = pGlobalTXT_LocalizationStrings[52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 aMonthNames[7] = pGlobalTXT_LocalizationStrings[422];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 aCharacterConditionNames[1] = pGlobalTXT_LocalizationStrings[241];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 aMonthNames[8] = pGlobalTXT_LocalizationStrings[423];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 aCharacterConditionNames[2] = pGlobalTXT_LocalizationStrings[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 aMonthNames[9] = pGlobalTXT_LocalizationStrings[424];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 aCharacterConditionNames[3] = pGlobalTXT_LocalizationStrings[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 aMonthNames[10] = pGlobalTXT_LocalizationStrings[425];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 aCharacterConditionNames[4] = pGlobalTXT_LocalizationStrings[69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 aMonthNames[11] = pGlobalTXT_LocalizationStrings[426];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 aCharacterConditionNames[5] = pGlobalTXT_LocalizationStrings[117];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 aCharacterConditionNames[6] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 aCharacterConditionNames[8] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 aCharacterConditionNames[10] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 aCharacterConditionNames[12] = pGlobalTXT_LocalizationStrings[162];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 aCharacterConditionNames[13] = pGlobalTXT_LocalizationStrings[231];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 aCharacterConditionNames[14] = pGlobalTXT_LocalizationStrings[58];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 aCharacterConditionNames[15] = pGlobalTXT_LocalizationStrings[220];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 aCharacterConditionNames[7] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 aCharacterConditionNames[9] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 aCharacterConditionNames[11] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 aCharacterConditionNames[16] = pGlobalTXT_LocalizationStrings[76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 pClassNames[9] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 pClassNames[10] = pGlobalTXT_LocalizationStrings[432];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 pClassNames[11] = pGlobalTXT_LocalizationStrings[27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 pClassNames[12] = pGlobalTXT_LocalizationStrings[262];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 pClassNames[13] = pGlobalTXT_LocalizationStrings[263];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 pClassNames[14] = pGlobalTXT_LocalizationStrings[264];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 pClassNames[15] = pGlobalTXT_LocalizationStrings[28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 pClassNames[16] = pGlobalTXT_LocalizationStrings[265];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 pClassNames[17] = pGlobalTXT_LocalizationStrings[267];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 pClassNames[18] = pGlobalTXT_LocalizationStrings[119];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 pClassNames[19] = pGlobalTXT_LocalizationStrings[124];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 pClassNames[20] = pGlobalTXT_LocalizationStrings[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 pClassNames[21] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 pClassNames[22] = pGlobalTXT_LocalizationStrings[33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 aCharacterConditionNames[17] = pGlobalTXT_LocalizationStrings[601];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 pClassNames[23] = pGlobalTXT_LocalizationStrings[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 aCharacterConditionNames[18] = pGlobalTXT_LocalizationStrings[98];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 pClassNames[24] = pGlobalTXT_LocalizationStrings[256];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 pClassNames[0] = pGlobalTXT_LocalizationStrings[253];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 pClassNames[25] = pGlobalTXT_LocalizationStrings[257];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 pClassNames[1] = pGlobalTXT_LocalizationStrings[254];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 pClassNames[26] = pGlobalTXT_LocalizationStrings[44];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 pClassNames[2] = pGlobalTXT_LocalizationStrings[255];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 pClassNames[27] = pGlobalTXT_LocalizationStrings[46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 pClassNames[3] = pGlobalTXT_LocalizationStrings[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 pClassNames[28] = pGlobalTXT_LocalizationStrings[268];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 pClassNames[4] = pGlobalTXT_LocalizationStrings[307];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 pClassNames[29] = pGlobalTXT_LocalizationStrings[269];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 pClassNames[5] = pGlobalTXT_LocalizationStrings[114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 pClassNames[30] = pGlobalTXT_LocalizationStrings[270];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 pClassNames[6] = pGlobalTXT_LocalizationStrings[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 pClassNames[31] = pGlobalTXT_LocalizationStrings[48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 pClassNames[7] = pGlobalTXT_LocalizationStrings[13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 pClassNames[32] = pGlobalTXT_LocalizationStrings[259];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 pClassNames[8] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 pClassNames[33] = pGlobalTXT_LocalizationStrings[260];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 pClassNames[34] = pGlobalTXT_LocalizationStrings[261];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 pClassNames[35] = pGlobalTXT_LocalizationStrings[49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 pSkillNames[0] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 pSkillNames[1] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 pSkillNames[2] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 pSkillNames[3] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 pSkillNames[4] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 pSkillNames[5] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 pSkillNames[6] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 pSkillNames[7] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 pSkillNames[23] = pGlobalTXT_LocalizationStrings[294];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 pSkillNames[9] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 pSkillNames[24] = pGlobalTXT_LocalizationStrings[295];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 pSkillNames[10] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 pSkillNames[25] = pGlobalTXT_LocalizationStrings[296];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 pSkillNames[11] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 pSkillNames[26] = pGlobalTXT_LocalizationStrings[297];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 pSkillNames[12] = pGlobalTXT_LocalizationStrings[283];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 pSkillNames[27] = pGlobalTXT_LocalizationStrings[298];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 pSkillNames[13] = pGlobalTXT_LocalizationStrings[284];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 pSkillNames[28] = pGlobalTXT_LocalizationStrings[299];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 pSkillNames[14] = pGlobalTXT_LocalizationStrings[285];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 pSkillNames[29] = pGlobalTXT_LocalizationStrings[300];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 pSkillNames[15] = pGlobalTXT_LocalizationStrings[286];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 pSkillNames[30] = pGlobalTXT_LocalizationStrings[50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 pSkillNames[16] = pGlobalTXT_LocalizationStrings[289];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 pSkillNames[31] = pGlobalTXT_LocalizationStrings[77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 aDayNames[0] = pGlobalTXT_LocalizationStrings[145];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 pSkillNames[17] = pGlobalTXT_LocalizationStrings[290];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 pSkillNames[32] = pGlobalTXT_LocalizationStrings[88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 aDayNames[1] = pGlobalTXT_LocalizationStrings[230];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 pSkillNames[18] = pGlobalTXT_LocalizationStrings[291];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 pSkillNames[33] = pGlobalTXT_LocalizationStrings[89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 aDayNames[2] = pGlobalTXT_LocalizationStrings[243];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 pSkillNames[19] = pGlobalTXT_LocalizationStrings[287];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 pSkillNames[34] = pGlobalTXT_LocalizationStrings[90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 aDayNames[3] = pGlobalTXT_LocalizationStrings[227];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 pSkillNames[20] = pGlobalTXT_LocalizationStrings[288];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 pSkillNames[35] = pGlobalTXT_LocalizationStrings[95];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 aDayNames[4] = pGlobalTXT_LocalizationStrings[91];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 pSkillNames[21] = pGlobalTXT_LocalizationStrings[292];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 pSkillNames[36] = pGlobalTXT_LocalizationStrings[301];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 aDayNames[5] = pGlobalTXT_LocalizationStrings[188];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 pSkillNames[8] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 pSkillNames[22] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 pSkillNames[37] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 aDayNames[6] = pGlobalTXT_LocalizationStrings[222];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 aNPCProfessionNames[0] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 aNPCProfessionNames[1] = pGlobalTXT_LocalizationStrings[308];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 aNPCProfessionNames[2] = pGlobalTXT_LocalizationStrings[309];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 aNPCProfessionNames[3] = pGlobalTXT_LocalizationStrings[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 aNPCProfessionNames[4] = pGlobalTXT_LocalizationStrings[306];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 aNPCProfessionNames[5] = pGlobalTXT_LocalizationStrings[310];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 aNPCProfessionNames[6] = pGlobalTXT_LocalizationStrings[311];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 aNPCProfessionNames[7] = pGlobalTXT_LocalizationStrings[312];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 aSpellSchoolNames[0] = pGlobalTXT_LocalizationStrings[87];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 aNPCProfessionNames[8] = pGlobalTXT_LocalizationStrings[313];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 aSpellSchoolNames[1] = pGlobalTXT_LocalizationStrings[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 aNPCProfessionNames[9] = pGlobalTXT_LocalizationStrings[314];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 aNPCProfessionNames[21] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 aNPCProfessionNames[10] = pGlobalTXT_LocalizationStrings[105];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 aSpellSchoolNames[2] = pGlobalTXT_LocalizationStrings[240];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 aNPCProfessionNames[11] = pGlobalTXT_LocalizationStrings[315];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 aNPCProfessionNames[22] = pGlobalTXT_LocalizationStrings[324];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 aNPCProfessionNames[12] = pGlobalTXT_LocalizationStrings[316];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 aSpellSchoolNames[3] = pGlobalTXT_LocalizationStrings[70];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 aNPCProfessionNames[13] = pGlobalTXT_LocalizationStrings[317];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 aNPCProfessionNames[23] = pGlobalTXT_LocalizationStrings[498];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 aSpellSchoolNames[4] = pGlobalTXT_LocalizationStrings[214];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 aNPCProfessionNames[14] = pGlobalTXT_LocalizationStrings[115];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 aNPCProfessionNames[24] = pGlobalTXT_LocalizationStrings[525];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 aSpellSchoolNames[5] = pGlobalTXT_LocalizationStrings[142];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 aNPCProfessionNames[15] = pGlobalTXT_LocalizationStrings[318];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 aNPCProfessionNames[25] = pGlobalTXT_LocalizationStrings[327];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 aSpellSchoolNames[6] = pGlobalTXT_LocalizationStrings[29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 aNPCProfessionNames[16] = pGlobalTXT_LocalizationStrings[319];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 aNPCProfessionNames[26] = pGlobalTXT_LocalizationStrings[328];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 aSpellSchoolNames[7] = pGlobalTXT_LocalizationStrings[133];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 aNPCProfessionNames[17] = pGlobalTXT_LocalizationStrings[320];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 aNPCProfessionNames[27] = pGlobalTXT_LocalizationStrings[329];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 aSpellSchoolNames[8] = pGlobalTXT_LocalizationStrings[54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 aNPCProfessionNames[18] = pGlobalTXT_LocalizationStrings[321];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 aNPCProfessionNames[28] = pGlobalTXT_LocalizationStrings[330];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 aAMPMNames[0] = pGlobalTXT_LocalizationStrings[472];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 aNPCProfessionNames[19] = pGlobalTXT_LocalizationStrings[322];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 aNPCProfessionNames[29] = pGlobalTXT_LocalizationStrings[331];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 aAMPMNames[1] = pGlobalTXT_LocalizationStrings[473];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 aNPCProfessionNames[20] = pGlobalTXT_LocalizationStrings[323];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 aNPCProfessionNames[30] = pGlobalTXT_LocalizationStrings[332];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 aNPCProfessionNames[31] = pGlobalTXT_LocalizationStrings[333];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 aNPCProfessionNames[32] = pGlobalTXT_LocalizationStrings[334];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 aNPCProfessionNames[33] = pGlobalTXT_LocalizationStrings[335];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 aNPCProfessionNames[34] = pGlobalTXT_LocalizationStrings[336];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 aNPCProfessionNames[35] = pGlobalTXT_LocalizationStrings[337];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 aNPCProfessionNames[36] = pGlobalTXT_LocalizationStrings[338];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 aNPCProfessionNames[37] = pGlobalTXT_LocalizationStrings[339];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 aNPCProfessionNames[38] = pGlobalTXT_LocalizationStrings[340];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 aNPCProfessionNames[39] = pGlobalTXT_LocalizationStrings[341];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 aNPCProfessionNames[40] = pGlobalTXT_LocalizationStrings[342];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 aNPCProfessionNames[56] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 aNPCProfessionNames[41] = pGlobalTXT_LocalizationStrings[343];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 aNPCProfessionNames[57] = pGlobalTXT_LocalizationStrings[600];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 aNPCProfessionNames[42] = pGlobalTXT_LocalizationStrings[596];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 aNPCProfessionNames[58] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 aNPCProfessionNames[43] = pGlobalTXT_LocalizationStrings[345];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 aMoonPhaseNames[0] = pGlobalTXT_LocalizationStrings[150];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 aNPCProfessionNames[44] = pGlobalTXT_LocalizationStrings[346];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 aMoonPhaseNames[1] = pGlobalTXT_LocalizationStrings[171];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 aNPCProfessionNames[45] = pGlobalTXT_LocalizationStrings[347];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 aNPCProfessionNames[46] = pGlobalTXT_LocalizationStrings[348];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 aNPCProfessionNames[47] = pGlobalTXT_LocalizationStrings[349];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 aNPCProfessionNames[48] = pGlobalTXT_LocalizationStrings[350];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 aAttributeNames[0] = pGlobalTXT_LocalizationStrings[144];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 aNPCProfessionNames[49] = pGlobalTXT_LocalizationStrings[597];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 aAttributeNames[1] = pGlobalTXT_LocalizationStrings[116];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 aNPCProfessionNames[50] = pGlobalTXT_LocalizationStrings[352];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 aAttributeNames[2] = pGlobalTXT_LocalizationStrings[163];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 aNPCProfessionNames[51] = pGlobalTXT_LocalizationStrings[353];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 aAttributeNames[3] = pGlobalTXT_LocalizationStrings[75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 aNPCProfessionNames[52] = pGlobalTXT_LocalizationStrings[598];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 aAttributeNames[4] = pGlobalTXT_LocalizationStrings[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 aNPCProfessionNames[53] = pGlobalTXT_LocalizationStrings[344];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 aAttributeNames[5] = pGlobalTXT_LocalizationStrings[211];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 aNPCProfessionNames[54] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 aAttributeNames[6] = pGlobalTXT_LocalizationStrings[136];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 aNPCProfessionNames[55] = pGlobalTXT_LocalizationStrings[599];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 aSpellNames[14] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 aSpellNames[33] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 aSpellNames[9] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 aSpellNames[34] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 aSpellNames[0] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 aSpellNames[10] = pGlobalTXT_LocalizationStrings[218];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 aSpellNames[20] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 aSpellNames[35] = pGlobalTXT_LocalizationStrings[235];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 aSpellNames[11] = pGlobalTXT_LocalizationStrings[217];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 aSpellNames[21] = pGlobalTXT_LocalizationStrings[443];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 aSpellNames[36] = pGlobalTXT_LocalizationStrings[246];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 aSpellNames[12] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 aSpellNames[24] = pGlobalTXT_LocalizationStrings[221];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 aSpellNames[37] = pGlobalTXT_LocalizationStrings[247];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 aSpellNames[13] = pGlobalTXT_LocalizationStrings[462];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 aSpellNames[26] = pGlobalTXT_LocalizationStrings[228];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 aSpellNames[38] = pGlobalTXT_LocalizationStrings[248];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 aSpellNames[15] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 aSpellNames[28] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 aSpellNames[39] = pGlobalTXT_LocalizationStrings[674];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 aSpellNames[16] = pGlobalTXT_LocalizationStrings[452];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 aSpellNames[29] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 aSpellNames[40] = pGlobalTXT_LocalizationStrings[249];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 aSpellNames[2] = pGlobalTXT_LocalizationStrings[219];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 aSpellNames[17] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 aSpellNames[30] = pGlobalTXT_LocalizationStrings[229];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 aSpellNames[41] = pGlobalTXT_LocalizationStrings[258];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 aSpellNames[5] = pGlobalTXT_LocalizationStrings[454];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 aSpellNames[3] = pGlobalTXT_LocalizationStrings[215];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 aSpellNames[7] = pGlobalTXT_LocalizationStrings[455];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 aSpellNames[18] = pGlobalTXT_LocalizationStrings[456];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 aSpellNames[31] = pGlobalTXT_LocalizationStrings[233];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 aSpellNames[42] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 aSpellNames[6] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 aSpellNames[25] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 aSpellNames[1] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 aSpellNames[4] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 aSpellNames[8] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 aSpellNames[19] = pGlobalTXT_LocalizationStrings[453];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 aSpellNames[22] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 aSpellNames[23] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 aSpellNames[27] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 aSpellNames[32] = pGlobalTXT_LocalizationStrings[234];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 aSpellNames[43] = pGlobalTXT_LocalizationStrings[657];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 //----- (00453E6D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 void StorylineText::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 StorylineText *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 char *v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 char v4; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 char *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 int v6; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 int v7; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 int v8; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 char *v9; // [sp+14h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 int Str; // [sp+18h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 if ( pHistoryTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 pAllocator->FreeChunk(pHistoryTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 pHistoryTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 strtok(pHistoryTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 Str = (int)&v2->field_4[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 v9 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 v8 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 v3 = strtok(v1, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 if ( *v3 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 v4 = v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 while ( v4 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 v6 = (int)&v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 if ( v3[(int)v5] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 *(char *)v6 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 if ( v5 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 if ( v9 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 *(char **)(Str - 8) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 if ( v9 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 *(char *)Str = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 if ( v9 - 2 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 *(char * *)(Str - 4) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 v3 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 while ( (signed int)(v9 - 1) <= 3 && (char *)v8 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 Str += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 //----- (00453F62) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 void MapStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 MapStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 unsigned int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 char *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 char v5; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 size_t v7; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 size_t v8; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 size_t v9; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 size_t v10; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 size_t v11; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 size_t v12; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 char Str[32]; // [sp+Ch] [bp-34h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 char *v14; // [sp+2Ch] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 int v15; // [sp+30h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 int v16; // [sp+34h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 unsigned int v17; // [sp+38h] [bp-8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 MapStats *v18; // [sp+3Ch] [bp-4h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 if ( pMapStatsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 pAllocator->FreeChunk(pMapStatsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 pMapStatsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 strtok(pMapStatsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 v1->uNumMaps = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 v3 = strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 v14 = &v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 switch ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v1->pInfos[v2].pName = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 v1->pInfos[v2].pFilename = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v1->pInfos[v2].uNumResets = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v1->pInfos[v2].uFirstVisitedAt = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 v1->pInfos[v2]._per = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v1->pInfos[v2].uRespawnIntervalDays = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 v1->pInfos[v2]._alert_days = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v1->pInfos[v2]._steal_perm = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 v1->pInfos[v2].field_2D = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v1->pInfos[v2].field_2E = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v1->pInfos[v2].field_2F = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v1->pInfos[v2].field_30 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v1->pInfos[v2].field_31 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v1->pInfos[v2].field_32 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v1->pInfos[v2].field_33 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 v1->pInfos[v2].pEncounterMonster1Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v1->pInfos[v2].field_34 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 v18->pInfos[0].uEncounterMonster1AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v7 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 if ( v17 >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 v18->pInfos[0].uEncounterMonster1AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 v8 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 if ( v17 == v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 v18->pInfos[0].uEncounterMonster1AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 v18->pInfos[0].uEncounterMonster1AtMost = v18->pInfos[0].uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 v1->pInfos[v2].pEncounterMonster2Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 v1->pInfos[v2].field_37 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 v18->pInfos[0].uEncounterMonster2AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 v9 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 if ( v17 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 v18->pInfos[0].uEncounterMonster2AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 if ( v17 == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 v18->pInfos[0].uEncounterMonster2AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 v18->pInfos[0].uEncounterMonster2AtMost = v18->pInfos[0].uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 v1->pInfos[v2].pEncounterMonster3Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 v1->pInfos[v2].field_3A = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 v18->pInfos[0].uEncounterMonster3AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v11 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 if ( v17 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 v18->pInfos[0].uEncounterMonster3AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 v12 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 if ( v17 == v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 v18->pInfos[0].uEncounterMonster3AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 v18->pInfos[0].uEncounterMonster3AtMost = v18->pInfos[0].uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 v1->pInfos[v2].uRedbookTrackID = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 if ( strcmp(v4, "GENERIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 if ( strcmp(v4, "PADDEDCELL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 if ( strcmp(v4, "ROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 if ( strcmp(v4, "BATHROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 if ( strcmp(v4, "LIVINGROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 if ( strcmp(v4, "STONEROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 if ( strcmp(v4, "AUDITORIUM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 if ( strcmp(v4, "CONCERTHALL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 if ( strcmp(v4, "CAVE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 if ( strcmp(v4, "ARENA") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 if ( strcmp(v4, "HANGAR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 if ( strcmp(v4, "CARPETEDHALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 if ( strcmp(v4, "HALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 if ( strcmp(v4, "STONECORRIDOR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 if ( strcmp(v4, "ALLEY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 if ( strcmp(v4, "FOREST") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 if ( strcmp(v4, "CITY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 if ( strcmp(v4, "MOUNTAINS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 if ( strcmp(v4, "QUARRY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 if ( strcmp(v4, "PLAIN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 if ( strcmp(v4, "PARKINGLOT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 if ( strcmp(v4, "SEWERPIPE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 if ( strcmp(v4, "UNDERWATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 if ( strcmp(v4, "DRUGGED") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 if ( strcmp(v4, "DIZZY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 if ( strcmp(v4, "PSYCHOTIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 v1->pInfos[v2].uEAXEnv = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v1->pInfos[v2].uEAXEnv = 25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 v1->pInfos[v2].uEAXEnv = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v1->pInfos[v2].uEAXEnv = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 v1->pInfos[v2].uEAXEnv = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 v1->pInfos[v2].uEAXEnv = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 v1->pInfos[v2].uEAXEnv = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 v1->pInfos[v2].uEAXEnv = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v1->pInfos[v2].uEAXEnv = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 v1->pInfos[v2].uEAXEnv = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 v1->pInfos[v2].uEAXEnv = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 v1->pInfos[v2].uEAXEnv = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 v1->pInfos[v2].uEAXEnv = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 v1->pInfos[v2].uEAXEnv = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 v1->pInfos[v2].uEAXEnv = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 v1->pInfos[v2].uEAXEnv = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 v1->pInfos[v2].uEAXEnv = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 v1->pInfos[v2].uEAXEnv = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 v1->pInfos[v2].uEAXEnv = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 v1->pInfos[v2].uEAXEnv = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 v1->pInfos[v2].uEAXEnv = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 v1->pInfos[v2].uEAXEnv = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 v1->pInfos[v2].uEAXEnv = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 v1->pInfos[v2].uEAXEnv = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 v1->pInfos[v2].uEAXEnv = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 v1->pInfos[v2].uEAXEnv = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 v1->pInfos[v2].uEAXEnv = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 v4 = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 while ( v16 - 1 <= 29 && !v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 while ( (signed int)v2 < 77 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 v1->uNumMaps = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 // 453F62: using guessed type char Str[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 //----- (004547A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 unsigned int MapStats::GetMapInfo(const char *Str2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 MapStats *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 unsigned int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 if ( (signed int)this->uNumMaps <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 v4 = (const char **)&this->pInfos[1].pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 while ( !*v4 || _strcmpi(*v4, Str2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 v4 += 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 if ( (signed int)v3 >= (signed int)v2->uNumMaps )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 //----- (004547E4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 void FactionTable::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 signed int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 int v7; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 signed int v8; // [sp+4h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 signed int v9; // [sp+8h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 FactionTable *v10; // [sp+Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 v10 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 if ( pHostileTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 pHostileTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 strtok(pHostileTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 v2 = strtok(v1, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 v9 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v4 = (int)((char *)&v10[-7] + v8 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v5 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v5 = v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 v7 = (int)&v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 if ( v2[(int)v6] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 *(char *)v7 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 if ( v6 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 if ( v3 >= 1 && v3 <= 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 *(char *)v4 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 v4 += 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 v2 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 while ( v3 - 1 <= 90 && (char *)v9 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 while ( v8 < 89 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 if ( pHostileTXT_Raw != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 pHostileTXT_Raw = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 //----- (004548E2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 std::string v5; // [sp-18h] [bp-28h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 const char *v6; // [sp-8h] [bp-18h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 signed int v7; // [sp-4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 std::string *v8; // [sp+8h] [bp-8h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 int a3; // [sp+Fh] [bp-1h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 v2 = (int)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 result = (int)a1->pProperties[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 if ( !_strcmpi((const char *)result, "Dispel") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 v7 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 ++*(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 v7 = 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 v7 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v7 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 v7 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 v7 = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 v7 = 95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 v7 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 v7 = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 v7 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 v7 = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 v7 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 if ( !_strcmpi(*(const char **)(v2 + 4), off_4E876C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 v7 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 v7 = 97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 v7 = 82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 v7 = 57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 v7 = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 sprintfex(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 v7 = 73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 v7 = 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 v7 = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 v7 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 v7 = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 v7 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 v7 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 v7 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 v7 = 81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v7 = 93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v7 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 v7 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 v7 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 v7 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 v7 = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 v7 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 v7 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 *(int *)v3 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 //----- (00454CB4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 int __thiscall ParseAttackType(unsigned __int8 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 unsigned __int8 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 int v3; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 int v4; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 if ( tolower(*a1) == 'f' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 if ( tolower(*v1) == 'a' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 if ( tolower(*v1) == 'w' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 if ( tolower(*v1) == 'e' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 tolower(v1[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 return 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 if ( tolower(*v1) == 's' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 return 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 if ( tolower(*v1) == 'm' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 v3 = -(tolower(v1[1]) != 'i');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 LOBYTE(v3) = v3 & 0xFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 result = v3 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 if ( tolower(*v1) == 'l' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 return 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 v4 = -(tolower(*v1) != 'd');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 LOBYTE(v4) = v4 & 0xFA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 result = v4 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 //----- (00454D7D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 signed int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 int *v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 size_t v10; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 int v11; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 signed int v12; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 v5 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 *(char *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 *(char *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 if ( (signed int)v10 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 LOBYTE(v8) = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 if ( (unsigned __int8)*v5 >= 0x30u && (unsigned __int8)v8 <= 0x39u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 *(char *)v4 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 LOBYTE(v8) = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 v7 = (int *)&v5[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 if ( tolower((unsigned __int8)v5[v6]) == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 *(char *)v11 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 *(char *)a3 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 *(char *)v7 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 v8 = tolower(*(char *)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 if ( v8 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 *(char *)a4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 while ( v6 < (signed int)v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 v4 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 //----- (00454E3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 int __fastcall ParseMissleAttackType(const char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 const char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 int v4; // [sp-4h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 v1 = Str1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 if ( _strcmpi(Str1, "ARROW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 if ( _strcmpi(v1, "ARROWF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 if ( _strcmpi(v1, "FIRE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 if ( _strcmpi(v1, off_4E887C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 if ( _strcmpi(v1, "WATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 if ( _strcmpi(v1, "EARTH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 if ( _strcmpi(v1, "SPIRIT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 if ( _strcmpi(v1, "MIND") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 if ( _strcmpi(v1, "BODY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 if ( _strcmpi(v1, "LIGHT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 if ( _strcmpi(v1, "DARK") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 if ( _strcmpi(v1, "ENER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 v4 = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 v4 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 v4 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 v4 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 v4 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 v4 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 v4 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 v4 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 v4 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 v4 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 //----- (00458244) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 unsigned int __fastcall SkillToMastery(unsigned __int16 a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 result = 1; // Normal
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 if ( HIBYTE(a1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 result = 4; // Grandmaster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 if ( (a1 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 if ( a1 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 result = 2; // Expert
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 result = 3; // Master
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 //----- (0045828B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 unsigned int __fastcall GetSpellColor(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 unsigned __int16 v1; // dx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 unsigned __int16 v2; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 unsigned __int16 v4; // [sp-4h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 if ( a1 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 if ( a1 < 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 goto LABEL_31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 v4 = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 if ( a1 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 v4 = 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 v2 = 192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 LABEL_31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 v1 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 v2 = 235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 v2 = 225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 v4 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 v1 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 v1 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 if ( a1 >= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 v1 = 212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 v2 = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 //----- (004583B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 LevelDecoration::LevelDecoration()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 this->field_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 this->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 this->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 this->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 this->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 this->uDecorationDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 this->field_16_event_id = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 this->uCog = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 //----- (00458600) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 void DecorationList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 DecorationList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 v2 = fopen("data\\ddeclist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 Abortf("Unable to save ddeclist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 fwrite(v1->pDecorations, 0x54u, v1->uNumDecorations, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 //----- (0045864C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 void DecorationList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 uNumDecorations = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 pDecorations = (DecorationDesc *)pAllocator->AllocNamedChunk(pDecorations,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 84 * uNumDecorations, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 memcpy(pDecorations, (char *)pSerialized + 4, 84 * uNumDecorations);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 //----- (00458693) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 void DecorationList::InitializeDecorationSprite(unsigned int uDecID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 pSpriteFrameTable->InitializeSprite(this->pDecorations[uDecID].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 //----- (004586B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 bool DecorationList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 DecorationList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 unsigned int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 FILE *v6; // ST18_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 unsigned __int16 v8; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 const char *v9; // ST20_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 const char *v10; // ST18_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 __int16 v11; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 const char *v12; // ST14_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 unsigned __int16 v13; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 const char *v14; // ST10_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 __int16 v15; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 const char *v16; // ST0C_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 unsigned __int8 v17; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 const char *v18; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 unsigned __int8 v19; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 const char *v20; // ST04_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 unsigned __int8 v21; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 const char *v22; // ST00_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 unsigned __int8 v23; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 char v24; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 unsigned __int8 v25; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 int j; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 const char *v27; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 int v28; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 int v30; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 int v31; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 int v32; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 int v33; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 int v34; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v35; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 FrameTableTxtLine v37; // [sp+Ch] [bp-460h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 FrameTableTxtLine v38; // [sp+88h] [bp-3E4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 char Dest; // [sp+104h] [bp-368h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 char Buf; // [sp+17Ch] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 FrameTableTxtLine v41; // [sp+370h] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 FrameTableTxtLine v42; // [sp+3ECh] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 FILE *File; // [sp+468h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 unsigned int Argsa; // [sp+474h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 Abortf("DecorationDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 memcpy(&v42, frame_table_txt_parser(&Buf, &v41), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 v4 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 v2->uNumDecorations = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 v5 = pAllocator->AllocNamedChunk(v2->pDecorations, 84 * v4, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 v2->pDecorations = (DecorationDesc *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 Abortf("DecorationDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v2->uNumDecorations = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 memcpy(&v42, frame_table_txt_parser(&Buf, &v38), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 strcpy(v2->pDecorations[v2->uNumDecorations].pName, v42.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v8 = pSpriteFrameTable->FastFindSprite(v2->pDecorations[v2->uNumDecorations].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v9 = v42.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v2->pDecorations[v2->uNumDecorations].uSpriteID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 strcpy(v2->pDecorations[v2->uNumDecorations].field_20, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 v10 = v42.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v2->pDecorations[v2->uNumDecorations].uType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v12 = v42.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v2->pDecorations[v2->uNumDecorations].uRadius = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v14 = v42.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v2->pDecorations[v2->uNumDecorations].uDecorationHeight = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v16 = v42.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v2->pDecorations[v2->uNumDecorations].uLightRadius = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v18 = v42.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v2->pDecorations[v2->uNumDecorations].uColoredLightRed = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 v20 = v42.pProperties[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 v2->pDecorations[v2->uNumDecorations].uColoredLightGreen = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 v21 = atoi(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 v22 = v42.pProperties[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v2->pDecorations[v2->uNumDecorations].uColoredLightBlue = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v2->pDecorations[v2->uNumDecorations].uSoundID = atoi(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v25 = __OFSUB__(v42.field_0, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v23 = v42.field_0 == 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v24 = v42.field_0 - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 v2->pDecorations[v2->uNumDecorations].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 if ( !((unsigned __int8)(v24 ^ v25) | v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 strcpy(&Dest, v42.pProperties[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 memcpy(&v41, frame_table_txt_parser(&Dest, &v37), sizeof(v41));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 for ( j = 0; j < v41.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 v27 = v41.pProperties[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 if ( _strcmpi(v41.pProperties[j], off_4E8CB8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 if ( _strcmpi(v27, "Invisible") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 if ( _strcmpi(v27, "FS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 if ( _strcmpi(v27, "FM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 if ( _strcmpi(v27, "FF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 if ( _strcmpi(v27, "Marker") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 if ( _strcmpi(v27, "LoopSlow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 if ( _strcmpi(v27, "EmitFire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 if ( _strcmpi(v27, "Dawn") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 if ( !_strcmpi(v27, "Dusk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 v35 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 *(char *)v35 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 v34 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 *(char *)v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 v33 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 *(char *)v33 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 v32 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 *(char *)v32 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 v31 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 *(char *)v31 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 v30 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 *(char *)v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 v29 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 *(char *)v29 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 v28 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 *(char *)v28 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 ++v2->uNumDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 //----- (00459064) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 void ObjectList::InitializeSprites()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 for (uint i = 0; i < uNumObjects; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 pSpriteFrameTable->InitializeSprite(pObjects[i].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 //----- (00459090) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 void ObjectList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 ObjectList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 v2 = fopen("data\\dobjlist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 Abortf("Unable to save dobjlist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 fwrite(v1->pObjects, 0x38u, v1->uNumObjects, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 //----- (004590DC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 void ObjectList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 uNumObjects = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 pObjects = (ObjectDesc *)pAllocator->AllocNamedChunk(pObjects, 56 * uNumObjects, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 memcpy(pObjects, (char *)pSerialized + 4, 56 * uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 //----- (00459123) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 bool ObjectList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 ObjectList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 __int32 v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 void *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 FILE *v7; // ST0C_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 char *i; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 unsigned __int16 v9; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 const char *v10; // ST20_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 __int16 v11; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 const char *v12; // ST1C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 __int16 v13; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 const char *v14; // ST18_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 __int16 v15; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 const char *v16; // ST14_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 __int16 v17; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 const char *v18; // ST10_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 __int16 v19; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 const char *v20; // ST0C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 int v21; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 const char *v22; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 int v23; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 int v24; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 int v26; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 int v27; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 int v28; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 int v29; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 int v30; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 int v31; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 const char *v32; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 const char *v33; // ST20_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 int v34; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 char v35; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 const char *v36; // ST1C_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 char v37; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 const char *v38; // ST18_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 FrameTableTxtLine v40; // [sp+8h] [bp-460h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 FrameTableTxtLine v41; // [sp+84h] [bp-3E4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 char Dest; // [sp+100h] [bp-368h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 char Buf; // [sp+178h] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 FrameTableTxtLine v44; // [sp+36Ch] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 FrameTableTxtLine v45; // [sp+3E8h] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 FILE *File; // [sp+464h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 unsigned int Argsa; // [sp+470h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 int Argsb; // [sp+470h] [bp+8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 pAllocator->FreeChunk(this->pObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v2->pObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 v2->uNumObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 v4 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 File = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 Abortf("ObjectDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 if ( fgets(&Buf, 490, v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 if ( v45.field_0 && *v45.pProperties[0] != '/' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 v5 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v2->uNumObjects = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 v6 = pAllocator->AllocNamedChunk(v2->pObjects, 56 * v5, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 v2->pObjects = (ObjectDesc *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 if ( v6 == (void *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 Abortf("ObjectDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 memset(v6, v3, 56 * v2->uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v2->uNumObjects = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 fseek(v7, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 if ( v45.field_0 && *v45.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v10 = v45.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v2->pObjects[v2->uNumObjects].uSpriteID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v12 = v45.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v2->pObjects[v2->uNumObjects].uObjectID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v14 = v45.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v2->pObjects[v2->uNumObjects].uRadius = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 v16 = v45.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 v2->pObjects[v2->uNumObjects].uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v18 = v45.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 v2->pObjects[v2->uNumObjects].uLifetime = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 v20 = v45.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 v2->pObjects[v2->uNumObjects].uSpeed = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 strcpy(&Dest, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 if ( v45.field_0 > 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 for ( Argsb = 0; Argsb < v44.field_0; ++Argsb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v21 = Argsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 v22 = v44.pProperties[Argsb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 if ( !_strcmpi(v44.pProperties[Argsb], "NoDraw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 v23 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 *(char *)v23 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 if ( !_strcmpi(v22, "Lifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 v24 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 *(char *)v24 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 if ( !_strcmpi(v22, "FTLifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 v25 = (int)&v2->pObjects[v2->uNumObjects];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 *(short *)(v25 + 42) = 8 * pSpriteFrameTable->pSpriteSFrames[*(short *)(v25 + 40)].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 v26 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 *(char *)v26 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 v27 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 *(char *)v27 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 if ( !_strcmpi(v22, "NoPickup") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 v28 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 *(char *)v28 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 if ( !_strcmpi(v22, "NoGravity") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 v29 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 *(char *)v29 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 if ( !_strcmpi(v22, "FlagOnIntercept") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 v30 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 *(char *)v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 if ( !_strcmpi(v22, "Bounce") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 v31 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 *(char *)v31 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 v32 = v45.pProperties[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 if ( !_strcmpi(v45.pProperties[v21], "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 if ( !_strcmpi(v32, "Lines") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 if ( !_strcmpi(v44.pProperties[v21], "bits") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 v33 = v44.pProperties[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 v34 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 *(char *)(v34 + 1) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 v35 = atoi(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 v36 = v44.pProperties[v21 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 v2->pObjects[v2->uNumObjects].uParticleTrailColorR = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 v37 = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 v38 = v44.pProperties[v21 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 v2->pObjects[v2->uNumObjects].uParticleTrailColorG = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 v2->pObjects[v2->uNumObjects].uParticleTrailColorB = atoi(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 ++v2->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 //----- (0045BAA5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 int __thiscall sub_45BAA5(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 sub_45BAB6(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 //----- (0045BAB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 std::string *__fastcall sub_45BAB6(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 size_t v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 stru_69BD44 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 return &stru_69BD44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 //----- (0045E03A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 unsigned __int16 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 int v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 unsigned __int8 v5; // cf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 unsigned int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 unsigned __int16 *v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 int j; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 unsigned __int16 *v9; // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 LONG v11; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 signed __int64 v12; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 unsigned int v13; // ST10_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 HRESULT v14; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 int v15; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 signed __int64 v16; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 signed int v17; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 unsigned __int16 *v18; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 int k; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 DDSURFACEDESC2 Dst; // [sp+4h] [bp-A0h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 unsigned __int16 *pPixels; // [sp+80h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 float v23; // [sp+84h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 unsigned __int16 *_this; // [sp+88h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 float v25; // [sp+8Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 unsigned int v26; // [sp+90h] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 int v27; // [sp+94h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 int v28; // [sp+98h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 int i; // [sp+9Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 int v30; // [sp+A0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 v30 = width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 v2 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 v27 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v23 = 452.0 / (double)width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 v25 = 336.0 / (double)height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 pPixels = (unsigned __int16 *)operator new(2 * height * width);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 pRenderer->SetGameRenderStates();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 v9 = (unsigned __int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 v11 = Dst.lPitch >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 for ( i = 0; i < v27; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 v28 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 if ( v30 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 v26 = v11 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 v12 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 *v3 = v9[v26 + (int)v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v13 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v5 = v30 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 v6 = (unsigned int)v30 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 v7 = &v3[2 * v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 for ( j = v5; j; --j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 _this = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 v26 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 if ( pRenderer->pTargetSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 v15 = v26 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 v16 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 *v3 = _this[v15 + (int)v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 while ( i < v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 v18 = &v3[2 * ((unsigned int)v30 >> 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 for ( k = v30 & 1; k; --k )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 --v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 while ( v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 return pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 //----- (0045E26C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 void __thiscall SaveScreenshot(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 unsigned __int16 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 v1 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 v2 = MakeScreenshot(92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 pRenderer->SavePCXImage(v1, (char *)v2, 92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11438
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11439
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 //----- (0045EE8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 void __fastcall LoadGame(unsigned int uSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 char v2; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 signed int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 signed int v4; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 char *v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 unsigned int v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 char *v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 FILE *v9; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 FILE *v10; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 FILE *v11; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 FILE *v12; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 FILE *v13; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 FILE *v14; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 unsigned int v15; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 Player *v16; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 int *v17; // esi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 int v18; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 int v19; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 int v20; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 int v21; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 int v22; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 bool v23; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 AudioPlayer *v24; // ebx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 bool v25; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 bool v26; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 signed int v27; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 RGBTexture *v28; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 std::string v29; // [sp-18h] [bp-108h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 int v30; // [sp-Ch] [bp-FCh]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 int v31; // [sp-8h] [bp-F8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 signed int v32; // [sp-4h] [bp-F4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 char DstBuf; // [sp+Ch] [bp-E4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 char pContainer; // [sp+20h] [bp-D0h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 char Str[123]; // [sp+70h] [bp-80h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 char a3[5]; // [sp+EBh] [bp-5h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 v1 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 v2 = pSavegameUsedSlots[uSlot] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 dword_5B65C8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 v24 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 *(int *)&a3[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v32 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 v31 = *(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", *(int *)&a3[1], v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 while ( v3 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 ++*(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 while ( *(int *)&a3[1] < 5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 *(int *)&a3[1] = (int)(char *)&pParty + 2508;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 if ( byte_4ED498 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 v5 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 while ( *(int *)v5 != 2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)(*(int *)&a3[1] + 6432))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 + 4998 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 v5 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 if ( v4 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 pSoundList->_4A9DCD(v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 v8 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 while ( *(int *)v8 != 2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)(*(int *)&a3[1] + 6432))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 + 4999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 v8 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 if ( (signed int)v7 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 pSoundList->_4A9DCD(v7, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 *(int *)&a3[1] += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 while ( *(int *)&a3[1] < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 sprintfex(pTmpBuf, "saves\\%s", pSavegameList->pSavesNames[v1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 if ( !CopyFileA(pTmpBuf, "data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 pNew_LOD->LoadFile("data\\new.lod", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 v9 = pNew_LOD->FindContainer("header.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 fread(&DstBuf, 0x64u, 1u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:549", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 v10 = pNew_LOD->FindContainer("party.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 fread(&pParty, 0x16238u, 1u, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 101);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:559", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 v11 = pNew_LOD->FindContainer("Timer.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 fread(&pEventTimer, 0x28u, 1u, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:569", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 v12 = pNew_LOD->FindContainer("overlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 fread(&pOtherOverlayList, 0x3F0u, 1u, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 103);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:579", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 v13 = pNew_LOD->FindContainer("npcdata.bin", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 fread(pNPCStats->pNewNPCData, 0x94BCu, 1u, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 pNPCStats->_476C60();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:590", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 v14 = pNew_LOD->FindContainer("npcgroup.bin", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 fread(pNPCStats->pGroups_copy, 0x66u, 1u, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 105);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:600", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 v16 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 if ( v16->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 if ( (signed int)v16 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 uActiveCharacter = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 v17 = (int *)&pParty->pPlayers[0].uQuickSpell;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 v18 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 if ( *(char *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 stru_AA1058[v19]._494836(*(char *)v17, v18 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 *(int *)&a3[1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 v20 = (int)((char *)v17 - 263);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 if ( *(int *)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 v21 = *(int *)((char *)&v17[9 * *(int *)v20 - 1559] - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 if ( pItemsTable->pItems[v21].uEquipType == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 ++*(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 v20 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 if ( *(int *)&a3[1] > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 v32 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 v31 = *((int *)&pSpellDatas[66].field_8 + v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 stru_A750F8[v19]._494836(v31, v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 v17 += 1743;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 while ( v18 - 9 < 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 LOBYTE(v23) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 if ( pParty->uAlignment == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 v22 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 SetUserInterface(v22, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 pEventTimer->StopGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 v24 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v25 = pGames_LOD->DoesContainerExist((const char *)&pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 v32 = (signed int)&pContainer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 sprintfex(pTmpBuf, "levels\\%s", &pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v26 = _access(pTmpBuf, 4) != -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 if ( !v25 && !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 v32 = (signed int)&pContainer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 sprintfex(pTmpBuf, "Unable to find: %s!", &pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 Abortf(pTmpBuf, v30, v31, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 strcpy(pCurrentMapName, &pContainer);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11695 dword_6BE364_game_settings_1 |= 0x2001;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 if ( (signed int)uNumSavegameFiles > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 v28 = pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 v28->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 while ( v27 < (signed int)uNumSavegameFiles );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 pIcons_LOD->_4114F2();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11709 v32 = (signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v24->SetMusicVolume(v32);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11711 v32 = (signed __int64)(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 v24->SetMasterVolume(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 pParty->sRotationY = uTurnSpeed * pParty->sRotationY / (signed int)uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 bFlashQuestBook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11719
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 //----- (0045F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 int __fastcall SaveGame(int a1, __int16 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 void *v3; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 const char *v7; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 FILE *v8; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 int v9; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 void *v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 void *v11; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 void *v12; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 void *v13; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 void *v14; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 void *v15; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 void *v16; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 int v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 unsigned int v18; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 unsigned int v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 char *v20; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 void *v21; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 void *v22; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 BSPModel *v23; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 signed int v24; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 unsigned __int8 v25; // zf@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 unsigned __int8 v26; // sf@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 signed int v27; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 void *v28; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 void *v29; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 void *v30; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 void *v31; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 int v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 int v33; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 DWORD v34; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 std::string v35; // [sp-18h] [bp-288h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 const char *v36; // [sp-10h] [bp-280h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 const char *v37; // [sp-Ch] [bp-27Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 const char *v38; // [sp-8h] [bp-278h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 int v39; // [sp-4h] [bp-274h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 CHAR Buffer; // [sp+Ch] [bp-264h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 char Dir; // [sp+8Ch] [bp-1E4h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 char Drive; // [sp+ACh] [bp-1C4h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 int v43; // [sp+CCh] [bp-1A4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 char Dest[20]; // [sp+E0h] [bp-190h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 unsigned __int64 v45; // [sp+F4h] [bp-17Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 char Filename; // [sp+130h] [bp-140h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 char Ext; // [sp+150h] [bp-120h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 char v48; // [sp+151h] [bp-11Fh]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 char Source[32]; // [sp+170h] [bp-100h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 char Str[120]; // [sp+190h] [bp-E0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 int v51; // [sp+208h] [bp-68h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 int v52; // [sp+20Ch] [bp-64h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 int v53; // [sp+210h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 int v54; // [sp+214h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 int Src; // [sp+218h] [bp-58h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 char v56; // [sp+21Ch] [bp-54h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 char v57; // [sp+21Dh] [bp-53h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 char v58; // [sp+21Eh] [bp-52h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 char v59; // [sp+21Fh] [bp-51h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 int v60; // [sp+220h] [bp-50h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 int v61; // [sp+224h] [bp-4Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 int v62; // [sp+228h] [bp-48h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 LOD::Directory pDir; // [sp+22Ch] [bp-44h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 std::string *v64; // [sp+24Ch] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 size_t Size; // [sp+250h] [bp-20h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 __int16 *v66; // [sp+254h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 void *DstBuf; // [sp+258h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 __int16 *v68; // [sp+25Ch] [bp-14h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 unsigned int v69; // [sp+260h] [bp-10h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 int v70; // [sp+264h] [bp-Ch]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 std::string *v71; // [sp+268h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 int a3; // [sp+26Fh] [bp-1h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 v66 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 v64 = (std::string *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 strcpy(byte_6BE3B0, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 result = _strcmpi(pCurrentMapName, "d05.blv");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 DstBuf = operator new(0xF4240u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 pDir.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 v52 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 v51 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 v62 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 v53 = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 v54 = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 pParty->vPosition.x = pParty->vPrevPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 pParty->vPosition.z = pParty->vPrevPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 pParty->vPosition.y = pParty->vPrevPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 pParty->uFallStartY = pParty->vPrevPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 pParty->sRotationY = pParty->sPrevRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 pParty->sRotationX = pParty->sPrevRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 pIndoor->uLastVisitDay = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 pOutdoor->uLastVisitDay = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 v3 = MakeScreenshot(150, 112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 strcpy((char *)&pDir, "image.pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 free(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 0x12u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 0x8Du,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 (Texture *)(uTextureID_save_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_save_up] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 v36 = pGlobalTXT_LocalizationStrings[190];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 v4 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[190]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, v36, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 v37 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 v5 = pFontSmallnum->AlignText_Center(0xBAu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, v37, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 v36 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 v6 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, v36, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 if ( pNew_LOD->Write(&pDir, DstBuf, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 strcpy(Dest, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 v45 = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 strcpy((char *)&pDir, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 pDir.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 if ( pNew_LOD->Write(&pDir, &v43, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 v39 = 201;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 201);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:784", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 strcpy((char *)&pDir, "party.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 pDir.uDataSize = 90680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 if ( pNew_LOD->Write(&pDir, &pParty, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 v39 = 202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:793", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 strcpy((char *)&pDir, "Timer.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 pDir.uDataSize = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 if ( pNew_LOD->Write(&pDir, &pEventTimer, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 v39 = 203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 203);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:802", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 strcpy((char *)&pDir, "overlay.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 pDir.uDataSize = 1008;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 if ( pNew_LOD->Write(&pDir, &pOtherOverlayList, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 v39 = 204;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:811", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 strcpy((char *)&pDir, "npcdata.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 pDir.uDataSize = 38076;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 if ( pNew_LOD->Write(&pDir, pNPCStats->pNewNPCData, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 v39 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 205);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:820", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 strcpy((char *)&pDir, "npcgroup.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 pDir.uDataSize = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 if ( pNew_LOD->Write(&pDir, pNPCStats->pGroups_copy, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 v39 = 206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 206);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:829", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 v70 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 v69 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 v39 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 v38 = (const char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 sprintfex(Str, "data\\lloyd%d%d.pcx", v70, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 v8 = fopen(Str, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 v39 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 v38 = (const char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 sprintfex(Str, "lloyd%d%d.pcx", v70, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 fseek(v8, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 pDir.uDataSize = ftell(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 rewind(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 fread(DstBuf, pDir.uDataSize, 1u, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 strcpy((char *)&pDir, Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 fclose(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 remove(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 if ( pNew_LOD->Write(&pDir, DstBuf, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 v39 = 207;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 207);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:857", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 Size = 5080748;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 while ( (signed int)v69 <= 5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 while ( v70 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 if ( !v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 sub_42FA22_mess_with_laying_item_list();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 v9 = (int)malloc(0xF4240u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 v71 = (std::string *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 Src = 91969;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 v56 = 109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 v57 = 118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 v58 = 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v59 = 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 memcpy((void *)v9, &Src, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 v10 = DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 pIndoor->dlv.uNumFacesInBModels = pIndoor->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 pIndoor->dlv.uNumBModels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 pIndoor->dlv.uNumDecorations = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 memcpy(DstBuf, &pIndoor->dlv, 0x28u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 v10 = (char *)v10 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 memcpy(v10, pIndoor->_visible_outlines, 0x36Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 v11 = (char *)v10 + 875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 if ( (signed int)pIndoor->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 v38 = (char *)v68 + (unsigned int)pIndoor->pFaces + 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 memcpy(v11, v38, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 v68 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 v11 = (char *)v11 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 while ( v70 < (signed int)pIndoor->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 v68 = &pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 memcpy(v11, v68, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 v68 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 v11 = (char *)v11 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 while ( v70 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 memcpy(v11, &uNumActors, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 v12 = (char *)v11 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 memcpy(v12, pActors, 836 * uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 v13 = (char *)v12 + 836 * uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 memcpy(v13, &uNumLayingItems, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 v13 = (char *)v13 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 memcpy(v13, pLayingItems, 112 * uNumLayingItems);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 v14 = (char *)v13 + 112 * uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 memcpy(v14, &uNumChests, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 v14 = (char *)v14 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 memcpy(v14, pChests, 5324 * uNumChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 v15 = (char *)v14 + 5324 * uNumChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 memcpy(v15, pIndoor->pDoors, 0x3E80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 v15 = (char *)v15 + 16000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 memcpy(v15, pIndoor->ptr_0002B4_doors_ddata, pIndoor->blv.uDoors_ddata_Size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 v16 = (char *)v15 + pIndoor->blv.uDoors_ddata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 memcpy(v16, &stru_5E4C90, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 v17 = (int)((char *)v16 + 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 memcpy((void *)v17, &pIndoor->uLastVisitDay, 0x38u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 pOutdoor->ddm.uNumFacesInBModels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 v19 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 v20 = (char *)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 v18 += *(int *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 v20 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 pOutdoor->ddm.uNumFacesInBModels = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 while ( v19 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 v21 = DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 pOutdoor->ddm.uNumBModels = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 pOutdoor->ddm.uNumDecorations = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 memcpy(DstBuf, &pOutdoor->ddm, 0x28u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 v21 = (char *)v21 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 memcpy(v21, pOutdoor->array_528, 0x3C8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 v21 = (char *)v21 + 968;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 memcpy(v21, pOutdoor->array_8F0, 0x3C8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 v22 = (char *)v21 + 968;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 v23 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 v24 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 v25 = *(int *)&v23->pModelName[v24] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 v26 = *(int *)&v23->pModelName[v24] < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 if ( !(v26 | v25) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 v38 = (char *)v68 + *(int *)&v23->pModelName[v24 + 8] + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 memcpy(v22, v38, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 v23 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 v68 += 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 v22 = (char *)v22 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 v66 = (__int16 *)((char *)v66 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 while ( (signed int)v66 < *(int *)&pOutdoor->pBModels->pModelName[v24] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 v24 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 while ( v70 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 v66 = &pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 memcpy(v22, v66, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 v66 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 v22 = (char *)v22 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 while ( v27 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 memcpy(v22, &uNumActors, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 v28 = (char *)v22 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 memcpy(v28, pActors, 836 * uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 v29 = (char *)v28 + 836 * uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 memcpy(v29, &uNumLayingItems, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 v29 = (char *)v29 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 memcpy(v29, pLayingItems, 112 * uNumLayingItems);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 v30 = (char *)v29 + 112 * uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 memcpy(v30, &uNumChests, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 v30 = (char *)v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 memcpy(v30, pChests, 5324 * uNumChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 v31 = (char *)v30 + 5324 * uNumChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 memcpy(v31, &stru_5E4C90, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 v17 = (int)((char *)v31 + 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 memcpy((void *)v17, &pOutdoor->uLastVisitDay, 0x38u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 v9 = (int)v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 v32 = v17 + 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 strcpy(Source, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 _splitpath(Source, &Drive, &Dir, &Filename, &Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 v48 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 Size = v32 - (int)DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 v69 = 999984;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 LOBYTE(v33) = zlib::MemZip((char *)v9 + 16, (unsigned int *)&v69, DstBuf, v32 - (int)DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 if ( v33 || (signed int)v69 > (signed int)Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 memcpy((void *)(v9 + 16), DstBuf, Size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 v69 = Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 v69 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 memcpy((void *)(v9 + 8), &v69, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 memcpy((void *)(v9 + 12), &Size, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 sprintfex(Source, "%s%s", &Filename, &Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 strcpy((char *)&pDir, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 pDir.uDataSize = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 if ( pNew_LOD->Write(&pDir, (const void *)v9, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 v39 = 208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 208);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:1071", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 free((void *)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 free(DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 if ( v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 if ( !CopyFileA("data\\new.lod", "saves\\autosave.mm7", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 v34 = GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 FormatMessageA(0x1000u, 0, v34, 0x400u, &Buffer, 0x80u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 v39 = 300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 300);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:1097", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 pParty->vPosition.x = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 pParty->vPosition.z = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 pParty->vPosition.y = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 pParty->uFallStartY = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 pParty->sRotationY = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 result = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 pParty->sRotationX = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 //----- (00460078) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 void __fastcall DoSavegame(unsigned int uSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 int v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 RGBTexture *v3; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 int bNotArena; // [sp+2Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 unsigned int v6; // [sp+30h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 v1 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 v6 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 bNotArena = _strcmpi(pCurrentMapName, "d05.blv");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 if ( bNotArena )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 LOD::Directory pDir; // [sp+Ch] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 SaveGame(0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 v2 = 100 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 strcpy(&pSavegameHeader->pLocationName[v2], pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 *(int *)((char *)&pSavegameHeader->uWordTime + v2) = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 *(int *)((char *)&pSavegameHeader->uWordTime + v2 + 4) = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 strcpy((char *)&pDir, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 pDir.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 pNew_LOD->Write(&pDir, (char *)&pSavegameHeader + v2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 sprintfex(pTmpBuf, "saves\\save%03d.mm7", v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 CopyFileA("data\\new.lod", pTmpBuf, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 v3 = pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 v3->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 while ( (signed int)v3 < (signed int)&unk_6A0758 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 if ( bNotArena )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 pNew_LOD->_4621A7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 ShowStatusBarString(pGlobalTXT_LocalizationStrings[583], 2u);// "No saving in the Arena"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 pIcons_LOD->_4355F7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 ShowStatusBarString(pGlobalTXT_LocalizationStrings[656], 2u);// "Game Saved!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 //----- (004601B7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12195 void GameUI_MainMenu_DoDrawLoad(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 unsigned __int16 v1; // bx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 unsigned int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 unsigned int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 unsigned int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 unsigned int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 unsigned int v7; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 signed __int64 v8; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 unsigned int v9; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 unsigned __int64 v10; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 __int64 v11; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 char v12; // di@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 unsigned __int64 v13; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 unsigned int v14; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 __int64 v15; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 int v16; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 signed int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 const char *v18; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 int v19; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 const char *v20; // ST18_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 const char *v22; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 int v23; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 const char *v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 int v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 GUIWindow Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 /*unsigned int Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 unsigned int v27; // [sp+10h] [bp-74h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 int v28; // [sp+14h] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 int v29; // [sp+18h] [bp-6Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 unsigned int v30; // [sp+1Ch] [bp-68h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 unsigned int v31; // [sp+20h] [bp-64h]@8*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 __int64 v32; // [sp+60h] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 int v33; // [sp+68h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 unsigned int v34; // [sp+70h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 __int64 v35; // [sp+74h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 int v36; // [sp+7Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 int a4; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 a4 = a1;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12238 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12239 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 8u,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12246 (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 v2 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 v3 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 v2 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 v3 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 pRenderer->DrawTextureIndexed(0x12u, 0x8Bu, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 0x15Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 memset(&Dst, 0, 0x54u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 Dst.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 v4 = pGUIWindow_CurrentMenu->uFrameY - LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 Dst.uFrameWidth = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 v4 += 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 Dst.uFrameY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 v5 = LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 Dst.uFrameZ = Dst.uFrameX + 219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 Dst.uFrameHeight = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 Dst.uFrameW = v5 + v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v6 = uLoadGameUI_SelectedSlot;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12278 if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 pRenderer->DrawTextureRGB(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 pGUIWindow_CurrentMenu->uFrameX + 276,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 pGUIWindow_CurrentMenu->uFrameY + 171,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 pSavegameThumbnails + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 v6 = uLoadGameUI_SelectedSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12286 v7 = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[v7].pName, 3u);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12288 v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12289 HIDWORD(v32) = (unsigned __int64)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 v8 /= 60i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 v10 = (unsigned int)v8 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 v34 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 v11 = (unsigned int)(v10 / 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 LODWORD(v13) = (unsigned int)v11 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 HIDWORD(v13) = HIDWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 v33 = v13 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 v36 = v13 / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 v15 = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 v14 = (unsigned __int64)(v35 % 24) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 LODWORD(v35) = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 HIDWORD(v15) = v34 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 v36 += 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 v16 = v12 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 Dst.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 HIDWORD(v35) = (v14 & 0x80000000u) == 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 && ((signed int)v14 > 0 || (unsigned int)v15 >= 0xC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 && (signed int)v14 <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 0x18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 0xC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 if ( !(v14 | (unsigned int)v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 v17 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 LODWORD(v15) = v15 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 LABEL_23:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12330 auto _d = aDayNames[HIDWORD(v15) % 7];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12331 auto _a = aAMPMNames[HIDWORD(v35)];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12332 auto _m = aMonthNames[v33];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12333 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, v36);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12334 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d",
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12335 _d,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 v17,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12337 (int)v32,
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12338 _a,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 7 * v16 + HIDWORD(v15) % 7 + 1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12340 _m,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12362 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 v18 = pGlobalTXT_LocalizationStrings[135];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 v19 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[135]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, v18, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 v20 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 v21 = pFontSmallnum->AlignText_Center(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 0xBAu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106u, 0, v20, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 v22 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 v23 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, v22, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 v34 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v34 = uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 a4 = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v36 = dword_6A0C9C;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12384 v24 = (const char *)(&pSavegameHeader[dword_6A0C9C]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 if ( v36 >= (signed int)v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12389 short clr;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12390 HIDWORD(v35) = clr = (v36 == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 v1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12393 0x64) : 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 if ( pGUIWindow_CurrentMenu->field_40 != 1 || v36 != uLoadGameUI_SelectedSlot )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12396 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1Bu, a4, clr, v24, 185, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 0x1Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 a4,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12404 clr,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 (const char *)pKeyActionMap->pPressedKeysBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 175,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 a4 += 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 v24 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 while ( a4 < 346 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 // 6A0C9C: using guessed type int dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 //----- (004606F7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12421 void __cdecl GameUI_MainMenu_DrawLoad()
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12422 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12423 GameUI_MainMenu_DoDrawLoad(0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 //----- (004606FE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 void __cdecl sub_4606FE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12429 GameUI_MainMenu_DoDrawLoad(1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 //----- (00460706) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 void __cdecl TryLoadLevelFromLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 FILE *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 FILE *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 __int32 v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 char Ext[256]; // [sp+4h] [bp-40Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 char Dir; // [sp+104h] [bp-30Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 char Filename[256]; // [sp+204h] [bp-20Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 char a1[260]; // [sp+304h] [bp-10Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 char Drive; // [sp+408h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 int DstBuf; // [sp+40Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 strcpy(a1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 _splitpath(a1, &Drive, &Dir, Filename, Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 sprintfex(a1, "levels\\%s%s", Filename, ".lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 v0 = fopen(a1, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 fseek(v0, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 v2 = ftell(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 rewind(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 ptr_6A0D08 = pAllocator->AllocNamedChunk(ptr_6A0D08, v2, "LevelLod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 fread(ptr_6A0D08, v2, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 fseek(v1, v2 - 6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 DstBuf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 fread(&DstBuf, 4u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 fread(&_6A0D10_txt_lod_loading__unused, 2u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 _6A0D0C_txt_lod_loading = (int)((char *)ptr_6A0D08 + DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 fclose(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 // 6A0D0C: using guessed type int 6A0D0C_txt_lod_loading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 // 6A0D10: using guessed type int 6A0D10_txt_lod_loading__unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 //----- (0046080D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 void __cdecl sub_46080D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 // 6A0D0C: using guessed type int 6A0D0C_txt_lod_loading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 //----- (0046082C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 bool Initialize_GamesLOD_NewLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12480 pGames_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12481 pGames_LOD->AllocSubIndicesAndIO(300, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 if (pGames_LOD->LoadFile("data\\games.lod", 1))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12484 pNew_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12485 pNew_LOD->AllocSubIndicesAndIO(300, 0x186A0u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 //----- (0046086A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 int __cdecl MaybeDoAutosave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 int v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 int v2; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 FILE *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 unsigned int v9; // [sp+16Ch] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 void *pSave; // [sp+170h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 unsigned int v11; // [sp+174h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 pSave = pAllocator->AllocNamedChunk(0, 0xF4240u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 remove("data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 this_.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 strcpy(this_.array_000004, "MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 strcpy(this_.array_000054, "newmaps for MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 this_.dword_0000A4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 this_.dword_0000A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 a3.dword_000018 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 a3.word_00001E = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 strcpy((char *)&a3, "current");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 pNew_LOD->_461492(&this_, &a3, "data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 if ( pNew_LOD->LoadFile("data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 pNew_LOD->CreateTempFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 pNew_LOD->uNumSubIndices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 pDir.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 v1 = (signed int)pGames_LOD->uNumSubIndices / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 if ( (signed int)pGames_LOD->uNumSubIndices / 2 < (signed int)pGames_LOD->uNumSubIndices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 v2 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 v11 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 v9 = pGames_LOD->uNumSubIndices - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 memcpy(&pDir, (char *)pGames_LOD->pSubIndices + v2, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 v3 = pGames_LOD->FindContainer((const char *)pGames_LOD->pSubIndices + v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 fread(pSave, pGames_LOD->pSubIndices[v11 / 0x20].uDataSize, 1u, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 pNew_LOD->AppendDirectory(&pDir, pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 v11 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 v2 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 v7.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 strcpy(pSavegameHeader->pLocationName, "out01.odm");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 strcpy((char *)&v7, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 v7.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 pNew_LOD->AppendDirectory(&v7, &pSavegameHeader);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 pNew_LOD->Save();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 pParty->vPrevPosition.y = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 pParty->vPrevPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 pParty->vPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 pParty->vPosition.y = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 pParty->uFallStartY = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 pParty->sPrevRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 pParty->sRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 pParty->vPrevPosition.z = 1816;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 pParty->vPosition.z = 1816;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 pParty->sPrevRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 SaveGame(1, (__int16 *)1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 pAllocator->FreeChunk(pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 //----- (00460A78) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 void __thiscall PrepareToLoadBLV(unsigned int bLoading)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 unsigned int v2; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 MapInfo *v3; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 int v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 int v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 SpawnPointMM7 *v8; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 char v9; // bl@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 int v10; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 char *v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 int v12; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 unsigned int v13; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 char *v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 __int16 v15; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 int v16; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 DecorationDesc *v17; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 int *v19; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 char v20; // dl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 int v21; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 char v22; // cl@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 signed int v23; // ebx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 char *v24; // esi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 int v25; // eax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 char *v26; // esi@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 int v27; // eax@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 char v28; // zf@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 __int16 v29; // ax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 signed int v30; // edi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 int v31; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 char Args; // [sp+350h] [bp-C4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 int v34[4]; // [sp+3E8h] [bp-2Ch]@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 int v35; // [sp+3F8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 char b[4]; // [sp+3FCh] [bp-18h]@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 MapInfo *v37; // [sp+400h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 int v38; // [sp+404h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 unsigned int v39; // [sp+408h] [bp-Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 int pDest; // [sp+40Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 int i; // [sp+410h] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 v37 = (MapInfo *)bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 pGameLoadingUI_ProgressBar->Reset(0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 bNoNPCHiring = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 pDest = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 uCurrentlyLoadedLevelType = (LEVEL_TYPE)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 if ( Is_out15odm_underwater() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d23.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 bNoNPCHiring = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 pPaletteManager->field_267AD3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 pPaletteManager->field_267AD4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 pPaletteManager->field_267AD5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 v39 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 v3 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 v1 = v3->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 v38 = GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 v3 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 dword_6BE13C_uCurrentlyLoadedLocationID = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 TryLoadLevelFromLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 uNumStationaryLightsApplied = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 v4 = pIndoor->Load(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 pCurrentMapName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 (char *)&pDest)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 sprintfex(&Args, "Unable to open %s", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 sprintfex(&Args, "File %s is not a BLV File", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 v6 = v5 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 Abortf("Attempt to open new level before clearing old");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 if ( v6 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 Abortf("Out of memory loading indoor level");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 if ( !v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 if ( pDest == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 for ( i = 0; i < (signed int)pIndoor->uNumSpawnPoints; ++v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 v8 = &pIndoor->pSpawnPoints[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 if ( pIndoor->pSpawnPoints[v7].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 SpawnEncounter(v3, v8, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 v3->SpawnRandomTreasure(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 pSoundList->_4A9A67(pDoorSoundIDsByLocationID[v39], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 pSoundList->_4A9A67(pDoorSoundIDsByLocationID[v39] + 1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 if ( pIndoor->uNumDoors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 if ( pIndoor->pDoors[v10].uAttributes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 pIndoor->pDoors[v10].uState = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 pIndoor->pDoors[v10].uTimeSinceTriggered = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 pIndoor->pDoors[v10].uAttributes = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 v11 = (char *)&pIndoor->pDoors[v10].uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 if ( !*(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 if ( *(short *)v11 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 *(short *)v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 if ( i >= pIndoor->uNumDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 *(short *)v11 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 pIndoor->pDoors[v10].uTimeSinceTriggered = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 pIndoor->pDoors[v10].uAttributes = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 if ( (signed int)pIndoor->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 if ( pIndoor->pFaces[v12].uBitmapID != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12746 pBitmaps_LOD->pTextures[pIndoor->pFaces[v12].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pIndoor->pFaces[v12].uBitmapID].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 while ( i < (signed int)pIndoor->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 v14 = (char *)&pLevelDecorations[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 pDecorationList->InitializeDecorationSprite(*((short *)v14 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 v15 = pDecorationList->pDecorations[*((short *)v14 - 4)].uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 if ( v15 != (short)v13 && _6807E0_num_decorations_6807B8 < 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 pSoundList->_4A9A67(v15, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 v16 = _6807E0_num_decorations_6807B8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 _6807B8_level_decorations_ids[v16] = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 if ( !(*(v14 - 6) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 v17 = &pDecorationList->pDecorations[*((short *)v14 - 4)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 if ( !((unsigned __int8)v9 & v17->uFlags) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 v18 = v17->uLightRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 if ( v18 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 if ( pRenderer->pRenderD3D == (RenderD3D *)v13 || pRenderer->bUseColoredLights == v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 v20 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 v19 = (int *)255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 *(int *)b = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 v19 = (int *)v17->uColoredLightRed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 v20 = v17->uColoredLightGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 *(int *)b = v17->uColoredLightBlue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 pStationaryLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 *((int *)v14 - 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 *(int *)v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 *((short *)v14 + 2) + v17->uDecorationHeight / 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 v18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 b[0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 byte_4E94D0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 if ( *((short *)v14 + 7) == (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 if ( ((LevelDecoration *)(v14 - 8))->IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 if ( v35 < 124 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 v21 = v35 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 *((short *)v14 + 10) = v35 + 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 v22 = stru_5E4C90.field_0[v21 + 74];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 v35 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 *(v14 - 6) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 v14 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 while ( i < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 if ( (signed int)uNumLayingItems > (signed int)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 v24 = (char *)&pLayingItems[0].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 if ( *((short *)v24 - 17) != (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 v25 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 if ( *(int *)v24 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 if ( v25 != 220 && pItemsTable->pItems[v25].uEquipType == 14 && *((int *)v24 + 1) == v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 *((int *)v24 + 1) = rand() % 15 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 pItemsTable->SetSpecialBonus((ItemGen *)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 v24 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 while ( v23 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 i = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 if ( (signed int)uNumActors > (signed int)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 v26 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 v27 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 if ( v27 & 0x100000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 if ( !v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 v28 = v38 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 v28 = v38 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 ((Actor *)(v26 - 36))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 v29 = *((short *)v26 + 70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 v26[25] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 if ( v29 != 11 && v29 != 19 && (!*((short *)v26 + 2) || !*((int *)v26 + 18)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 *((short *)v26 + 70) = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 ((Actor *)(v26 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 *((short *)v26 + 70) = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 *(int *)v26 = v27 | 0x10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 v26 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 while ( i < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 Actor this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 this_.pMonsterInfo.uID = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 this_.PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 pParty->sRotationY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 pParty->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 pParty->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 pParty->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 pParty->uFallStartY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 v31 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 if ( pPlayers[v31]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 v34[v30++] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 while ( v31 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 if ( v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 if ( pDest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 qword_A750D8 = 256i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 word_A750E0 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 word_A750E2 = LOWORD(v34[rand() % v30]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 //----- (004610AA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 OutdoorCamera *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 v2 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 pGameLoadingUI_ProgressBar->Reset(0x1Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 ODM_LoadAndInitialize(pCurrentMapName, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 //----- (00461103) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 void __cdecl sub_461103()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 GUIProgressBar *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 __int16 v3; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 int v4; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 size_t v5; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 signed int v6; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 char *v7; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 signed int v8; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 int v9; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 MonsterInfo *v10; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 int *v11; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 int v13; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 __int16 v14; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 signed int v15; // [sp+10h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 signed int v16; // [sp+10h] [bp-4Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 signed int v17; // [sp+14h] [bp-48h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 signed int v18; // [sp+14h] [bp-48h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 int v19; // [sp+18h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 signed int v20; // [sp+18h] [bp-44h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 int v21[16]; // [sp+1Ch] [bp-40h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 sub_450218_prolly_generate_chests_loot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 v0 = pGameLoadingUI_ProgressBar;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 pParty->field_7B5_in_arena_quest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 dword_5C6DF8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 pNPCStats->field_17FC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 v19 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 v2 = (char *)&pActors[0].uNPC_ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 v3 = *((short *)v2 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 v17 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 if ( v3 >= 115 && v3 <= 186 || v3 >= 232 && v3 <= 249 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 v4 = (v3 - 1) % 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 if ( 2 == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 if ( *(short *)v2 && *(short *)v2 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 if ( v4 != 0 || *(short *)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 if ( *(short *)v2 > 0 && *(short *)v2 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->array_13EF4[pNPCStats->field_17FC0], v3, 0, v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 v14 = LOWORD(pNPCStats->field_17FC0) + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 ++pNPCStats->field_17FC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 *(short *)v2 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 *(short *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 while ( v15 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 v5 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 v16 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 if ( (signed int)uNumActors > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 v7 = (char *)&pActors[0].pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 if ( v6 > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 if ( v21[v8] == *((short *)v7 + 26) - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 while ( v8 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 if ( v8 == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 v21[v6++] = *((short *)v7 + 26) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 v20 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 if ( v6 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 v7 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 while ( v16 < (signed int)v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 if ( v6 > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 v9 = v21[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v18 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 v10 = &pMonsterStats->pInfos[v9 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 v11 = (int *)pMonsterList->pMonsters[v9].pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 pSoundList->_4A9A67(*(short *)v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 v11 = (int *)((char *)v11 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v10->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 while ( v1 < v20 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 v0 = pGameLoadingUI_ProgressBar;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 v0->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 if ( dword_6BE368_debug_settings_2 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 uNumActors = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 if ( dword_6BE368_debug_settings_2 & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 uNumLevelDecorations = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 sub_4613C4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 v0->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 pIndoorCamera->pos.y = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 pIndoorCamera->pos.x = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 pIndoorCamera->pos.z = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 pIndoorCamera->sRotationY = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 pIndoorCamera->sRotationX = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 uLevel_StartingPointType = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 pSprites_LOD->_461397();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 pPaletteManager->LockTestAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 if ( pParty->pPickedItem.uItemID != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 // 6BE368: using guessed type int dword_6BE368_debug_settings_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 // 461103: using guessed type int var_40[16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 //----- (004613C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 int __cdecl sub_4613C4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 unsigned __int16 v0; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 size_t v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 LevelDecoration *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 _6836C8_num_decorations_6807E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 v0 = pDecorationList->GetDecorIdByName("Event Trigger");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 v1 = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 v2 = (signed __int16)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 v4 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 if ( v4->uDecorationDescID == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 v5 = _6836C8_num_decorations_6807E8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 _6807E8_level_decorations_ids[v5] = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 while ( result < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 //----- (004621DA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 int __fastcall sub_4621DA(signed int a1, signed int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 signed int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 signed int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 signed int v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 if ( a1 < a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 a1 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 a2 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 v4 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 if ( a1 < a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 a1 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 if ( a2 < v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 v4 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 return (11 * a2 >> 5) + a1 + (v4 >> 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13182
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13183
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13184
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 //----- (0046271C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 void __cdecl crt_init_globals_46271C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 ofn.lStructSize = 0x4Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 ofn.hwndOwner = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 ofn.hInstance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 ofn.lpstrFilter = "Indoor BLV Files (*.blv)";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 ofn.lpstrCustomFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 ofn.nMaxCustFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 ofn.nFilterIndex = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 ofn.lpstrFile = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 ofn.nMaxFile = 260;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 ofn.nMaxFileTitle = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 ofn.lpstrInitialDir = "levels";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 ofn.lpstrTitle = "Might and Magic VII - Load Which Level?";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 ofn.Flags = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 ofn.nFileOffset = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 ofn.nFileExtension = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 ofn.lpstrDefExt = "blv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 ofn.lCustData = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 ofn.lpfnHook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 ofn.lpTemplateName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 ofn.lpstrFileTitle = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 //----- (004627B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 void __cdecl MainMenu_Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 GUIButton *v8; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 unsigned int v9; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 int v10; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 int v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 unsigned int v12; // [sp-18h] [bp-54h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 Texture *v13; // [sp-14h] [bp-50h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 GUIButton *v14; // [sp+0h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 GUIWindow *v15; // [sp+4h] [bp-38h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13226 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13236 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13237
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13238 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13239 //v0 = pIcons_LOD->LoadTexture("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13240 //v1 = (Texture *)(v0 != -1 ? &pIcons_LOD->pTextures[v0] : 0);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13241 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13242 pNew->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13243 pNew->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13244 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13245 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13246 UIMSG_MainMenu_ShowPartyCreationWnd,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13247 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13248 78,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13249 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13250 pNew,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13251 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13252 //v2 = pIcons_LOD->LoadTexture("title_load", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13253 //v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13254 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13255 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13256 pLoad->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13257 pLoad->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13258 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13259 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13260 UIMSG_MainMenu_ShowLoadWindow,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13261 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13262 76,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13263 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13264 pLoad,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13265 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13266 //v4 = pIcons_LOD->LoadTexture("title_cred", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13267 //v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13268 auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13269 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13270 pCredits->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13271 pCredits->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13272 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13273 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13274 UIMSG_ShowCredits,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13275 2,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13276 67,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13277 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13278 pCredits,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13279 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13280 //v6 = pIcons_LOD->LoadTexture("title_exit", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13281 //v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13282 auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13283 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13284 pExit->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13285 pExit->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13286 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13287 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13288 UIMSG_ExitToWindows,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13289 3,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13290 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13291 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13292 pExit,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13293 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13294
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 stru_506F20.Load("title.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13297 SetCurrentMenuID(MENU_MAIN);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 SetForegroundWindow(hWnd);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13299 SendMessageA(hWnd, WM_ACTIVATEAPP, 1, 0);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13300 while (GetCurrentMenuID() == MENU_MAIN ||
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13301 GetCurrentMenuID() == MENU_SAVELOAD)
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13302 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13303 POINT pt;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13304 pMouse->GetCursorPos(&pt);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13305 //uMouseX = pMouse->GetCursorPos(&v18)->x;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13306 //uMouseY = pMouse->GetCursorPos(&v19)->y;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13307 v15 = pWindow_MainMenu;
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13308 if ( GetCurrentMenuID() == MENU_SAVELOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 stru_506F20.Load("lsave640.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13314 pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 GameUI_DrawLoadMenu(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 v15 = pGUIWindow_CurrentMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13320
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13321 MSG msg;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13322 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13323 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13324 if (msg.message == WM_QUIT)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 Game_DeinitializeAndTerminate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13326 TranslateMessage(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13327 DispatchMessageA(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13328 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13329 if (dword_6BE364_game_settings_1 & 0x0100)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 pRenderer->DrawTextureRGB(0, 0, &stru_506F20);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13337 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 GUI_UpdateWindows();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13341 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 pAsyncMouse->_46B736_consume_click_lists(1);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13343 if (GetCurrentMenuID() != MENU_MAIN)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 LABEL_45:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13346 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 crt_deconstruct_ptr_6A0118();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 pGUIWindow_CurrentMenu = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 if ( !ptr_507BDC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 v8 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 v14 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13366 if ( pt.x >= (signed int)v8->uX
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13367 && pt.x <= (signed int)v8->uZ
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13368 && pt.y >= (signed int)v8->uY
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13369 && pt.y <= (signed int)v8->uW
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13370 && v15 == pWindow_MainMenu )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 v9 = v8->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 v10 = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 v11 = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 if ( v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 goto LABEL_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13383 v13 = pExit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 v12 = 337;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13388 v13 = pCredits;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 v12 = 282;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13394 v13 = pLoad;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 v12 = 227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13400 v13 = pNew;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 v12 = 172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 pRenderer->DrawTextureIndexed(495u, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 v8 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 v14 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 v8 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 if ( pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13430 pWindow_MainMenu->Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 //----- (004637EB) --------------------------------------------------------
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13438 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 unsigned int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 Render *v5; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 HANDLE v6; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 Keyboard *v7; // eax@33
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13444 //HDC v9; // edi@41
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 HDC v10; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 int v11; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 char v12; // zf@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 signed int v13; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 int v14; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 int v15; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 int v16; // eax@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 int v17; // eax@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 int v18; // eax@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 int v19; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 int v20; // eax@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 int v21; // eax@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 int v22; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 int v23; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 int v24; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 int v25; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 int v26; // eax@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 char v27; // al@174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 bool v28; // ebx@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 char v29; // dl@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 char v30; // cl@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 bool v31; // ebx@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 void *v32; // ebx@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 float v33; // ST04_4@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 float v34; // ST04_4@254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 HWND v35; // [sp+8h] [bp-64h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 UINT v36; // [sp+Ch] [bp-60h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 WPARAM v37; // [sp+10h] [bp-5Ch]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 LPARAM v38; // [sp+14h] [bp-58h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 int pXY[2]; // [sp+64h] [bp-8h]@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 int a2; // [sp+7Ch] [bp+10h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13478 switch (Msg)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13479 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13480 case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13481 };
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 if ( Msg > WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 switch ( Msg )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 case WM_DEVICECHANGE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 if ( wParam == 0x8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 case WM_SIZING:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 case WM_LBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13500 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 LABEL_210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 goto LABEL_263;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13512 if (GetCurrentMenuID() != MENU_CREATEPARTY)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514 goto LABEL_229;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 case WM_RBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 goto LABEL_240;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13519 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 case WM_LBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 goto LABEL_218;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13528 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 pArcomageGame->stru1.field_0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 case WM_RBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 if ( pAsyncMouse != v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 back_to_game();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13543 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 pArcomageGame->stru1.field_0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 case WM_LBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13552 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 if ( uCurrentMenuID != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 LABEL_229:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 sub_41CD4F(0x29u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 LABEL_230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 if ( pGame != (Game *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 if ( pAsyncMouse != (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, v28, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 UI_OnMouseLeftClick(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 case WM_RBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 if ( pAsyncMouse == (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 if ( pGame != (Game *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 if ( pAsyncMouse != (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 v33 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &stru_F93E30, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 if ( pAsyncMouse == (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13606 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 case WM_MBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 if ( pGame && !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 v34 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &a3, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 if ( !pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 sub_417871(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 case WM_MOUSEMOVE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13628 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 pXY[0] = (unsigned __int16)lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 pXY[1] = lParam >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 ArcomageGame::OnMouseMove((POINT *)pXY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 ArcomageGame::OnMouseClick(0, wParam & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 v29 = (wParam >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 LABEL_262:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 v30 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 LABEL_263:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 ArcomageGame::OnMouseClick(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13642 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 if ( Msg == WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 if ( wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 if ( Msg > WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 if ( Msg == WM_WINDOWPOSCHANGED )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13659 if (pVideoPlayer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13660 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13661 if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13662 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13663 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13664 return DefWindowProcA(hWnd, Msg, wParam, v4);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13665 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 if ( Msg != WM_KEYFIRST )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 if ( Msg == WM_KEYUP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 if ( wParam == VK_CONTROL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 dword_507B98_ctrl_pressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 if ( Msg == WM_CHAR )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 if ( !pKeyActionMap->_459F10(wParam) && !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 GUI_HandleHotkey(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 if ( Msg != WM_COMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 if ( wParam != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 if ( wParam == 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 pRenderer->SavePCXScreenshot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 if ( wParam == 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 pArcomageGame->field_F6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 if ( wParam != 40001 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 v36 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 v35 = ::hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 LABEL_104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 SendMessageA(v35, v36, v37, v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 if ( dword_506E68 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 pKeyActionMap->_459F10(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 if ( wParam != 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 if ( wParam == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 dword_507B98_ctrl_pressed = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 v12 = ptr_507BC0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 if ( wParam <= 0x24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 if ( wParam > 0x28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 if ( wParam != 115 || pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 v37 = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 v36 = 273;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 v35 = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 goto LABEL_104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 && uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 if ( !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 sub_41CD4F(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 pArcomageGame->stru1.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 if ( (signed int)(unsigned __int16)v13 > 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 if ( v13 > 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 v24 = v13 - 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 LOBYTE(pArcomageGame->stru1.field_8) = 123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 if ( !v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 LOBYTE(pArcomageGame->stru1.field_8) = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 LOBYTE(pArcomageGame->stru1.field_8) = 125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 if ( v26 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 LOBYTE(pArcomageGame->stru1.field_8) = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 if ( v13 == 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 LOBYTE(pArcomageGame->stru1.field_8) = 43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 v21 = v13 - 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 LOBYTE(pArcomageGame->stru1.field_8) = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 LOBYTE(pArcomageGame->stru1.field_8) = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 v23 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 LOBYTE(pArcomageGame->stru1.field_8) = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 if ( v23 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 LOBYTE(pArcomageGame->stru1.field_8) = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 if ( (unsigned __int16)v13 == 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 LOBYTE(pArcomageGame->stru1.field_8) = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 if ( v13 > 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 v18 = v13 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 LOBYTE(pArcomageGame->stru1.field_8) = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 LOBYTE(pArcomageGame->stru1.field_8) = 35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 LOBYTE(pArcomageGame->stru1.field_8) = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 LOBYTE(pArcomageGame->stru1.field_8) = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 if ( v13 == 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 LOBYTE(pArcomageGame->stru1.field_8) = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 v14 = v13 - 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 LOBYTE(pArcomageGame->stru1.field_8) = 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 v15 = v14 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 LOBYTE(pArcomageGame->stru1.field_8) = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 v16 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 LOBYTE(pArcomageGame->stru1.field_8) = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 LOBYTE(pArcomageGame->stru1.field_8) = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 LOBYTE(pArcomageGame->stru1.field_8) = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 pArcomageGame->field_F5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 pArcomageGame->field_F4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 pArcomageGame->uGameResult = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 pArcomageGame->field_B0 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 if ( wParam != 114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912 SendMessageA(hWnd, 0x111u, 0x68u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 v37 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 LOBYTE(pArcomageGame->stru1.field_8) = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 if ( Msg == WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 if ( wParam && (GetForegroundWindow() == hWnd || GetForegroundWindow() == hInsertCDWindow) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 dword_4E98BC_bApplicationActive = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 v10 = GetDC(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 a2 = GetDeviceCaps(v10, BITSPIXEL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 v11 = GetDeviceCaps(v10, PLANES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 ReleaseDC(0, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 if ( a2 != 16 || v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 Abortf(pGlobalTXT_LocalizationStrings[62]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13943 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 if ( BYTE1(dword_6BE364_game_settings_1) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 BYTE1(dword_6BE364_game_settings_1) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 if ( BYTE1(dword_6BE364_game_settings_1) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 if ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 pRenderer->RestoreFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 pRenderer->_4A184C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 if ( !(dword_6BE364_game_settings_1 & 0x100) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 pVideoPlayer->bStopBeforeSchedule = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13980 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 dword_6BE364_game_settings_1 |= 0x100u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 if ( pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 BYTE1(dword_6BE364_game_settings_1) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 if ( pMiscTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 BYTE1(dword_6BE364_game_settings_1) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 if ( pGame && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 }
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14003 if (Msg == WM_CREATE)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14004 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14005 auto hDC = GetDC(hWnd);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14006 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14007 if (GetDeviceCaps(hDC, BITSPIXEL) < 8)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14008 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14009 ReleaseDC(hWnd, hDC);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14010 Log::Warning(L"You must be running in 256 color mode or higher.");
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14011 Abortf("You must be running in 256 color mode or higher. You can change the screen depth with the control panel display icon.");
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14012 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14013 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14014 ReleaseDC(hWnd, hDC);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 if ( Msg == WM_DESTROY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 v6 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 SetPriorityClass(v6, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 if ( pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 v7 = pGame->pKeyboardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 if ( LOBYTE(v7->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 pAsyncKeyboard->_45B3A4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14030 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 pAsyncMouse->_46B1DD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 PostQuitMessage(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 if ( Msg == WM_SETFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 if ( ::hWnd == (HWND)wParam )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 ClipCursor(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14043 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 _def_wnd_proc:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 if ( Msg != WM_KILLFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 if ( Msg == WM_PAINT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 if ( !GetUpdateRect(hWnd, 0, 0) || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 BeginPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 EndPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 //----- (00464479) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 int v0; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 pPaletteManager->ResetNonLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 pBitmaps_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 pSprites_LOD->DeleteSomeOtherSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 pIcons_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 pRenderer->field_1036B8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 pRenderer->_gpu_memory_used = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 sub_46080D();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 pIndoor->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 pOutdoor->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 uCurrentlyLoadedLevelType = (LEVEL_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 pSpriteFrameTable->ResetSomeSpriteFlags();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 v0 = uNumVisibleWindows;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 while ( v0 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 //----- (004646F0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 void PrepareWorld(unsigned int this_)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 v1 = this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 pGame->pVisInstance->_4C1A02();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 pParty->uFlags = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 pStru277->_427D48(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 DoPrepareWorld(0, (v1 == 0) + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 //----- (00464761) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 void __thiscall Game_DeinitializeAndTerminate(int exitCode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 v1 = exitCode;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 v2 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 SetPriorityClass(v2, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 pRenderer->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 if ( !DestroyWindow(hWnd) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 hWnd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 exit(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 //----- (004647AB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 void __cdecl FinalInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 pViewport->_4C02F8((signed __int64)(flt_6BE3A0 * 65536.0));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14165 pIndoorCamera = new IndoorCamera;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 pIndoorCamera->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 65,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 viewparams->uScreenZ - viewparams->uScreenX + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 viewparams->uScreenW - viewparams->uScreenY + 1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14170
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 InitializeTurnBasedAnimations(&stru_50C198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 // 6BE3A0: using guessed type float flt_6BE3A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 //----- (00464839) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 char __cdecl Is_out15odm_underwater()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 return _strcmpi(pCurrentMapName, "out15.odm") == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 //----- (00464851) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 void __cdecl SetUnderwaterFog()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 day_fogrange_1 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 day_fogrange_2 = 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 //----- (00464866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 void __fastcall DoPrepareWorld(unsigned int bLoading, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 char *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 char *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 size_t v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 char Str1[20]; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 unsigned int v9; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 v9 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 pDecalBuilder->Reset(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 pGameLoadingUI_ProgressBar->_443484(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 v3 = strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 strcpy(Str1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 Level_LoadEvtAndStr(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 LoadLevel_InitializeLevelEvt();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 v4 = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 *(short *)v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 v4 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 while ( (signed int)v4 < (signed int)((char *)&pObjectList->uNumObjects + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 v5 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 uLevelMapStatsID = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 if ( !_strcmpi(pCurrentMapName, "out15.odm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 pParty->field_6F4_packedid = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 if ( _strcmpi(Str1, "blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 PrepareToLoadODM(v9, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 PrepareToLoadBLV(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 pAudioPlayer->SetMapEAX();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 sub_461103();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 if ( !_strcmpi(pCurrentMapName, "d11.blv") || !_strcmpi(pCurrentMapName, "d10.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 v6 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 v7 = (char *)&pActors[0].pMonsterInfo.uTreasureType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 *(v7 - 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 *(int *)(v7 + 59) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 v7 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 bDialogueUI_InitializeActor_NPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 OnMapLoad();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 pGameLoadingUI_ProgressBar->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 _flushall();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 // 5C35C4: using guessed type int bDialogueUI_InitializeActor_NPC_ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 //----- (004649EF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 int v3; // [sp+4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 DWORD cbData; // [sp+8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 DWORD dwDisposition; // [sp+10h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 BYTE Data[4]; // [sp+14h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 HKEY hKey; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 HKEY phkResult; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 HKEY v10; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 HKEY v11; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 v3 = uDefValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 cbData = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v10, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 if ( !RegCreateKeyExA(v10, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v11, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 *(int *)Data = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 RegCloseKey(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 RegCloseKey(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 return *(int *)Data;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 //----- (00464B02) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 size_t v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 const char *Str; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 HKEY v8; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 HKEY v9; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 Str = pString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v8, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 if ( !RegCreateKeyExA(v8, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v9, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 v2 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 RegSetValueExA(v9, lpValueName, 0, 1u, (const BYTE *)Str, v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 RegCloseKey(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 //----- (00464BEF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 LSTATUS (__stdcall *v4)(HKEY); // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 LSTATUS result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 DWORD Type; // [sp+Ch] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 LPCSTR lpValueName; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 DWORD cbData; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 LPBYTE Dest; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 DWORD dwDisposition; // [sp+1Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 HKEY phkResult; // [sp+20h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 HKEY hKey; // [sp+24h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 HKEY v13; // [sp+28h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 HKEY v14; // [sp+2Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 cbData = uBufLen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 Dest = (LPBYTE)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 lpValueName = pKeyName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 || RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 || RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v13, &dwDisposition)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 || RegCreateKeyExA(v13, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v14, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 if ( RegQueryValueExA(v14, lpValueName, 0, &Type, Dest, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 RegCloseKey(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 result = RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 result = v4(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 result = v4(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 if ( hKey )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 result = v4(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 if ( phkResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 result = v4(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 //----- (00464D32) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 BYTE Data[4]; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 HKEY v7; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 HKEY v8; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 *(int *)Data = val;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v7, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 if ( !RegCreateKeyExA(v7, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v8, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 RegSetValueExA(v8, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 RegCloseKey(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 //----- (00464E17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 bool __fastcall CheckMM7CD(char c)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 char DstBuf[256]; // [sp+Ch] [bp-218h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 char strCommand[256]; // [sp+10Ch] [bp-118h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 char Filename[20]; // [sp+20Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 wchar_t pMagicPath[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 swprintf(pMagicPath, L"%C:\\anims\\magic7.vid", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 if (GetFileAttributesW(pMagicPath) == -1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 wsprintfA(strCommand, "info CD UPC wait");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 wsprintfA(strCommand, "close CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 *Filename = c;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 auto f = fopen(Filename, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 if (!f)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 if (!fseek(f, 0, SEEK_END))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 if (!fseek(f, -100, SEEK_CUR))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 fread(DstBuf, 1u, 0x64u, f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 //----- (00464F1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 char v4; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 INT_PTR v12; // [sp-4h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 if ( a2 == 272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 hInsertCDWindow = hDlg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 v7 = v6 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 v8 = v7 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 v9 = v8 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 if ( v9 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 v11 = "Odwolaj";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 SetWindowTextA(hDlg, "Inserire il secondo CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 v11 = "Annulla";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 SetWindowTextA(hDlg, "Insrez le CD 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 SetDlgItemTextA(hDlg, 1010, "Insrez Might & Magic VII CD 2.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 v11 = "Supprimer";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 v11 = "Cancelar";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic VII einlegen.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 v11 = "Abbrechen";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 v10(hDlg, 2, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 if ( a2 == 273 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 if ( a3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 EndDialog(hDlg, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 v4 = a3 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v4 = a2 == 1025;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 //----- (00465061) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 char drive[4] = {'X', ':', '\\', 0};
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 bool bGotCDFromRegistry = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 HKEY hSoftware = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 hNWC = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 hMM7 = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 hVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 DWORD cbData = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 bGotCDFromRegistry = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 RegCloseKey(hVersion);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 RegCloseKey(hMM7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 RegCloseKey(hNWC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 RegCloseKey(hSoftware);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 if (bGotCDFromRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 if (CheckMM7CD(*drive))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 while (true)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 for (uint i = 0; i < 26; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 drive[0] = 'A' + i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 if (GetDriveTypeA(drive) == DRIVE_CDROM)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 if (CheckMM7CD(bGotCDFromRegistry))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 WriteWindowsRegistryString("CDDrive", drive);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", ::hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 //----- (004651F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 bool MM7_Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 {
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14636 wchar_t pCurrentDir[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14637 _wgetcwd(pCurrentDir, 1024);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14638
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14639 wchar_t pMM6IniFile[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14640 wsprintf(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14641
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14642 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14643 if (bNoCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14644 bCanLoadFromCD = false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14645 if (bCanLoadFromCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14646 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14647 if (!FindMM7CD(hWnd, &cMM7GameCDDriveLetter))
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14648 return false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14649 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14650
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14651
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 srand(GetTickCount());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 /*GetDiskFreeSpaceA(0, &SectorsPerCluster, &BytesPerSector, &hdc, &TotalNumberOfClusters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 v4 = hdc * BytesPerSector * SectorsPerCluster;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 if ( (unsigned int)v4 < 0x1E00000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 "Due to Window Virtual Memory requirements Might and Magic VII\nrequires 30MB of free hard drive space to operate properly.\n\nAvailable on Current Drive = %luk",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 (unsigned int)v4 / 1024i64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 v41 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 v40 = "More Hard Drive Space Required";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 v39 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 WNDCLASSEXW wcxw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 wcxw.cbSize = sizeof(wcxw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 wcxw.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 wcxw.lpfnWndProc = (WNDPROC)aWinProc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 wcxw.cbClsExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 wcxw.cbWndExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 wcxw.hInstance = GetModuleHandleW(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 wcxw.hCursor = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 wcxw.hIcon = wcxw.hIconSm = LoadIconW(wcxw.hInstance, L"MM7_ICON");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 wcxw.lpszMenuName = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 wcxw.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14679 wcxw.lpszClassName = L"M&MTrilogy";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 if (!RegisterClassExW(&wcxw))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 Log::Warning(L"Cannot register window class");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 auto hDesktopDC = GetDC(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 uint uDesktopWidth = GetDeviceCaps(hDesktopDC, HORZRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 uint uDesktopHeight = GetDeviceCaps(hDesktopDC, VERTRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 if (GetDeviceCaps(hDesktopDC, BITSPIXEL) != 16 ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 GetDeviceCaps(hDesktopDC, PLANES) != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 dword_6BE364_game_settings_1 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 ReleaseDC(nullptr, hDesktopDC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 uint uTotalWinWidth = 2 * GetSystemMetrics(SM_CXFRAME) + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 uint uTotalWinHeight = GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYFRAME) + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 uint uWinCenteredPosX = (uDesktopWidth - uTotalWinWidth) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 uint uWinCenteredPosY = (uDesktopHeight - uTotalWinHeight) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 uWindowX = ReadWindowsRegistryInt("window X", uWinCenteredPosX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 uWindowX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 WriteWindowsRegistryInt("window X", uWindowX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 uWindowY = ReadWindowsRegistryInt("window Y", uWinCenteredPosY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 uWindowY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 WriteWindowsRegistryInt("window Y", uWindowY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 hWnd = CreateWindowExW(0, wcxw.lpszClassName, L"Might and Magic VII",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 uWindowStyle = WS_SYSMENU | WS_GROUP | WS_DLGFRAME | WS_BORDER,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 640, 480,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 hOSMenu = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 wcxw.hInstance,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 nullptr);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14720 SetWindowTextW(hWnd, L"Might and Magic VII");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 pRenderer = Render::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 if (!pRenderer)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 Log::Warning(L"Render creation failed");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 if (!pRenderer->Initialize(bWindowMode, uDefaultDevice, bColoredLights, uLevelOfDetail, bTinting))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 Log::Warning(L"Render failed to initialize");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 pAllocator = Allocator::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 if (!pAllocator->Initialize(26 * 1024))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 L"Unable to Allocate 26Mb of RAM",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 L"More RAM Memory Required", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 pParty = new Party;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 pParty->sEyelevel = pParty->uDefaultEyelevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 bUseRegistry = GetPrivateProfileIntW(L"settings", L"registry", 1, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 MM6_Initialize(pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 pKeyActionMap = new KeyboardActionMapping;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 pEventTimer = Timer::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 pEventTimer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 OnTimer(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 GameUI_StatusBar_UpdateTimedString(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 pGame = Game::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 pMouse = pGame->pMouseInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 RECT rcWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 GetWindowRect(hWnd, &rcWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 RECT rcClient;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 GetClientRect(hWnd, &rcClient);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 uWindowWidth = rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 uWindowHeight = rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 MoveWindow(hWnd, uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 ShowWindow(hWnd, SW_SHOWNORMAL);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
14787
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 pIcons_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 if (!pIcons_LOD->LoadIconsOrEvents("data\\icons.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 pIcons_LOD->dword_011BA4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 pEvents_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 if (!pEvents_LOD->LoadIconsOrEvents("data\\events.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 InitializeGameText();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 pBitmaps_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 if (!pBitmaps_LOD->LoadBitmaps("data\\bitmaps.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 bUseLoResSprites = ReadWindowsRegistryInt("resolution", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 bUseLoResSprites = GetPrivateProfileIntW(L"settings", L"resolution", 0, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 const char *pSpritesFile = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 if (bUseLoResSprites)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 pSpritesFile = "data\\spriteLO.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 pSpritesFile = "data\\sprites.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 pSprites_LOD = new LODFile_Sprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 if (!pSprites_LOD->LoadSprites(pSpritesFile))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 if (!pSpriteFrameTable->FromFileTxt("data\\sft.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 Abortf("Unable to open sft.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 if (!pDecorationList->FromFileTxt("data\\declist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 Abortf("Unable to open declist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 if (!pObjectList->FromFileTxt("data\\objlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 Abortf("Unable to open objlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 if (!pMonsterList->FromFileTxt("data\\monlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 Abortf("Unable to open monlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 if (!pIconsFrameTable->FromFileTxt("data\\ift.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 Abortf("Unable to open ift.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 if (!pTextureFrameTable->FromFileTxt("data\\tft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 Abortf("Unable to open tft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 if (!pTileTable->FromFileTxt("data\\tile.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 Abortf("Unable to open tile.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 if (!pPlayerFrameTable->FromFileTxt("data\\pft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 Abortf("Unable to open pft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 if (!pChestList->FromFileTxt("data\\chest.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 Abortf("Unable to open chest.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 if (!pOverlayList->FromFileTxt("data\\overlay.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 Abortf("Unable to open overlay.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 if (!pSoundList->FromFileTxt("data\\sounds.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 Abortf("Unable to open sounds.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 auto pSFT = pEvents_LOD->LoadRaw("dsft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 pSpriteFrameTable->FromFile(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 free(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 auto pTFT = pEvents_LOD->LoadRaw("dtft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 pTextureFrameTable->FromFile(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 free(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 auto pTiles = pEvents_LOD->LoadRaw("dtile.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 pTileTable->FromFile(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 free(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 auto pPFT = pEvents_LOD->LoadRaw("dpft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 pPlayerFrameTable->FromFile(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 free(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 auto pIFT = pEvents_LOD->LoadRaw("dift.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 pIconsFrameTable->FromFile(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 free(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 auto pDecs = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 pDecorationList->FromFile(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 free(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 auto pObjs = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 pObjectList->FromFile(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 free(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 auto pMons = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 pMonsterList->FromFile(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 free(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 auto pChests = pEvents_LOD->LoadRaw("dchest.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 pChestList->FromFile(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 free(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 auto pOverlays = pEvents_LOD->LoadRaw("doverlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 pOverlayList->FromFile(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 free(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 auto pSounds = pEvents_LOD->LoadRaw("dsounds.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 pSoundList->FromFile(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 free(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 pSpriteFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 pDecorationList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 pObjectList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 pMonsterList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 pIconsFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 pTextureFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 pTileTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 pPlayerFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 pChestList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 pOverlayList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 pSoundList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 // color depth != 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 // or
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 // not in window
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 SetMenu(hWnd, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 SetWindowLongA(hWnd, GWL_EXSTYLE, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 pRenderer->InitializeFullscreen(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 ClipCursor(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 pRenderer->SwitchToWindow(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 uSoundVolumeMultiplier = ReadWindowsRegistryInt("soundflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14979 if (uSoundVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 uSoundVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 uMusicVolimeMultiplier = ReadWindowsRegistryInt("musicflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14982 if (uMusicVolimeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 uMusicVolimeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 uVoicesVolumeMultiplier = ReadWindowsRegistryInt("CharVoices", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14985 if (uVoicesVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 uVoicesVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 byte_6BE388_graphicsmode = ReadWindowsRegistryInt("graphicsmode", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 if (byte_6BE388_graphicsmode < 0 || byte_6BE388_graphicsmode > 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 byte_6BE388_graphicsmode = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 uGammaPos = ReadWindowsRegistryInt("GammaPos", 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 if (uGammaPos < 0 || uGammaPos > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 uGammaPos = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 if ( ReadWindowsRegistryInt("Bloodsplats", 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 pGame->uFlags2 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 pGame->uFlags2 &= 0xFFFFFFDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 dword_6BE384_2dacceloff = ReadWindowsRegistryInt("2dacceloff", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15005 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 pAudioPlayer->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 pVideoPlayer = new VideoPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 pVideoPlayer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15011 dword_6BE364_game_settings_1 |= 0x4000;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 switch ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 uTurnSpeed = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 uTurnSpeed = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 uTurnSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 }
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15032 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 //----- (00465D0B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 void __cdecl SecondaryInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 __int16 v4; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 int v7; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 ObjectDesc *v8; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 char pContainer[32]; // [sp+10h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 pMouse->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 CreateAsyncMouse();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 CreateAsyncKeyboard();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 pItemsTable = new ItemsTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 pItemsTable->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 pBitmaps_LOD->dword_011BA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 pPaletteManager->field_267AD0 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 pPaletteManager->field_267AD1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 pPaletteManager->field_267AD2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 pSprites_LOD->field_ECAC = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 pObjectList->InitializeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 pOverlayList->InitializeSprites();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15066 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 pSoundList->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 static const char *pUIAnimNames[4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 "glow03", "glow05",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 "torchA", "wizeyeA"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 static unsigned short _4E98D0[4][4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 {479, 0, 329, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 {585, 0, 332, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 {468, 0, 0, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 {606, 0, 0, 0}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 for (uint i = 0; i < 4; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 pUIAnims[i]->uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 pUIAnims[i]->uAnimTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 pUIAnims[i]->x = _4E98D0[i][0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 pUIAnims[i]->y = _4E98D0[i][2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 if ( (signed int)pObjectList->uNumObjects > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 BYTE3(v7) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 v8 = &pObjectList->pObjects[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 *(short *)((char *)&v7 + 1) = v8->uParticleTrailColorR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 LOBYTE(v7) = v8->uParticleTrailColorG;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 v8->uParticleTrailColor = v8->uParticleTrailColorB | (v7 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 while ( v5 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 flt_6BE3A0 = 0.55000001f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 MainMenuUI_Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 pGame->pStru6Instance->LoadAnimations();
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15113
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15114 for (uint i = 0; i < 7; ++i)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15115 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15116 sprintf(pContainer, "HDWTR%03u", i);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15117 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(pContainer);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
15118 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 pNPCStats = new NPCStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 pNPCStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 Initialize_GlobalEVT();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 pBitmaps_LOD->dword_11B80 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 if ( pBitmaps_LOD->dword_11B84 < (signed int)pBitmaps_LOD->uNumLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 pSprites_LOD->field_ECA4 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 if ( pSprites_LOD->field_ECA0 < (signed int)pSprites_LOD->uNumLoadedSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 pPaletteManager->LockAll();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15131
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 _mkdir("Saves");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15133 for (uint i = 0; i < 5; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15134 for (uint j = 0; j < 6; ++j)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15135 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15136 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15137 remove(pTmpBuf);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15138 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15139 /*do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 while ( v11 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15151 while ( v10 < 5 );*/
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15152
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 Initialize_GamesLOD_NewLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 dword_576E2C = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 dword_576E28 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 bool MM_Main(const wchar_t *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 HWND hPrevWnd; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 HWND hPrevWnd_; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 HWND v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 //bool v9; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 OtherOverlay *v10; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 signed int v11; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 unsigned int v12; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 HANDLE v13; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 unsigned int startms; // [sp+8h] [bp-24h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 RECT Rect; // [sp+Ch] [bp-20h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 int a2[4]; // [sp+1Ch] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 if (pCmdLine && *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 if (wcsstr(pCmdLine, L"-usedefs"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 bDebugResouces = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 if (wcsstr(pCmdLine, L"-window"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 dword_6BE368_debug_settings_2 |= 1u;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15188
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15189 if (wcsstr(pCmdLine, L"-nointro"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15190 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15191 if (wcsstr(pCmdLine, L"-nologo"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15192 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 if (wcsstr(pCmdLine, L"-nosound"))
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15194 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15195
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15196 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15197 if (wcsstr(pCmdLine, L"-nowalksound"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15198 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 if (wcsstr(pCmdLine, L"-noanim"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 dword_6BE364_game_settings_1 |= 0x40;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15202 bNoVideo = true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15203 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15204 if (wcsstr(pCmdLine, L"-nocd"))
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15205 bNoCD = true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 stru_51076C.registry_debug_flags = ReadWindowsRegistryInt("debug flags", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 v8 = sub_4AC1C9(0, (Vec4_int_ *)a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 Rect.left = *(int *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 Rect.top = *(int *)(v8 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 Rect.right = *(int *)(v8 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 Rect.bottom = *(int *)(v8 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 uCPUSpeed = Rect.bottom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 if (MM7_Initialize())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 SetWindowPos(hWnd, (HWND)((int)HWND_MESSAGE|0x2), 320, 240, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 Rect.left = 325;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 Rect.top = 245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 Rect.right = 326;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 Rect.bottom = 246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 ClipCursor(&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 SetUserInterface(1, false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 WriteWindowsRegistryInt("Ran once", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 dword_6BE364_game_settings_1 |= 0x4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 pGame->InitializeGammaController();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 SecondaryInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 pRenderer->Clip_v2(0, 0, 639u, 479u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 FinalInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 MainMenu_Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15245 switch (uGameState)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15246 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15247 case GAME_FINISHED:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 pGame->Deinitialize();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15249 return true;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15250 }
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15251
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15252 if (GetCurrentMenuID() == MENU_FINISHED)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15253 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15254 uGameState = GAME_FINISHED;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15255 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15257 if (GetCurrentMenuID() == MENU_NEWGAME)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 v10 = (OtherOverlay *)&pOtherOverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 v11 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 v10->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 --v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 while ( v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 strcpy(pCurrentMapName, pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 pParty->CreateDefaultParty(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 PlayerCreationUI_Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 if ( PlayerCreationUI_Loop() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 bFlashQuestBook = 1;
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 4
diff changeset
15281 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 MaybeDoAutosave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15285 if (GetCurrentMenuID() == MENU_CREDITS)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15287 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15293 if (GetCurrentMenuID() != MENU_10)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 pMouse->Activate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15296 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 pParty->CreateDefaultParty(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 crt_init_globals_46271C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 extern OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15307 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 _chdir("..\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 strcpy(pCurrentMapName, ofn.lpstrFileTitle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15316 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 pGame->Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 if ( uGameState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 v12 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 goto LABEL_57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 if ( uGameState == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 LABEL_57:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 SetCurrentMenuID(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 if ( uGameState == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 extern MENU_STATE __cdecl CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 LABEL_53:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15350 if (!bNoSound && pAudioPlayer->hAILRedbook)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 pAudioPlayer->SetMusicVolume(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 unsigned int end_ms;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 0xEu, &startms, &end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 //----- (004637E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 char __cdecl sub_4637E0_is_there_popup_onscreen()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 return dword_507BF0_is_there_popup_onscreen == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 //----- (00465F5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 void __cdecl CreateAsyncMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 if (!pAsyncMouse &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 pRenderer->bUserDirect3D &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 pRenderer->uAcquiredDirect3DDevice == 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 pAsyncMouse = new AsyncMouse(&pRenderer->pDirectDraw4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 //----- (00465FF0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 void __cdecl CreateAsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 if (!pAsyncKeyboard &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 pGame->pKeyboardInstance->bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 pAsyncKeyboard = new AsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 if (pAsyncKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 //----- (00466082) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 void MM6_Initialize(const wchar_t *pIniFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 //int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 UINT v1; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 size_t v2; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 size_t v3; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 size_t v4; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 //char v5[120]; // [sp+Ch] [bp-17Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 //char String[120]; // [sp+84h] [bp-104h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 unsigned int v9; // [sp+184h] [bp-4h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 //_getcwd(v5, 120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 viewparams = new ViewingParams;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 viewparams->uScreenX = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 viewparams->uScreenY = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 viewparams->uScreenZ = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 viewparams->uScreenW = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 pAudioPlayer = new AudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 if ( pAudioPlayer->uMixerChannels > 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 pAudioPlayer->uMixerChannels = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
15436
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 dword_6BE368_debug_settings_2 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 v1 = ReadWindowsRegistryInt("startinwindow", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 v1 = GetPrivateProfileIntW(L"debug", L"startinwindow", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 if (v1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 dword_6BE368_debug_settings_2 |= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 dword_6BE368_debug_settings_2 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 dword_6BE368_debug_settings_2 |= 0x10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 dword_6BE368_debug_settings_2 |= 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 wchar_t pStartingMapNameW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 sprintf(pStartingMapName, "%S", pStartingMapNameW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 if ( strlen(pStartingMapName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 if ( pStartingMapName[v9] == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 pStartingMapName[v9] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 v2 = strlen(pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 while ( v9 < v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 pOutdoorCamera = new OutdoorCamera;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 outdoor_day_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.r", 81, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 outdoor_day_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.g", 121, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 outdoor_day_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.b", 236, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 outdoor_day_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.r", 153, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 outdoor_day_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.g", 193, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 outdoor_day_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.b", 237, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 outdoor_night_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.r", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 outdoor_night_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.g", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 outdoor_night_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.b", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 outdoor_night_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.r", 11, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 outdoor_night_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.g", 41, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 outdoor_night_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.b", 129, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 pOutdoorCamera->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 pOutdoorCamera->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 pOutdoorCamera->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 pOutdoorCamera->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 pOutdoorCamera->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 pOutdoorCamera->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 mipmapping_terrain_mm1 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm1", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 mipmapping_terrain_mm2 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm2", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 mipmapping_terrain_mm3 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm3", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 mipmapping_building_mm1 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm1", 1024, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495 mipmapping_building_mm2 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm2", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 pOutdoorCamera->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 wchar_t pDefaultSkyTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 wchar_t pDefaultGroundTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 wchar_t pFloat[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 if ( strlen(pDefaultSkyTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 if ( pDefaultSkyTexture[v3] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 pDefaultSkyTexture[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 while ( v3 < strlen(pDefaultSkyTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 if ( strlen(pDefaultGroundTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 if ( pDefaultGroundTexture[v4] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 pDefaultGroundTexture[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 while ( v4 < strlen(pDefaultGroundTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 texmapping_terrain_subdivsize = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivsize", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15542 texmapping_terrain_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivpow2", 4, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 texmapping_building_subdivsize = GetPrivateProfileIntW(L"texmapping", L"building_subdivsize", 32, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 texmapping_building_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"building_subdivpow2", 5, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 //----- (004666D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 void __cdecl MM7Initialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15552 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 if ( !byte_6BE388_graphicsmode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 outdoor_grid_band_1 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 outdoor_grid_band_2 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 outdoor_grid_band_3 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 pOutdoorCamera->shading_dist_mist = 8192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 pOutdoorCamera->bNoSky = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 mipmapping_terrain_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 mipmapping_terrain_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 mipmapping_building_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 mipmapping_building_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 pOutdoorCamera->shading_dist_shade = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 pOutdoorCamera->terrain_gamma = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 pOutdoorCamera->building_gamme = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 mipmapping_terrain_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 mipmapping_building_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 pOutdoorCamera->shading_dist_shademist = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 pOutdoorCamera->outdoor_no_wavy_water = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 sub_47F4D3(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 viewparams->uSomeY = viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 viewparams->uSomeX = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 viewparams->uSomeZ = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 viewparams->uSomeW = viewparams->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 pViewport = new Viewport;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 pViewport->SetScreen(viewparams->uScreenX, viewparams->uScreenY, viewparams->uScreenZ, viewparams->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 //----- (00466B8C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 int __cdecl AbortWithError()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 if ( !aborting_app )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 aborting_app = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 SaveGame(1, 0); // "Internal Error"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 // "Might and Magic VII has detected an internal error and will be forced to close. Would you like us to autosave your game before closing?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 // 720018: using guessed type int aborting_app;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 //----- (00466BE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 void Abortf(const char *Format, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 va_list va; // [sp+8h] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 va_start(va, Format);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 vsprintf(pTmpBuf, Format, va);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 pMouse->Activate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 MessageBoxA(0, pTmpBuf, "Error", 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 //----- (00466C40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 // #define MENU_MAIN 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 // #define MENU_NEWGAME 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 // #define MENU_CREDITS 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 // #define MENU_LOAD 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 // #define MENU_CREATEPARTY 6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 // #define MENU_MAINMENULOAD 9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 void __thiscall SetCurrentMenuID(unsigned int uMenu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 v1 = uMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 if ( uCurrentMenuID == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 if ( uMenu != -1 && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 if ( uMenu == -1 && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 uCurrentMenuID = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 //----- (00466CA0) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15653 unsigned int GetCurrentMenuID()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 return uCurrentMenuID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 if ( v4 > -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 switch ( v4 + 2005532212 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 v7 = "DDERR_SURFACENOTATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 v7 = "DDERR_TOOBIGHEIGHT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 v7 = "DDERR_TOOBIGSIZE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 v7 = "DDERR_TOOBIGWIDTH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 case 50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 v7 = "DDERR_UNSUPPORTEDFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 case 60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 v7 = "DDERR_UNSUPPORTEDMASK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 case 61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 v7 = "DDERR_INVALIDSTREAM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 case 77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 v7 = "DDERR_VERTICALBLANKINPROGRESS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 case 80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 v7 = "DDERR_WASSTILLDRAWING";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 case 100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 v7 = "DDERR_XALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 v7 = "DDERR_INVALIDDIRECTDRAWGUID";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 v7 = "DDERR_DIRECTDRAWALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 v7 = "DDERR_NODIRECTDRAWHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 v7 = "DDERR_PRIMARYSURFACEALREADYEXISTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 case 105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 v7 = "DDERR_NOEMULATION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 case 106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 v7 = "DDERR_REGIONTOOSMALL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 case 107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 v7 = "DDERR_CLIPPERISUSINGHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 case 108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 v7 = "DDERR_NOCLIPPERATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 case 109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 v7 = "DDERR_NOHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 case 110:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 v7 = "DDERR_HWNDSUBCLASSED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 case 111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 v7 = "DDERR_HWNDALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 case 112:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 v7 = "DDERR_NOPALETTEATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 case 113:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 v7 = "DDERR_NOPALETTEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 case 114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 v7 = "DDERR_BLTFASTCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 case 115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 v7 = "DDERR_NOBLTHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 case 116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 v7 = "DDERR_NODDROPSHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 case 117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 v7 = "DDERR_OVERLAYNOTVISIBLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 case 118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 v7 = "DDERR_NOOVERLAYDEST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 case 119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 v7 = "DDERR_INVALIDPOSITION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 case 120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 v7 = "DDERR_NOTAOVERLAYSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 case 121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 v7 = "DDERR_EXCLUSIVEMODEALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 case 122:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 v7 = "DDERR_NOTFLIPPABLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 case 123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 v7 = "DDERR_CANTDUPLICATE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 case 125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 v7 = "DDERR_CANTCREATEDC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 case 126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 v7 = "DDERR_NODC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 case 127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 v7 = "DDERR_WRONGMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 case 128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 v7 = "DDERR_IMPLICITLYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 case 129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 v7 = "DDERR_NOTPALETTIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 case 130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 v7 = "DDERR_UNSUPPORTEDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 case 131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 v7 = "DDERR_NOMIPMAPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 case 132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 v7 = "DDERR_INVALIDSURFACETYPE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 case 140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 v7 = "DDERR_NOOPTIMIZEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 case 141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 v7 = "DDERR_NOTLOADED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 case 142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 v7 = "DDERR_NOFOCUSWINDOW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 case 160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 v7 = "DDERR_DCALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 case 170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 v7 = "DDERR_NONONLOCALVIDMEM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 case 180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 v7 = "DDERR_CANTPAGELOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 case 200:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 v7 = "DDERR_CANTPAGEUNLOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 v7 = "DDERR_NOTPAGELOCKED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 case 230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 v7 = "DDERR_MOREDATA";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 case 231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 v7 = "DDERR_EXPIRED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 case 235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 v7 = "DDERR_VIDEONOTACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 case 239:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 v7 = "DDERR_DEVICEDOESNTOWNSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 case 124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 if ( v4 != -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 if ( v4 > -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 if ( v4 <= -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 if ( v4 == -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 v7 = "DDERR_NOVSYNCHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 if ( v4 > -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 if ( v4 == -2005532382 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 v7 = "DDERR_NOROTATIONHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 if ( v4 == -2005532362 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 v7 = "DDERR_NOSTRETCHHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 if ( v4 == -2005532356 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 v7 = "DDERR_NOT4BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 if ( v4 == -2005532355 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 v7 = "DDERR_NOT4BITCOLORINDEX";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 if ( v4 == -2005532352 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 v7 = "DDERR_NOT8BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 if ( v4 == -2005532342 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 v7 = "DDERR_NOTEXTUREHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 if ( v4 == -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 v7 = "DDERR_NORASTEROPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 if ( v4 == -2005532442 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 v7 = "DDERR_NOFLIPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 if ( v4 == -2005532432 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 v7 = "DDERR_NOGDI";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 if ( v4 == -2005532422 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 v7 = "DDERR_NOMIRRORHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 if ( v4 == -2005532417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 v7 = "DDERR_NOTFOUND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 if ( v4 == -2005532412 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 v7 = "DDERR_NOOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 if ( v4 == -2005532402 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 v7 = "DDERR_OVERLAPPINGRECTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 if ( v4 <= -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 if ( v4 == -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 v7 = "DDERR_PALETTEBUSY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 if ( v4 == -2005532332 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 v7 = "DDERR_NOZBUFFERHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 if ( v4 == -2005532322 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 v7 = "DDERR_NOZOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 if ( v4 == DDERR_OUTOFCAPS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 v7 = "DDERR_OUTOFCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 if ( v4 == DDERR_OUTOFVIDEOMEMORY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 v7 = "DDERR_OUTOFVIDEOMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 if ( v4 == DDERR_OVERLAYCANTCLIP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 v7 = "DDERR_OVERLAYCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 if ( v4 == DDERR_OVERLAYCOLORKEYONLYONEACTIVE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 v7 = "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 if ( v4 == -2005532272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 v7 = "DDERR_COLORKEYNOTSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 if ( v4 == -2005532262 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 v7 = "DDERR_SURFACEALREADYATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 if ( v4 == -2005532252 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 v7 = "DDERR_SURFACEALREADYDEPENDENT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 if ( v4 != -2005532242 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 if ( v4 == -2005532237 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 v7 = "DDERR_CANTLOCKSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 if ( v4 == -2005532232 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 v7 = "DDERR_SURFACEISOBSCURED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 if ( v4 == -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 v7 = "DDERR_NOEXCLUSIVEMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 if ( v4 <= -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 if ( v4 == -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 v7 = "DDERR_INVALIDCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 if ( v4 > -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 if ( v4 == -2005532652 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 v7 = "DDERR_CANNOTDETACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 if ( v4 == -2005532632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 v7 = "DDERR_CURRENTLYNOTAVAIL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 if ( v4 == -2005532617 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 v7 = "DDERR_EXCEPTION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 if ( v4 == -2005532582 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 v7 = "DDERR_HEIGHTALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 if ( v4 == -2005532577 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 v7 = "DDERR_INCOMPATIBLEPRIMARY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 if ( v4 == -2005532572 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 v7 = "DDERR_INVALIDCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 if ( v4 == -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 v7 = "DDERR_CANNOTATTACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 if ( v4 == -2147467263 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 v7 = "DDERR_UNSUPPORTED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 if ( v4 == -2147467259 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 v7 = "DDERR_GENERIC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 if ( v4 == -2147221008 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 v7 = "DDERR_NOTINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 if ( v4 == -2147024882 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 v7 = "DDERR_OUTOFMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 if ( v4 == -2147024809 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 v7 = "DDERR_INVALIDPARAMS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 if ( v4 == -2005532667 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 v7 = "DDERR_ALREADYINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 LABEL_173:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070 v13 = strlen(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 v12 = (char *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 std::stringoperator_assign__const_char_ptr__(&a1, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 pRenderer->field_40110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 v15 = &v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 std::string40E2C8(&v11, Str, (int)((char *)&hr + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 v10 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 Str = (char *)&v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 std::string40E2C8(&v9, "Direct Draw Error", (int)((char *)&a3 + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 LOBYTE(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 CheckHRESULT_stru0::ShowMessageBox(v6, &a1, v9, v10, v11, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 sprintfex(&Src, "Unknown DirectDraw/Direct3D error number %X", v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 v13 = strlen(&Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 v12 = &Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 if ( v4 > -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 if ( v4 == -2005532467 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 v7 = "DDERR_NOCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 if ( v4 == -2005532462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 v7 = "DDERR_NOCOLORCONVHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 if ( v4 == -2005532460 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 v7 = "DDERR_NOCOOPERATIVELEVELSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 if ( v4 == -2005532457 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 v7 = "DDERR_NOCOLORKEY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 if ( v4 == -2005532452 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 v7 = "DDERR_NOCOLORKEYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 if ( v4 == -2005532450 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 v7 = "DDERR_NODIRECTDRAWSUPPORT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 if ( v4 == -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 v7 = "DDERR_NOALPHAHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 if ( v4 == -2005532552 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 v7 = "DDERR_INVALIDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 if ( v4 == -2005532542 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 v7 = "DDERR_INVALIDOBJECT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 if ( v4 == -2005532527 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 v7 = "DDERR_INVALIDPIXELFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 if ( v4 != -2005532522 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 if ( v4 == -2005532512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 v7 = "DDERR_LOCKEDSURFACES";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 if ( v4 == -2005532502 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 v7 = "DDERR_NO3D";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 //----- (00467D5D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 int __thiscall sub_467D5D(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 return *(int *)(_this + 7204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 //----- (00467E7F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 Player *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 int v4; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 ItemGen _this; // [sp+Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 Player *v9; // [sp+30h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 int v10; // [sp+34h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 int *v11; // [sp+38h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 v1 = uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 v2 = (unsigned __int8)byte_4E8398[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 v3 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 v11 = (int *)((char *)&v3->pEquipment + 4 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 v4 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 v10 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 *(char *)(v5 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 pParty->SetHoldingItem((ItemGen *)(v5 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 v6 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 _this.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 memcpy((void *)(v5 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 *v11 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 v7 = v3->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 if ( (v7 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 pParty->pPickedItem.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 memcpy(&v9->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v9->pInventoryItems[v7]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 *v11 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 //----- (00467F48) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 void __fastcall sub_467F48(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 if ( !ptr_507BC4 && a1 >= 700 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 if ( a1 <= 782 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16233 ptr_507BC4 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)30, v1 - 700, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 // 720980: using guessed type int uTextureID_720980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 //----- (00467F9F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 void __cdecl free_book_subwindow()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 if ( ptr_507BC4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 ptr_507BC4->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 ptr_507BC4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 //----- (00467FB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 char __cdecl sub_467FB6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 char *v1; // ST18_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 unsigned int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 GUIWindow a1; // [sp+Ch] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 memcpy(&a1, ptr_507BC4, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 a1.str_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 a1.uFrameX = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 a1.uFrameY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 a1.uFrameWidth = 468;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 v0 = pFontSmallnum->CalcTextHeight(pScrolls[(unsigned int)ptr_507BC4->ptr_1C], &a1, 0, 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 + 2 * LOBYTE(pFontCreate->uFontHeight)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 + 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 a1.uFrameHeight = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 if ( (signed int)(v0 + a1.uFrameY) > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 v0 = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 a1.uFrameHeight = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 a1.uFrameW = v0 + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 a1._415551(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 a1.uFrameX += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 a1.uFrameWidth -= 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 a1.uFrameY += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 a1.uFrameHeight -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 v1 = pItemsTable->pItems[(unsigned int)ptr_507BC4->ptr_1C + 700].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 sprintfex(pTmpBuf, format_4E2D80, v2, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 return a1.DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 LOBYTE(pFontCreate->uFontHeight) - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 pScrolls[(unsigned int)ptr_507BC4->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 //----- (00468F8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 void __cdecl OnPaperdollLeftClick()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 unsigned int v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 unsigned int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 unsigned __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 unsigned int v6; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 unsigned int v8; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 int v9; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 int v10; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 int v11; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 int v12; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 int v13; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 char v14; // zf@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 int v15; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 int v16; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 int v17; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 unsigned int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 unsigned int v19; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 int v20; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 int v21; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 unsigned int v22; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 unsigned int v23; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 int v24; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 unsigned int v26; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 int v27; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 int v28; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 int v29; // esi@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 int v30; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 int v31; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 unsigned int v32; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 unsigned int v33; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 int v34; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 unsigned int v35; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 int v36; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 int v37; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 ItemGen *v38; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 __int16 v39; // dx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 signed int v40; // [sp-1Ch] [bp-68h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 unsigned int v41; // [sp-18h] [bp-64h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 signed int v42; // [sp-14h] [bp-60h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 signed int v43; // [sp-10h] [bp-5Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 int v44; // [sp-Ch] [bp-58h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 unsigned int v45; // [sp-8h] [bp-54h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 int v46; // [sp-4h] [bp-50h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 ItemGen _this; // [sp+Ch] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 unsigned int v48; // [sp+30h] [bp-1Ch]@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 unsigned int v49; // [sp+34h] [bp-18h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 unsigned int v50; // [sp+38h] [bp-14h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 int v51; // [sp+3Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 unsigned int v52; // [sp+40h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 int v53; // [sp+44h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 unsigned int v54; // [sp+48h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 v1 = v0->pEquipment.uMainHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 v2 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 v54 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 v53 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 if ( v1 && pItemsTable->pItems[*(int *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uEquipType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 v51 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 v4 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 if ( v4 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 if ( (signed int)SkillToMastery(v5) < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 v0->PlaySound(39, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 if ( (v4 == 8 || v4 == 1 || v4 == 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 && v1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 && pItemsTable->pItems[*(int *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uSkillType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 sub_467E7F_EquipBody(3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 WetsuitOn(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 v6 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 switch ( v52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 sub_467E7F_EquipBody(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 v52 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 v7 = (int)&v0->pEquipment.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 if ( !*(int *)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 v8 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 if ( (v8 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 v7 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 if ( (signed int)v52 > 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 v9 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 pParty->pPickedItem.uBodyAnchor = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 *(&v0->pEquipment.uOffHand + v9) = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 if ( v52 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 v52 = v0->pEquipment.field_3C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 v10 = (int)((char *)v0 + 36 * v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 *(char *)(v10 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 pParty->SetHoldingItem((ItemGen *)(v10 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 _this.uBodyAnchor = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 v11 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 memcpy((void *)(v10 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 v0->pEquipment.field_3C = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 v12 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 *(char *)(v12 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 v13 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 v14 = v51 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 memcpy((void *)(v12 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 v0->pEquipment.uOffHand = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 if ( (v52 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 v17 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 v0->pEquipment.uOffHand = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 v15 = (int)((char *)v0 + 36 * (v53 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 *(char *)(v15 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 v16 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 v0->pEquipment.uOffHand = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 v0->pEquipment.uMainHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 case 0xCu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 && pParty->pPickedItem.uItemID != 64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 && pParty->pPickedItem.uItemID != 65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16518 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 v18 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 v19 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 v18 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 v19 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 v49 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 if ( (signed int)v18 >= 560 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 v20 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 *(char *)(v20 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 v21 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 memcpy((void *)(v20 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 v0->pEquipment.uOffHand = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 v22 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 v50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 v23 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 if ( (v23 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 v50 = (unsigned int)&v0->pInventoryItems[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 v0->pEquipment.uOffHand = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 if ( v52 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 v22 = *(int *)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 if ( !v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 v26 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 if ( (v26 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 v50 = (unsigned int)&v0->pInventoryItems[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 v0->pEquipment.uMainHand = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 v24 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 *(char *)(v24 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 pParty->SetHoldingItem((ItemGen *)(v24 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 v25 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 memcpy((void *)(v24 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 v0->pEquipment.uMainHand = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 v50 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 if ( v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 stru_A750F8[uActiveCharacter - 1]._494836(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 *((int *)&pSpellDatas[66].field_8 + v50),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 uActiveCharacter - 1 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 if ( v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 v27 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 *(char *)(v27 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 pParty->SetHoldingItem((ItemGen *)(v27 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 v28 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 memcpy((void *)(v27 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 v0->pEquipment.uMainHand = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 if ( (v52 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 v29 = (int)((char *)v0 + 36 * (v54 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 *(char *)(v29 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 pParty->SetHoldingItem((ItemGen *)(v29 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 v30 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 v0->pEquipment.uMainHand = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 v31 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 v0->pEquipment.uMainHand = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 v0->UseItem_DrinkPotion_etc(uActiveCharacter, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16666 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 v32 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 v33 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 v49 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 v48 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 v32 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 v33 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 v36 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 v37 = (int)((char *)v0 + 36 * v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 v50 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 v38 = (ItemGen *)(v37 + 532);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 v14 = v38->uItemID == 604;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 v52 = pItemsTable->pItems[v38->uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 LABEL_95:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 if ( unk_50C9A0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 v39 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 *((int *)ptr_507BD4->ptr_1C + 3) = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 *((short *)ptr_507BD4->ptr_1C + 3) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 ptr_50C9A4 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 unk_50C9A0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 dword_50C9D4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 dword_50C9D0 = 113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 dword_50C9D8 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 if ( !ptr_50C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 pParty->SetHoldingItem(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 *(&v0->uBirthYear + *(char *)(v50 + 556)) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 v38->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 v35 = v0->pEquipment.uBow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 auto _a = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v35 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 pParty->SetHoldingItem(_a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 _a->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 v0->pEquipment.uBow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 //----- (0046A0A1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 int __thiscall UnprojectX(int x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 v1 = pGame->pIndoorCameraD3D->flt_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 //----- (0046A0F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 int __thiscall UnprojectY(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 v1 = pGame->pIndoorCameraD3D->flt_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 return stru_5C6E00->Atan2(_this - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 //----- (0046A14B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 char __cdecl OnPressSpace()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 SHORT v0; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 int *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 char *v2; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 unsigned int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 signed int v4; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 unsigned int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 int v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 int v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 int v8; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 int *v9; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 signed int v10; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 int i; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 int v12; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 int v13; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 int j; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 int v16; // [sp+4h] [bp-1Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 char *v17; // [sp+8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 unsigned int v18; // [sp+Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 int v19; // [sp+10h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 int *v20; // [sp+14h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 int *v21; // [sp+18h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 int v22; // [sp+1Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 v0 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 pGame->_44EB12((v0 & 0x8001) != 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 v1 = (int *)pGame->pVisInstance->get_picked_object_zbuf_val();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 if ( v1 != (int *)-1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 LOBYTE(v1) = DoInteractionWithTopmostZObject((unsigned __int16)v1, (signed int)(unsigned __int16)v1 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 v2 = (char *)v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 v1 = (int *)((char *)v1 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 v3 = 640 * viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 v20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 if ( (signed int)v2 >= (signed int)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 v4 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 v7 = *v1 & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 if ( v4 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 if ( dword_7207F0[v6] == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 v19 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 while ( v6 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 if ( (v7 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 v16 = (unsigned int)v7 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 if ( (signed int)(((unsigned int)*v21 >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 if ( (unsigned int)*v21 > 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 if ( v19 == v22 && v4 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 v8 = *v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 dword_7207EC[v4] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 dword_72065C[v4] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 v1 = v21 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 v21 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 v2 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 v3 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 if ( v22 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 v9 = dword_720660;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 for ( i = v10; i < v22; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 v12 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 v13 = dword_720660[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 if ( v13 < *v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 *v9 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 dword_720660[i] = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 LOBYTE(v1) = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 while ( v10 - 1 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 for ( j = 0; j < v22; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 if ( !(char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 // 72065C: using guessed type int dword_72065C[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 // 7207EC: using guessed type int dword_7207EC[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 //----- (0046A334) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 BLVFace *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 unsigned int v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 unsigned __int16 v6; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 ODMFace *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 LevelDecoration *v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 __int16 v9; // ax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 int v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 int v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 int v12; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 Actor *v13; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 unsigned __int16 v14; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 unsigned __int16 v15; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 const char *v16; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 int v17; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 int v18; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 ItemGen *v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 unsigned int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 int v21; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 std::string v22; // [sp-18h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 const char *v23; // [sp-8h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 int v24; // [sp-4h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 char v25; // [sp+8h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 int v26; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 int a3; // [sp+13h] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 switch ( a1 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 v17 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 v26 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 v18 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 || v17 >= 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 || !pLayingItems[v18].uObjectDescID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 v19 = &pLayingItems[v18].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 v20 = pLayingItems[v18].stru_24.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 if ( pItemsTable->pItems[v20].uEquipType == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 party_finds_gold(v19->uAdditionalValue, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 v21 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 ShowStatusBarString(pTmpBuf2, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 if ( v19->uItemID == 506 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 _449B7E_toggle_bit((char *)pParty->_award_bits, 184, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 if ( v19->uItemID == 455 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 _449B7E_toggle_bit((char *)pParty->_award_bits, 185, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 if ( !pParty->AddItem(v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 pParty->SetHoldingItem(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 v21 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 LayingItem::_42F933(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 v12 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 v13 = &pActors[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 v14 = v13->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 if ( v14 == 4 || v14 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 if ( v14 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 stru_50C198.LootActor(&pActors[a1 >> 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 if ( !v13->GetActorsRelation(0) && !(BYTE2(v13->uAttributes) & 8) && v13->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 Actor::FaceObject(v12, 4u, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 if ( v13->uNPC_ID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 v15 = pNPCStats->pGroups_copy[v13->uGroup];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 v16 = pNPCStats->pCatchPhrases[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 strcpy(byte_5B0938, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 sub_4451A8_press_any_key(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 v8 = &pLevelDecorations[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 v9 = v8->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 EventProcessor(v9, a1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 LOBYTE(v8->field_2) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 if ( !pLevelDecorations[a1 >> 3].IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 v10 = v8->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 v11 = stru_5E4C90.field_0[v10] + 380;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 _5C3420_pDecoration = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 if ( (a1 & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 MessageBoxW(nullptr, L"Warning: Invalid ID reached!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Mouse.cpp:2020", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 if ( a1 >> 9 >= pOutdoor->uNumBModels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uFaceAttributes) & 0x10)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 || (v6 = v7->sCogTriggeredID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 EventProcessor((signed __int16)v6, v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 v4 = &pIndoor->pFaces[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 v5 = v4->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 if ( !(v5 & 0x2000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 ShowNothingHereStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 //----- (0046A6AC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 int __fastcall sub_46A6AC(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 unsigned int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 int *v5; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 signed int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 unsigned __int16 v8; // ax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 int i; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 int v11; // [sp+0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 unsigned int v12; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 unsigned int v13; // [sp+8h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 int v14; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 int *v15; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 int v16; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 result = sub_46A7C8(a1, a2, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 v4 = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 v12 = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 v15 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 v13 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 if ( (signed int)v4 < (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 v5 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 v6 = ((v12 - v4 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 if ( (*(char *)v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 if ( *v5 <= a3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 v7 = (signed int)(unsigned __int16)*v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 v8 = pActors[v7].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 if ( v8 != 4 && v8 != 11 && v8 != 17 && v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 for ( i = 0; i < v16; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 if ( *(int *)(v14 + 4 * i) == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 if ( i == v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 if ( i < v11 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 v10 = v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 *(int *)(v14 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 v5 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 v15 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 --v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163 result = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17165 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 //----- (0046A7C8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 int __fastcall sub_46A7C8(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 unsigned int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 unsigned int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 unsigned int v7; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 unsigned __int16 v8; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 float v9; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 unsigned int v12; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 int v13; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 int v14; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 int v15; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 unsigned int a1a; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 v13 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 v14 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 a1a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 v12 = pRenderer->GetBillboardDrawListSize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 if ( (signed int)v12 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 v3 = pRenderer->GetParentBillboardID(a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 v4 = pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 if ( (v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 if ( v4 <= (unsigned int)(a3 << 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 v6 = v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 v8 = pActors[v6].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 if ( v8 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 if ( v8 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 if ( v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 if ( v8 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 v9 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 if ( v15 < v14 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 v10 = v15++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 *(int *)(v13 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 ++a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 while ( (signed int)a1a < (signed int)v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 return v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 //----- (0046A89E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 int __fastcall sub_46A89E(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 unsigned int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 unsigned int v10; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 unsigned int v11; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 __int16 v12; // ax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 int v13; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 int v15; // [sp+4h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 int v16; // [sp+8h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 int v17; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 int v18; // [sp+10h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 int v19; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 v16 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 v5 = abs(*((short *)v4 - 17) - pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 v17 = abs(*((short *)v4 - 16) - pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 v18 = abs(*((short *)v4 - 15) - pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 v7 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 v8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 if ( v6 < v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 v9 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 v7 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 if ( v6 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 v10 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 v6 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 v8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17284 if ( v7 < (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 v7 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 v12 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 if ( *(short *)v4 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 if ( v12 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 if ( v12 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 if ( v12 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 if ( v12 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 v13 = v19++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 *(int *)(v16 + 4 * v13) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 if ( v19 >= v15 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 while ( v3 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 //----- (0046A99B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 int __cdecl sub_46A99B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 signed int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 int *v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 int v7; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 int v8; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 int v9; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 unsigned __int8 v10; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 char v11; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 char v12; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 int *v14; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 signed int v15; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 int i; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 int v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 int v18; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 int v19; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 unsigned int v20; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 BLVFace *v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 unsigned int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 const char *v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 const char *v24; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 LevelDecoration *v25; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 LevelDecoration *v26; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 __int16 v27; // ax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 int v28; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 int v29; // [sp+14h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 int v30; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 signed int v31; // [sp+1Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 int v32; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 v1 = (signed int)(viewparams->uScreenW + viewparams->uScreenY) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 v2 = (signed int)(viewparams->uScreenX + viewparams->uScreenZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 v3 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 v30 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 v28 = v1 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 if ( v1 - 50 >= v1 + 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 v5 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 v29 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 v31 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 v8 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 if ( (unsigned int)*v6 <= 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 while ( v9 < v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 if ( v9 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 if ( v8 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 dword_720020_zvalues[v7] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 dword_7201B0_zvalues[v7] = (unsigned __int16)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 v32 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 if ( v7 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 if ( !v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 v4 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 v5 = v29 + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 v29 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 if ( v30 < v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 if ( !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 if ( !((unsigned __int8)(v11 ^ v12) | v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 v14 = dword_720020_zvalues;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 for ( i = v15; i < v32; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 v17 = dword_720020_zvalues[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 if ( v17 < *v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 dword_720020_zvalues[i] = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 *v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 while ( v15 - 1 < v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 v0 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 if ( v0 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 v19 = dword_720020_zvalues[v18] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 if ( (dword_720020_zvalues[v18] & 7) == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 if ( v20 >= 0x3E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 if ( !(pLayingItems[v20].uAttributes & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 v23 = pLayingItems[v20].stru_24.GetDisplayName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 if ( (dword_720020_zvalues[v18] & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 if ( v20 >= 0xBB8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 v24 = (const char *)&pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 if ( (dword_720020_zvalues[v18] & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 if ( (dword_720020_zvalues[v18] & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 v21 = &pIndoor->pFaces[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 if ( !(BYTE3(v21->uAttributes) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 >= pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 v22 = pOutdoor->pBModels[(dword_720020_zvalues[v18] & 0xFFFFu) >> 9].pFaces[((dword_720020_zvalues[v18] & 0xFFFFu) >> 3) & 0x3F].sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17493 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 v23 = _444732_GetEventHintString(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 if ( v18 >= v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 v25 = &pLevelDecorations[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 v27 = v25->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 v23 = _444732_GetEventHintString(v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 if ( v25->IsInteractive() )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17516 v24 = pNPCTopics[stru_5E4C90.field_0[v26->field_1C] + 379].pTopic;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 sub_41C0B8_set_status_string(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 //----- (0046AC59) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 std::string *__fastcall crt_intit_global_46AC59(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 size_t v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 //std__string_720990.field_0 = BYTE3(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 //std::string::dtor(&std__string_720990, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 //v1 = strlen("micon1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 //return std::stringoperator_assign__const_char_ptr__(&std__string_720990, "micon1", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 std__string_720990 = "micon1";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17534 return &std__string_720990;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 //----- (0046BDA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 unsigned int __cdecl GetGravityStrength()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 v0 = ~LOBYTE(pGame->uFlags2) & 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 LOBYTE(v0) = v0 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 return (unsigned int)v0 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 //----- (0046BDC0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 if ( dword_6BE364_game_settings_1 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 BLV_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 ODM_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 _438F8F_area_of_effect__damage_evaluate();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17574 //----- (0046BDF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17575 void __cdecl BLV_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 BLV_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17579 UpdateActors_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 BLV_UpdateDoors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584 //----- (0046BE0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 void __cdecl ODM_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 bool v0; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 int pOut; // [sp+8h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17590 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 ODM_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17592 if ( pParty->vPosition.x < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 || pParty->vPosition.x > 22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 || pParty->vPosition.z < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 || pParty->vPosition.z > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17597 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.z, (char *)&pOut, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 if ( pParty->vPosition.x < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 pParty->vPosition.x = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 if ( pParty->vPosition.x > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 pParty->vPosition.x = 22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 if ( pParty->vPosition.z < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 pParty->vPosition.z = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17607 if ( pParty->vPosition.z > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608 pParty->vPosition.z = 22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 UI_CreateTravelDialogue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 UpdateActors_ODM();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17623 //----- (0046BEF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17624 void LayingItem::_46BEF1_apply_spells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 LayingItem *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17627 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 __int16 v3; // fps@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17629 unsigned __int8 v4; // c0@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 unsigned __int8 v5; // c3@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 signed int v6; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17637 v2 = (char *)&pActors[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 if ( ((Actor *)(v2 - 144))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 //UNDEF(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 if ( !(v4 | v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 if ( stru_50C198.GetMagicalResistance((Actor *)(v2 - 144), 0xAu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 ((SpellBuff *)&v2[16 * v1->field_48 + 68])->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 v1->field_50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 *(v2 - 106) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 while ( v6 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 //----- (0046BFFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 LayingItem *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 ObjectDesc *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 unsigned __int16 v5; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 unsigned __int16 v6; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17672 signed int v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673 unsigned int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 unsigned int v9; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 signed int v10; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 char *v11; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 unsigned __int16 v12; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 unsigned int v14; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 unsigned __int16 v15; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 int v16; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 unsigned int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 __int16 v18; // di@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 signed int v19; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17685 unsigned __int8 v20; // sf@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 char *v21; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 unsigned __int16 v22; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 unsigned int v23; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 signed int v24; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 char *v25; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17691 int v26; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 int v27; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 int v28; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 int v29; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 unsigned __int16 v30; // ax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 unsigned int v31; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 int v32; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 unsigned int v33; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 signed int v34; // edx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 char *v35; // ecx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 unsigned __int16 v36; // ax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 int v37; // ST14_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17704 int v39; // ST10_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 int v40; // ST0C_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 int v41; // edx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 int v42; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 int v43; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 unsigned __int8 v44; // zf@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 int v45; // edx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 unsigned __int16 v46; // ax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 int v47; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 int v48; // edx@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 int v49; // edx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 int v50; // edx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 unsigned int v51; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 signed int v52; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 char *v53; // edx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 unsigned __int16 v54; // ax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 unsigned int v55; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17721 signed int v56; // ebx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 char *v57; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 unsigned __int16 v58; // ax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 unsigned __int16 v59; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 unsigned int v60; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 signed int v61; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 char *v62; // edx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17728 unsigned __int16 v63; // ax@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 int v64; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 signed int v65; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 unsigned int v66; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 unsigned __int16 v67; // ax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733 unsigned int v68; // ecx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 signed int v69; // ebx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 char *v70; // edx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 unsigned __int16 v71; // ax@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 unsigned int v72; // ebx@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 int v73; // ST14_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 int v74; // ST10_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 int v75; // ebx@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 int v76; // ST0C_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 unsigned __int16 v77; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 int v78; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744 char v79; // zf@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17745 unsigned int v80; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 signed int v81; // edx@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 char *v82; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17748 unsigned __int16 v83; // ax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 unsigned __int16 v84; // ax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 unsigned int v85; // ecx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 signed int v86; // ebx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 char *v87; // edx@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 unsigned __int16 v88; // ax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754 unsigned int v89; // eax@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 int v90; // ST34_4@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 int v91; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 unsigned int v92; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 unsigned int v93; // eax@177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 char *v94; // ecx@178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 unsigned __int16 v95; // ax@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 unsigned __int16 v96; // ax@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 int v97; // eax@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 unsigned __int16 v98; // ax@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 unsigned int v99; // ecx@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17765 char v100; // ST18_1@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 int v101; // ST14_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 int v102; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 int v103; // ST10_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 int v104; // ST0C_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 unsigned __int16 v105; // ax@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 signed int v106; // eax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17772 unsigned int v107; // edx@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 signed int v108; // ebx@225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 unsigned int v109; // eax@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 signed int v110; // ebx@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 char *v111; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 unsigned __int16 v112; // ax@238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 unsigned __int16 v113; // si@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 int v114; // eax@242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 int v115; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 signed int v116; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 unsigned __int16 v117; // ax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 unsigned int v118; // ecx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 signed int v119; // ebx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 char *v120; // edx@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 unsigned __int16 v121; // ax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 unsigned int v122; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 char *v123; // edx@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17789 int v124; // eax@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17790 int v125; // [sp-20h] [bp-4Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 signed int v126; // [sp-1Ch] [bp-48h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17792 unsigned int v127; // [sp-18h] [bp-44h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 signed int v128; // [sp-14h] [bp-40h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 signed int v129; // [sp-10h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 int v130; // [sp-Ch] [bp-38h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 unsigned int v131; // [sp-8h] [bp-34h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 char v132; // [sp-8h] [bp-34h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 int v133; // [sp-4h] [bp-30h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 char v134; // [sp-4h] [bp-30h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 signed int v135; // [sp-4h] [bp-30h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17801 int v136; // [sp+Ch] [bp-20h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 int v137; // [sp+10h] [bp-1Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 signed int v138; // [sp+14h] [bp-18h]@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 signed int v139; // [sp+18h] [bp-14h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 char *v140; // [sp+1Ch] [bp-10h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 signed int v141; // [sp+1Ch] [bp-10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 unsigned int v142; // [sp+1Ch] [bp-10h]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 signed int v143; // [sp+1Ch] [bp-10h]@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17809 char *v144; // [sp+1Ch] [bp-10h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 signed int v145; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 signed int v146; // [sp+20h] [bp-Ch]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 int v147; // [sp+20h] [bp-Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 signed int v148; // [sp+20h] [bp-Ch]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814 int v149; // [sp+20h] [bp-Ch]@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17815 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 int v151; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 signed int v152; // [sp+24h] [bp-8h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 unsigned int v153; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 v153 = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 v2 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 v3 = &pObjectList->pObjects[v2->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 v145 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 v151 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 if ( (v2->field_58 & 7) == 3 && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17832 if ( (a2 & 7) == 4 && (v2->field_58 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17833 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17837 v5 = v2->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 if ( v5 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17841 v2->uAttributes = v5 & 0xFFFB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17844 if ( v151 == 6 && (v2->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 v6 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 v7 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 if ( v7 > 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 if ( v7 > 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17852 if ( v7 > 8090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 if ( v7 == 9010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17858 if ( v7 != 9040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17860 if ( v7 != 9080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17861 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 LABEL_191:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17863 v98 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 v99 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 v2->uItemType = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 if ( (signed int)v99 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 v144 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 while ( v98 != *(short *)v144 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 v144 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17875 if ( v146 >= (signed int)v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17876 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17878 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 LABEL_195:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17881 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17884 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 LABEL_172:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 v143 = 17030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 switch ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 case 0x1798u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 v143 = 15040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17893 case 0xFAAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 v143 = 13010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17895 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 case 0x2346u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 v143 = 18030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 v138 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17901 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 if ( v6 != 9030 || v2->field_50 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 goto LABEL_246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17905 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17906 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 if ( !v138 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 v109 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17911 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17912 if ( (signed int)v109 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 LABEL_238:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17917 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17919 v111 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 while ( v2->uItemType != *(short *)v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 ++v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17923 v111 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17924 if ( v110 >= (signed int)v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 goto LABEL_238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 v112 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17929 v2->uObjectDescID = v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17930 if ( !v112 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17932 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17935 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17936 v113 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 if ( v113 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 v114 = (signed __int16)v113 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17940 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17941 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17942 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 v130 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 v115 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17946 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17947 LOBYTE(v115) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17948 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 v126 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 v116 = v143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 goto LABEL_269;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953 LABEL_246:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 v106 = v145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17958 v150 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 v139 = v106 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 v137 = v2->field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 v152 = v2->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 v136 = v2->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17963 if ( v6 == 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 v150 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966 if ( v152 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 v150 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 if ( v152 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 v150 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17975 BYTE2(pActors[v139].uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 if ( v7 == 6040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 v135 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 if ( v7 == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 v135 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17989 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17991 v107 = v136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17992 LABEL_222:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17993 if ( v6 != 9030 || v152 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17995 v108 = v139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17996 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17998 v138 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17999 if ( v2->uItemType == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 pActors[v108].uAIState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 pActors[v108].UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18004 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[v136] + v108 * 836))->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18005 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006 v152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18007 v150,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18008 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18009 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18012 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18014 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18016 v2->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18017 v2->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18018 v2->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18019 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 v135 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18024 v107 = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 goto LABEL_222;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 if ( v7 == 8090 || v7 == 7030 || v7 == 7090 || v7 == 8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18028 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18029 if ( v7 == 8010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18031 if ( v151 == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18032 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18033 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18034 v93 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18035 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18036 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18037 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18038 if ( (signed int)v93 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 v94 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 while ( v2->uItemType != *(short *)v94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 v94 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18045 if ( v52 >= (signed int)v93 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18052 v79 = v7 == 8030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18056 if ( v7 == 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18057 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18058 if ( v7 <= 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 if ( v7 != 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 v48 = v7 - 3090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18063 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 v49 = v48 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 v50 = v49 - 908;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 v45 = v50 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 goto LABEL_91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 v54 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18076 v55 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18077 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18080 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081 v2->uItemType = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 LABEL_102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 v57 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 while ( v54 != *(short *)v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 v57 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18094 if ( v56 >= (signed int)v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 v58 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18099 v2->uObjectDescID = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 if ( !v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18108 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 v15 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 if ( v15 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 v16 = (signed __int16)v15 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 v130 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 v92 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 LABEL_267:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 v124 = 8 * v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 LOBYTE(v124) = v124 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18124 v126 = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 LABEL_268:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 v116 = word_4EE088_sound_ids[v2->field_48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 LABEL_269:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 v125 = v116 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 v59 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 v60 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18133 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 v2->uItemType = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18140 LABEL_111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18141 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 v62 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 while ( v59 != *(short *)v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 v62 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18150 if ( v61 >= (signed int)v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18151 goto LABEL_111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 v63 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 v2->uObjectDescID = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 if ( !v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18158 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18159 v44 = v2->field_50 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 v65 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 v65 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 if ( v65 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18168 v141 = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18169 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18171 v64 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18172 v2->Create(v64, 0, 1000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 --v141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175 while ( v141 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177 LABEL_160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 LayingItem::_42F933(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18185 v67 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18186 v68 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18187 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18188 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18189 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 v2->uItemType = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 LABEL_128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 v70 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 while ( v67 != *(short *)v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 v70 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18203 if ( v69 >= (signed int)v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18204 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 v71 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 v2->uObjectDescID = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 v132 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 LABEL_132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 v73 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 v74 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 v75 = 8 * v72 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 v2->vVelocity.z = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 v2->vVelocity.y = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 v76 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 v2->vVelocity.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 v2->uSpriteFrameID = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 stru_50FE08.Add(v75, 512, v76, v74, v73, v132, v134);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 v77 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 if ( v77 == (short)v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 v78 = (signed __int16)v77 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 v133 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 v131 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 v130 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 v129 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 v127 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 v126 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 if ( v7 == 4090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 v84 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 v85 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 v2->uItemType = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 LABEL_155:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 v87 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 while ( v84 != *(short *)v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 v87 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 if ( v86 >= (signed int)v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 goto LABEL_155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 v88 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 v2->uObjectDescID = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 if ( !v88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 v142 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 v148 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 pRnd->SetRange(-128, 128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 v90 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 pRnd->SetRange(5, 500);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 v91 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 v2->Create(v90 + v142, 0, v91, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 --v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 while ( v148 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 goto LABEL_160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 if ( v7 == 4092 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 v80 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 v2->uItemType = 4091;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 LABEL_144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 v82 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 while ( *(short *)v82 != 4091 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 v82 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 if ( v81 >= (signed int)v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 goto LABEL_144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 v83 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 v2->uObjectDescID = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 v132 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 goto LABEL_132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 if ( v7 == 4100 || v7 == 6010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 v79 = v7 == 6040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 if ( !v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 goto LABEL_172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 if ( v7 == 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 if ( v7 <= 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 if ( v7 == 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 v23 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 if ( (signed int)v23 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 while ( v2->uItemType != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 if ( v24 >= (signed int)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 v22 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 v2->uObjectDescID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 if ( v22 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 v2->vVelocity.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 v2->vVelocity.y = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 v2->vVelocity.x = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 v2->uSpriteFrameID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 switch ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 case 500:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 case 505:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 case 510:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 case 515:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 case 520:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 case 525:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 case 530:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 case 535:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 case 540:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 v8 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 if ( (signed int)v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 v11 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 case 545:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 case 550:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 if ( v2->stru_24.uItemID != 405 && v2->stru_24.uAdditionalValue != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 v17 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 v2->uItemType = 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 v21 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 while ( *(short *)v21 != 600 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 v21 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 if ( v19 >= (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 v22 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 while ( v2->uItemType != *(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423 v11 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 if ( v10 >= (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 v2->uObjectDescID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 v44 = v2->uItemType == 555;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 if ( !v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 if ( v7 > 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 v41 = v7 - 2030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 v42 = v41 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 if ( v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 v43 = v42 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 v45 = v43 - 910;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 LABEL_91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 if ( !v44 && v45 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 v51 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 if ( (signed int)v51 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 v53 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 while ( v2->uItemType != *(short *)v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 v53 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 if ( v52 >= (signed int)v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 v2->uObjectDescID = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 if ( v95 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 v96 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 v2->vVelocity.z = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489 v2->vVelocity.y = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 v2->vVelocity.x = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 v2->uSpriteFrameID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 if ( v96 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 v97 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 v97 = (signed __int16)v96 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 v130 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 v92 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500 goto LABEL_267;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 if ( v7 == 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 v26 = v7 - 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 v33 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 v2->uItemType = 601;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 v35 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 while ( *(short *)v35 != 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 v35 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 if ( v34 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 v36 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 v2->uObjectDescID = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 if ( !v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 v37 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 v38 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 v39 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 LOBYTE(v38) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 v40 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 v147 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 stru_50FE08.Add(v38, 512, v40, v39, v37, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, 0, v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 v126 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 v27 = v26 - 410;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 v28 = v27 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 goto LABEL_191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 v29 = v28 - 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 if ( v29 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 v30 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 v31 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 v2->uItemType = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 if ( (signed int)v31 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 v140 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 while ( v30 != *(short *)v140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 v140 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 if ( v146 >= (signed int)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 v46 = v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 v2->uObjectDescID = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 if ( v46 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 v100 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 v101 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 v2->uSpriteFrameID = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 v102 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 v103 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 LOBYTE(v102) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 v2->vVelocity.x = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 v2->vVelocity.y = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 v104 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 v2->vVelocity.z = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 v149 = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 array_5118E8._440E91(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 v2->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 v2->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 v2->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 v105 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 if ( v105 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 v47 = (signed __int16)v105 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 v133 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 v131 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 v130 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 v129 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 v127 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 v126 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 if ( v151 == 6 || v151 == 5 || (v9 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 if ( v151 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 v122 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 if ( (signed int)v122 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 v123 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 while ( v2->uItemType != *(short *)v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 v123 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 if ( v52 >= (signed int)v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 LABEL_202:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 v95 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 v117 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 v118 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 v2->uItemType = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 v120 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 while ( v117 != *(short *)v120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 v120 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 if ( v119 >= (signed int)v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 v121 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 v2->uObjectDescID = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 if ( !v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 v130 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 v13 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 LOBYTE(v13) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 v125 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697