annotate mm7_2.cpp @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children ac0fb48cd27a
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 strcpy(pTmpBuf, pStr_72217C);
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 strcpy(pTmpBuf, *(const char **)&dword_721E24[8 * (unsigned int)ptr_507BC0->ptr_1C]);
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) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 int __cdecl sub_4BBA85_bounties()
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 int result; // eax@19
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();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 pDialogueWindow = GUIWindow::Create(0, 0, 640u, 350u, WINDOW_Credits, 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"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 result = dword_722164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 result = dword_722174;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 result = dword_72216C;
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 // 722164: using guessed type int dword_722164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 // 72216C: using guessed type int dword_72216C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 // 722174: using guessed type int dword_722174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 // F8B1A0: using guessed type __int16 word_F8B1A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 //----- (004BBCDD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 void __cdecl sub_4BBCDD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 signed int v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 __int16 v2; // cx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 int v3; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 Player *v4; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 GUIButton *v5; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 GUIButton *v6; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 size_t v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 if ( pParty->field_7B5_in_arena_quest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 if ( pParty->field_7B5_in_arena_quest == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 uDialogueType = 92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 v1 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 v2 = *(short *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 if ( *(short *)v1 == 5 || v2 == 11 || v2 == 19 || (v3 = *((int *)v1 + 159)) != 0 && (v3 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 v1 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 if ( v0 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 uDialogueType = 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 v4 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 while ( (signed int)v4 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 party_finds_gold(dword_F8B1B4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 pParty->field_7B5_in_arena_quest = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 uDialogueType = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 pParty->vPosition.x = 3849;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 pParty->vPosition.z = 5770;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 pParty->vPosition.y = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 uDialogueType = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 v5 = pDialogueWindow->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 v6 = v5->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 pAllocator->FreeChunk(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 pDialogueWindow->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 pDialogueWindow->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 pDialogueWindow->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 pGlobalTXT_LocalizationStrings[79],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x55u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x56u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x57u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x58u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 pDialogueWindow->_41D08F(4, 1, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 // F8B1B4: using guessed type int dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 //----- (004BBF61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 size_t v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 int monster_id; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 __int16 v6; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 Actor *v7; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 MonsterInfo *v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 MonsterDesc *v10; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 unsigned __int16 *v11; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 int v12; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 int v13; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 __int16 x_; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 __int16 v15; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 __int16 v16; // [sp+10h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 signed int ya; // [sp+1Ch] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 monster_id = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 v15 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 if ( (signed int)uNumActors < 500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 && ((signed int)pAllocator->uBigBufferSizeAligned >> 10) - ((signed int)pAllocator->uNextFreeOffsetInBigBuffer >> 10) >= 2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 v6 = pIndoor->GetSector(x, y, z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v16 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 v7 = &pActors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v7->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 v8 = monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v9 = &pMonsterStats->pInfos[monster_id];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v10 = &pMonsterList->pMonsters[v8 - 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 strcpy(v7->pActorName, v9->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 v7->sCurrentHP = LOWORD(v9->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 memcpy(&v7->pMonsterInfo, v9, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v7->word_000086_some_monster_id = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 v7->uActorRadius = v10->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v7->uActorHeight = v10->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v7->uMovementSpeed = v10->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v7->vInitialPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v7->vPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 BYTE2(v7->uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v7->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v7->pMonsterInfo.uTreasureLevel = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 v7->pMonsterInfo.uTreasureDiceSides = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v7->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v7->pMonsterInfo.uTreasureDropChance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v7->vInitialPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v7->vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v7->vInitialPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v7->vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v7->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 v7->uSectorID = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v7->uGroup = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v7->pMonsterInfo.uHostilityType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 v7->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 v11 = v10->pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 ya = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 pSoundList->_4A9A67((signed __int16)*v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 --ya;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 while ( ya );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 //----- (004BC109) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 void __cdecl ArenaFight()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 char *v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 Player *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 int v3; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 signed int v4; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 signed __int64 v5; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 signed int v6; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 char *v7; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 int v8; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 int v9; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 int v10; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 unsigned __int8 v11; // sf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 unsigned __int8 v12; // of@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 signed int v13; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 int v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 int v15; // edx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 int v16; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 signed int v17; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 int v18; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 int i; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 int monster_y; // ST18_4@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 int v21; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 signed int v22; // [sp-4h] [bp-144h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 __int16 v23[100]; // [sp+Ch] [bp-134h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 GUIWindow window; // [sp+D4h] [bp-6Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 int v26; // [sp+134h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 int v27; // [sp+138h] [bp-8h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 int num_monsters; // [sp+13Ch] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 pParty->field_7B5_in_arena_quest = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 memcpy(&window, pDialogueWindow, sizeof(window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 window.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 window.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 pRenderer->SetGameRenderStates();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 pRenderer->FillRect2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 pViewport->uViewportZ - pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 pViewport->uViewportW - pViewport->uViewportY + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 LOWORD(pRenderer->uTargetGMask) | LOWORD(pRenderer->uTargetBMask));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 352 - v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 (pTex ? pTex->uTextureHeight : 26) - v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 pParty->vPosition.x = 3849;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 pParty->vPosition.z = 5770;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 pParty->vPosition.y = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 v2 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v3 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 if ( v3 > v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 v26 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 while ( (signed int)v2 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 num_monsters = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 v5 = (signed __int64)((double)v26 * 1.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 LODWORD(v5) = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 num_monsters = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 v4 /= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 num_monsters = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 if ( v4 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 if ( v4 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 if ( num_monsters > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 num_monsters = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 if ( v4 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 if ( num_monsters < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 num_monsters = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 v7 = (char *)&pMonsterStats->pInfos[1].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 if ( v7[8] != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 if ( !MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 v8 = (unsigned __int8)*v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 if ( v8 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 if ( v8 <= num_monsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 v23[v6++] = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 v7 += 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 num_monsters = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 if ( v6 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 num_monsters = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 if ( num_monsters > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 v12 = __OFSUB__(v9, num_monsters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 v11 = v9 - num_monsters < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 *((short *)&window.pControlsTail + v9 + 1) = v23[v10 % v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 while ( v11 ^ v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 v17 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 v22 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 v17 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 v22 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 v18 = v16 % v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 v14 = v18 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 v15 = rand() % 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 v13 = 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 v14 = v15 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v13 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 v14 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 v13 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 for ( dword_F8B1B4 = v26 * v13; i < v14; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 monster_y = pMonsterArenaPlacements[i].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 v21 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 _4BBF61_summon_actor((unsigned __int16)monster_ids[v21 % num_monsters], pMonsterArenaPlacements[i].x, monster_y, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 //----- (004BC8D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 Texture *__cdecl sub_4BC8D5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 GUIWindow *v5; // ebp@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 Texture *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 int v7; // [sp+10h] [bp-4h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 v0 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 v1 = (char *)ptr_507BC0->ptr_1C - 139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 if ( v3 < 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 if ( v3 <= 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 v0 = rand() % word_4F0F30[(signed int)v1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 + 345;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 if ( v3 == 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 v4 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 if ( v3 == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 v4 = rand() % 3 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 if ( v3 != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 v4 = rand() % 2 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 if ( v0 == 487 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 v0 = 486;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 v5 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 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
3686 _u->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 *(&dword_F8B164 + v2) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 while ( v2 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 //----- (004BCA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 GUIButton *__cdecl sub_4BCA33()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x159u, WINDOW_Credits, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 pGlobalTXT_LocalizationStrings[74],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 return pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 //----- (004BCACC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 void __fastcall sub_4BCACC_bounties(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 signed int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 Player *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 signed int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 GUIWindow *v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 unsigned int v9; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 int v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 int v11; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 int v12; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 __int16 v13; // bp@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 int v14; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 GUIWindow *v15; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 int v16; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 int v17; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 __int16 v20; // ax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 __int16 v21; // ax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 __int16 v22; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 __int16 v23; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 __int16 v24; // ax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 int v25; // esi@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 __int16 v26; // ax@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 char v27; // zf@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 Player *v28; // edi@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 int v29; // eax@204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 void *v30; // esi@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 unsigned __int64 v31; // qax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 signed int v32; // edi@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 int v33; // eax@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 unsigned int v34; // eax@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 Player *v35; // edi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 signed int v36; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 int v37; // ecx@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 int v38; // esi@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 int v39; // edx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 void *v40; // edi@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 unsigned __int64 v41; // qax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 void *v42; // eax@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 signed int v43; // edi@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 int v44; // edx@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 int v45; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 unsigned int v46; // eax@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 void *v47; // eax@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 signed int v48; // edi@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 int v49; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 int v50; // eax@256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 unsigned int v51; // eax@257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 void *v52; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 signed int v53; // edi@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 int v54; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 signed int v55; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 int v56; // [sp+14h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 v55 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 if ( !pDialogueWindow->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 if ( v2 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v6 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 v7 = v6->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 v4 += v5++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 while ( v5 < v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 && (signed __int64)v6->uExperience < 1000 * v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 && (v1 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 + pParty->uDaysPlayed % 7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 || dword_F8B198 != 23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 || v55 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x159u, WINDOW_Credits, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 526u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 75u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 33u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, nullstring, (Texture *)v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 if ( uActiveCharacter != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 dword_F8B19C = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 if ( v3 < 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 v9 = pIcons_LOD->LoadTexture((&off_4F03B8)[4 * v3], TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 dword_F8B164 = &pIcons_LOD->pTextures[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 if ( v3 > 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 if ( v3 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 if ( v3 != 23 && v3 != 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 if ( v3 != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 if ( v3 <= (signed int)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 if ( v3 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 if ( v3 <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 if ( v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 v34 = pIcons_LOD->LoadTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 pItemsTable->pItems[v33].pIconName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 while ( v32 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 sub_4BC8D5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 v31 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 + (signed __int64)((double)(0xA8C000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 if ( v3 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 if ( v55 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 v10 = (int)((char *)v8->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 v56 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 v11 = 8 * v10 + 11325428;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 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
3916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 pParty->field_75A[v12] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 *(_QWORD *)v11 = (signed __int64)((double)(309657600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v14 = rand() % 258;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 v15 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 pParty->field_750[v12] = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 v16 = (int)((char *)v15->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 v18 = v17 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 v20 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 v21 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 v22 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 v23 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 v24 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 v10 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 v25 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 v26 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 v27 = pParty->field_75A[v25] == v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 word_F8B1A0 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 v27 = v26 == v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 v29 = dword_722164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 v29 = dword_722174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 dword_F8B1A4 = (char *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 if ( v26 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 v28 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 v28->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 while ( (signed int)v28 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 pParty->field_750[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 pParty->field_75A[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 dword_F8B1A4 = (char *)dword_72216C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 }
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 if ( v55 == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 if ( v55 > 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 switch ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 case 96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 pDialogueWindow->uWindowType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 sub_4B3703((void *)dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 pDialogueWindow->uWindowType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 dword_F8B19C = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 dword_F8B19C = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 dword_F8B19C = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 if ( v55 != 95 && v55 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 if ( v55 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 dword_F8B19C = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 if ( v55 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 dword_F8B19C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 if ( v55 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 if ( v55 > 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 if ( v55 <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 v35 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 if ( v37 < v36 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 v37 = v36 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 v38 = (int)(&v35->uIntelligence + v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 if ( !*(short *)v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 if ( pParty->uNumGold < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 if ( dword_F8B198 == 30 || dword_F8B198 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 v39 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 v39 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 Party::TakeGold(v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 *(short *)v38 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 v35->PlaySound(78, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 if ( v55 == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 pDialogueWindow->uWindowType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 dword_F8B19C = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 sub_421B2C_PlaceInInventory_or_DropPickedItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 GenerateShopItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 sub_4B8F94();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 v40 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 v41 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 pParty->field_3C.field_50[2 * (int)v40] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 if ( v55 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 //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
4258 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 v49 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 //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
4279 while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 //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
4301 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 v54 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 //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
4322 while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 //----- (004BD8B5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 signed int __cdecl sub_4BD8B5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 int v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 int v1; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 unsigned int v2; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 const char *v3; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 pKeyActionMap->_459ED1(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 if ( array_5913D8[6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 if ( dword_F8B19C != 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 && dword_F8B19C != 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 && dword_F8B19C != 97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 && dword_F8B19C != 5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 && dword_F8B19C != 4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 && dword_F8B164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 dword_F8B164->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 dword_F8B164 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 if ( v0 && v0 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 if ( v0 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 _4B4224_UpdateNPCTopics((int)((char *)array_5913D8[6] - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 if ( v0 != 94 && v0 != 96 && v0 != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 if ( v0 == 3 || v0 == 5 || v0 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 dword_F8B19C = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 if ( v0 != 102 && v0 != 103 && v0 != 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 sub_4B3B42(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 dword_F8B19C = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 if ( uNumDialogueNPCPortraits != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 ptr_5076F4 = ptr_507BC0->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 if ( uNumDialogueNPCPortraits > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 v3 = byte_591180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 *(&_4E5E50_transui_x + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 0x3Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 0x49u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 0x19Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 v2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 v3 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 while ( (signed int)v2 < uNumDialogueNPCPortraits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 //----- (004BDB56) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 void __cdecl sub_4BDB56_buy_skill____()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 Player *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 signed int v1; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 unsigned int v2; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 int v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 float v4; // ST1C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 signed int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 signed int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 char v7; // zf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 const char *v9; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 signed int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 unsigned int v11; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 int v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 void *v13; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 signed int v14; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 unsigned int v15; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 GUIWindow *v16; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 POINT *v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 int v18; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 void *v19; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 ItemGen *v20; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 float v21; // ST1C_4@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 signed int v22; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 int v23; // ebx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 int v24; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 int v26; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 Player *v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 POINT *v28; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 int v29; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 void *v30; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 int v31; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 ItemGen *v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 float v33; // ST1C_4@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 signed int v34; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 int v35; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 bool v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 unsigned int v37; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 int v38; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 int v39; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 int v40; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 int v41; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 int v42; // esi@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 signed int v43; // ebx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 int v44; // ecx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 unsigned __int16 *pSkill; // esi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 signed int v46; // [sp-18h] [bp-CCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 unsigned int v47; // [sp-14h] [bp-C8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 signed int v48; // [sp-10h] [bp-C4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 signed int v49; // [sp-Ch] [bp-C0h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 int v50; // [sp-8h] [bp-BCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 int v51; // [sp-4h] [bp-B8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 unsigned int v52; // [sp-4h] [bp-B8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 int v53; // [sp+0h] [bp-B4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 unsigned int v54; // [sp+0h] [bp-B4h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 int v55; // [sp+0h] [bp-B4h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 int v56; // [sp+0h] [bp-B4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 POINT v57; // [sp+10h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 POINT v58; // [sp+18h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 POINT v59; // [sp+20h] [bp-94h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 POINT v60; // [sp+28h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 POINT v61; // [sp+30h] [bp-84h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 POINT v62; // [sp+38h] [bp-7Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 POINT v63; // [sp+40h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 POINT v64; // [sp+48h] [bp-6Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 POINT v65; // [sp+50h] [bp-64h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 POINT v66; // [sp+58h] [bp-5Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 POINT v67; // [sp+60h] [bp-54h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 POINT a2; // [sp+68h] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 POINT v69; // [sp+70h] [bp-44h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 POINT v70; // [sp+78h] [bp-3Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 POINT v71; // [sp+80h] [bp-34h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 POINT v72; // [sp+88h] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 bool v73; // [sp+90h] [bp-24h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 int v74; // [sp+94h] [bp-20h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 int a6; // [sp+98h] [bp-1Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 int a3; // [sp+9Ch] [bp-18h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 Player *v77; // [sp+A0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 unsigned int v79; // [sp+A8h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 int v80; // [sp+ACh] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 ItemGen *_this; // [sp+B0h] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 v77 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 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
4528 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 if ( dword_F8B19C > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 if ( dword_F8B19C < 36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 if ( dword_F8B19C <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 v42 = dword_F8B19C - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 v44 = v43 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 if ( v44 < v43 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 v44 = v43 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v42] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 pSkill = &v0->pActiveSkills[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 if ( !*pSkill )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 if ( pParty->uNumGold < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 v13 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 v55 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 Party::TakeGold(v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 *pSkill = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 v51 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 if ( dword_F8B19C != 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 sub_421EA6_OnInventoryLeftClick();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 if ( dword_F8B19C == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 v17 = pMouse->GetCursorPos(&v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 v19 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 //v21 = p2DEvents_minus1__20[13 * (signed int)v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 _this = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 v22 = v20->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v23 = v0->_4B8142(v22, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 v80 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 if ( pParty->uNumGold < v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 v9 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 v20->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 memcpy(&v0->pDarkSpellbook.bIsSpellAvailable[36 * v25 + 5], v20, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 v54 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 v9 = pGlobalTXT_LocalizationStrings[563]; // "Pack is Full!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 v28 = pMouse->GetCursorPos(&v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 if ( !v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 v31 = 9 * (v29 - 1 + 12 * (int)v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 v32 = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 _this = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 _this = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 v32 = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 v34 = v32->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 v80 = v0->_4B8142(v34, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 LOWORD(v35) = GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 v74 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 v36 = v0->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 uNumSeconds = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v73 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 v37 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 a3 = pMapStats->pInfos[v37]._steal_perm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 v38 = GetPartyReputation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 if ( v73 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 if ( !uNumSeconds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 if ( pParty->uNumGold < v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 if ( uNumSeconds != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 if ( uNumSeconds != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 v39 = v0->AddItem(0xFFFFFFFFu, v32->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 v32->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 v7 = v73 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 v40 = (int)((char *)v0 + 36 * v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 memcpy((void *)(v40 + 496), v32, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 v41 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 if ( uNumSeconds == 1 || uNumSeconds == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 *(char *)(v40 + 517) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 dword_F8B1E4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 viewparams->bRedrawGameUI = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 _this->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 v27 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 v51 = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 v27->PlaySound(v51, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 v14 = pMouse->GetCursorPos(&v71)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 if ( pMouse->GetCursorPos(&v67)->x <= 13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 || pMouse->GetCursorPos(&v65)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 v16 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 if ( sub_4BDAAF((ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5], (int)ptr_507BC0->ptr_1C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 v51 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 v0->PlaySound(79, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 pAudioPlayer->PlaySound(SOUND_27, v46, v47, v48, v49, v50, v52, v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 v10 = pMouse->GetCursorPos(&v62)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 v79 = (v10 >> 5) + 14 * ((pMouse->GetCursorPos(&v66)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 if ( pMouse->GetCursorPos(&v58)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 if ( pMouse->GetCursorPos(&v64)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 v12 = (int)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v11 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 if ( !(*(char *)(v12 + 20) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 *(int *)(v12 + 20) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 v0->PlaySound(73, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 v9 = pGlobalTXT_LocalizationStrings[569];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 v51 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 v79 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v70)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 if ( pMouse->GetCursorPos(&v60)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 if ( pMouse->GetCursorPos(&v72)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 v3 = (int)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 auto _v = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 v5 = _v->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 v6 = v0->_4B81C3(v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 v7 = (*(char *)(v3 + 20) & 2) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 v80 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 v8 = *(int *)(v3 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 LOBYTE(v8) = v8 & 0xFD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 *(int *)(v3 + 20) = v8 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 v0->PlaySound(74, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 v9 = pGlobalTXT_LocalizationStrings[570];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 ShowStatusBarString(v9, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 HousePlaySomeSound((unsigned int)v13, v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 v51 = 79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 v27 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 goto LABEL_30;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 //----- (004BE386) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 void __fastcall log_error(const char *pMessage)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 FILE *f; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 FILE *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 v1 = pMessage;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 f = fopen("errorlog.txt", "a");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 v3 = f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 if ( f )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 fprintf(f, "%s\n", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 fflush(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 //----- (004BE3BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 FrameTableTxtLine *texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 signed int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 unsigned int v4; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 FrameTableTxtLine *result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 signed int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 static struct FrameTableTxtLine static_stru_F8BA58; // weak
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 static_stru_F8BA58.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 if ( _this && *_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 v2 = (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 v4 = _this - (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 v5 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 if ( v5 != 32 && v5 != 44 && v5 != 9 || v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 if ( v5 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 if ( v2[v4 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 if ( static_stru_F8BA58.field_0 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 while ( (unsigned int)v2 < (unsigned int)&unk_F8BA50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 memcpy(a2, &static_stru_F8BA58, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 // F8BA58: using guessed type FrameTableTxtLine static_stru_F8BA58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 //----- (004BE485) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 FrameTableTxtLine *result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 unsigned int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 stru_F8B5E8.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 if ( pString && *pString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 v2 = (char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 v7 = pString - (const char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 v5 = v2[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 if ( v5 == ',' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 if ( v5 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 if ( v5 == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 if ( v2[v7 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 if ( stru_F8B5E8.field_0 < 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 if ( (unsigned int)v2 < (unsigned int)&unk_F8B5E0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 memcpy(a2, &stru_F8B5E8, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 // F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 //----- (004BE571) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 int i; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 result = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 if ( a3 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 for ( i = 0; i < a3; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 if ( a1 == a2[i] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 if ( i == a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 a2[a3] = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 result = a3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 //----- (004BF91E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 unsigned int __thiscall GameOverMenu(void *ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 unsigned int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 char *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 char *v4; // ST24_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 int v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 char *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 char *v7; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 char *v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 char *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 unsigned int v10; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 MSG Msg; // [sp+88h] [bp-48h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 void *v15; // [sp+A8h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 char *pInString; // [sp+ACh] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 unsigned int v17; // [sp+B0h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 unsigned int v19; // [sp+B8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 int v20; // [sp+BCh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 int i; // [sp+C0h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 v15 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 //RGBTexture::RGBTexture(&this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 BYTE1(dword_6BE364_game_settings_1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 pRenderer->ClearBlack();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 _449B57_test_bit(pParty->_award_bits, 99);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 _this.Load("winbg.pcx", 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 pRenderer->DrawTextureRGB(0, 0, &_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 free(_this.pPixels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 _this.pPixels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 ptr_507BC0 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Credits, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 pWindow.uFrameX = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 pWindow.uFrameY = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 pWindow.uFrameWidth = 469;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 pWindow.uFrameHeight = 338;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 pWindow.uFrameZ = 543;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 pWindow.uFrameW = 397;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 pFont = LoadFont("endgame.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 99) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 v1 = pGlobalTXT_LocalizationStrings[675];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 result = _449B57_test_bit(pParty->_award_bits, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 if ( !(short)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 v1 = pGlobalTXT_LocalizationStrings[676];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 pInString = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 v23 = pParty->uTimePlayed - 138240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 v17 = v19 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 pWindow.DrawText2(pFont, 1u, 0x23u, 1u, pGlobalTXT_LocalizationStrings[9], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 v3 = pParty->pPlayers[0].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 v23 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 v4 = pClassNames[(unsigned __int8)v3[17]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 v5 = ((Player *)(v3 - 168))->GetBaseLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 pWindow.DrawText2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 pFont,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 v23 += __PAIR__(*(int *)(i - 4), *(int *)(i - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 i += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 if ( i >= (signed int)&pParty->pPickedItem.uNumCharges )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 v23 = (signed __int64)v23 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 pWindow.DrawText2(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 v7 = pGlobalTXT_LocalizationStrings[56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 if ( v17 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 v7 = pGlobalTXT_LocalizationStrings[57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 v8 = pGlobalTXT_LocalizationStrings[146];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 if ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 v8 = pGlobalTXT_LocalizationStrings[148];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 v9 = pGlobalTXT_LocalizationStrings[245];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 if ( v14 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 v9 = pGlobalTXT_LocalizationStrings[132];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 sprintfex(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 pRenderer->pBeforePresentFunction();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 pRenderer->_49F1BC("MM7_Win.Pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 pAllocator->FreeChunk(pFont);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 if ( v15 == (void *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 LODWORD(v23) = GetTickCount() + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 while ( (unsigned int)v23 > GetTickCount() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 v10 = PeekMessageA(&Msg, 0, 0, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 pMessageQueue_50CBD0->uNumMessages = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 pKeyActionMap->uLastKeyPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 while ( !pKeyActionMap->uLastKeyPressed );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 // F8BC10: using guessed type int bGameoverLoop;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 //----- (004C0262) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 void Viewport::SetScreen(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 unsigned int x; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 unsigned int z; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 unsigned int w; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 char no_3d; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 if ( (signed int)uX > (signed int)uZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 z = uZ ^ uX ^ uZ; // swap x and z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 x = z ^ uZ ^ uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 if ( (signed int)uY > (signed int)uW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 w = uW ^ uY ^ uW; // swap y and w
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 y = w ^ uW ^ uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 this->uScreenX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 this->uScreenY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 this->uScreenZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 this->uScreenW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 no_3d = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 this->uScreenWidth = z - x + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 this->uScreenCenterX = (signed int)(z + x) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 if ( no_3d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 v10 = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 this->uScreenHeight = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 this->uScreenCenterY = this->uScreenW - ((unsigned __int64)(this->field_30 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 this->uScreenHeight = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 this->uScreenCenterY = (signed int)(w + y) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 SetViewport(this->uScreenX, this->uScreenY, this->uScreenZ, this->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 //----- (004C02F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 void Viewport::_4C02F8(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 unsigned int v2; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 v2 = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 this->field_30 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 SetScreen(this->uScreenX, this->uScreenY, this->uScreenZ, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 //----- (004C0312) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 void Viewport::SetViewport(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 unsigned int x; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 unsigned int z; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 unsigned int w; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 if ( (signed int)uX < (signed int)this->uScreenX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 x = this->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 if ( (signed int)uY < (signed int)this->uScreenY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 y = this->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 if ( (signed int)uZ > (signed int)this->uScreenZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 z = this->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 if ( (signed int)uW > (signed int)this->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 w = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 this->uViewportY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 this->uViewportX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 this->uViewportZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 this->uViewportW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 //----- (004D6FB0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 __int16 v8; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 int v9; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 unsigned __int8 v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 v11 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 v10 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 if ( v10 ^ v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 v7 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 v8 = *(short *)(*(int *)(v1 + 52) + 2 * v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 *(short *)result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 //----- (004D705A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 int /*__usercall*/ sr_sub_4D705A/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 unsigned int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 unsigned int v8; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 __int16 v9; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 unsigned int v10; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 unsigned int v11; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 unsigned __int8 v12; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 unsigned __int8 v13; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 v10 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 v11 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 v11 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 v10 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 if ( (signed int)v11 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 v11 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 if ( (signed int)v10 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 v10 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 + (*(int *)(v1 + 12) & (v11 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 + ((*(int *)(v1 + 8) & v10) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 v13 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 v12 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 if ( v12 ^ v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 v8 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 v8 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v7 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 if ( (signed int)v8 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 v8 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 if ( (signed int)v7 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 v7 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v9 = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 + (*(int *)(v1 + 12) & (v8 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 + ((*(int *)(v1 + 8) & v7) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 //----- (004D714C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 int __cdecl sr_sub_4D714C(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 unsigned __int16 v9; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 unsigned int *v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 int v11; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 int v12; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 unsigned __int8 v13; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 unsigned __int8 v14; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 v12 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 *(short *)(result + 2) = v2->field_34_palette[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 v14 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 v13 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 v8 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 v9 = v2->field_34_palette[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 v10 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 v11 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 *v10 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 *(v10 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 // 4D714C: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 //----- (004D71F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 int __cdecl sr_sub_4D71F8(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 unsigned int v9; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 unsigned __int16 v10; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 unsigned int *v11; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 int v12; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 int v13; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 unsigned int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 unsigned __int8 v15; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 unsigned __int8 v16; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 v13 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 v14 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 v14 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v13 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 if ( (signed int)v14 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 v14 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 if ( v13 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 v13 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 *(short *)(result + 2) = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 + (v2->field_C & (v14 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 + ((v2->field_8 & (unsigned int)v13) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 v16 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 v15 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 if ( v15 ^ v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 v8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 v9 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 v8 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 if ( (signed int)v9 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 v9 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 if ( v8 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 v8 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 v10 = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 + (v2->field_C & (v9 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 + ((v2->field_8 & (unsigned int)v8) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 v11 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v12 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 *(short *)result = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 *(v11 - 1) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 // 4D71F8: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 //----- (004D72EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 int /*__usercall*/ sr_sub_4D72EC/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 unsigned int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 unsigned int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 unsigned int v10; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 unsigned int v11; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 int v12; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 unsigned __int8 v13; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 unsigned __int8 v14; // of@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 v10 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 v11 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 v10 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 v11 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 if ( (signed int)v10 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 v10 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 if ( (signed int)v11 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 v11 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 v12 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 + (*(int *)(v1 + 12) & (v10 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 + ((*(int *)(v1 + 8) & v11) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v14 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 v13 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 v7 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v8 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 v7 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 v8 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 if ( (signed int)v7 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v7 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 if ( (signed int)v8 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 v8 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 + (*(int *)(v1 + 12) & (v7 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 + ((*(int *)(v1 + 8) & v8) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 *(short *)result = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 //----- (004D73DF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 int /*__usercall*/ sr_sub_4D73DF/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 unsigned __int8 v9; // sf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 unsigned __int8 v10; // of@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 v8 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 if ( *(char *)(*(int *)(v1 + 56) + v8 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 v10 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 v9 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 if ( v9 ^ v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 v7 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 if ( *(char *)(*(int *)(v1 + 56) + v7 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 *(short *)result = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 + v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 //----- (004D754B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 void __cdecl sr_sub_4D754B(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 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
5825 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 a1->pColorBuffer = v11 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 a1->pDepthBuffer = v12 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 //----- (004D7630) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 void __cdecl sr_sub_4D7630(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 unsigned __int16 *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 unsigned __int16 v7; // bx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 unsigned __int16 *v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 unsigned int *v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 int v11; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 int v12; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 int v13; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 int v14; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 v14 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 v3 = *((char *)a1->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 v4 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 v5 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 if ( v5 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 v5 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 if ( a2->field_8 - v5 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 v6 = a2->field_8 - v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 v3 += v6 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 v4 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 v7 = v4[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 v8 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v9 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 *v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 *v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 a1->pColorBuffer = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 a1->pDepthBuffer = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 v11 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 v12 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 v13 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 a1->field_30 = a1->field_4 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 a1->field_2C = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 v2 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 while ( v14 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 //----- (004D76ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916 void __cdecl sr_sub_4D76ED(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 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
5951 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 v7 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 a1->pColorBuffer = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 a1->pDepthBuffer = v12 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 //----- (004D77D2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984 void __cdecl sr_sub_4D77D2(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 unsigned __int16 *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 unsigned __int16 *v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 int v6; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 unsigned __int16 v8; // bx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994 unsigned int *v10; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 unsigned int *v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5997 int v13; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 int v14; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 int v15; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 v3 = a1->pTextureLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 v4 = *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 v5 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 if ( *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 v6 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 if ( v6 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 v6 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 if ( a2->field_8 - v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 v7 = a2->field_8 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 v4 += v7 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 v5 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 v8 = v5[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 v9 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 *a1->pColorBuffer = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 *v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 v11 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 a1->pDepthBuffer = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 v12 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 v13 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 v14 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 a1->field_30 = a1->field_4 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 a1->field_2C = v14 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 v2 = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 while ( v15 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 //----- (004D789A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 void __cdecl sr_sub_4D789A(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 int v7; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 int v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 unsigned __int16 v9; // bx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 int v10; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 unsigned int *v11; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 unsigned int *v12; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 int v13; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 int v15; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 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
6084 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 v11 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 *a1->pColorBuffer = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 *v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 v12 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 a1->pDepthBuffer = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 //----- (00451007) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 int stru350::sub_451007_scale_image_bicubic(int a2, signed int a3, signed int a4, int a5, signed int a6, signed int a7, signed int a8, int a9, int a10, int a11)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 signed int v11; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 signed int v13; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 signed int v14; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 double v15; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 double v16; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 float v17; // ST3C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 float v18; // ST38_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 unsigned int v19; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 int v21; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 unsigned int v22; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 unsigned int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 signed int v24; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 signed int v25; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 signed int v26; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 double v27; // st7@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 double v28; // st6@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 float v29; // ST34_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 float v30; // ST30_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 unsigned int v31; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 int v32; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 int v33; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 unsigned int v34; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 __int16 v35; // ax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 signed int v36; // ecx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 signed int v37; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 signed int v38; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 double v39; // st7@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 double v40; // st6@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 float v41; // ST34_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 float v42; // ST30_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 unsigned int v43; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 int v44; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 int v45; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 unsigned int v46; // ecx@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 char v47; // al@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 signed int v48; // ecx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 signed int v49; // edi@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 signed int v50; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 double v51; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 double v52; // st6@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 float v53; // ST34_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 float v54; // ST30_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 unsigned int v55; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 int v56; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 int v57; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 unsigned int v58; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 unsigned int v59; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 signed int v60; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 signed int v61; // edi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 signed int v62; // ecx@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 double v63; // st7@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 double v64; // st6@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 float v65; // ST34_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 float v66; // ST30_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 unsigned int v67; // esi@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 int v68; // eax@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 int v69; // eax@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 unsigned int v70; // ecx@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 __int16 v71; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 signed int v72; // ecx@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 signed int v73; // edi@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 signed int v74; // ecx@138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 double v75; // st7@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 double v76; // st6@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 float v77; // ST34_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 float v78; // ST30_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 unsigned int v79; // esi@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 int v80; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 int v81; // eax@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 unsigned int v82; // ecx@153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 char v83; // al@157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 signed int v84; // ecx@157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 signed int v85; // edi@164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 signed int v86; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 double v87; // st7@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 double v88; // st6@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 float v89; // ST34_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 float v90; // ST30_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 unsigned int v91; // esi@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 signed int v92; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 int v93; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 int v94; // eax@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 unsigned int v95; // ecx@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 unsigned int v96; // eax@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 signed int v97; // ecx@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 signed int v98; // edi@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 signed int v99; // ecx@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 double v100; // st7@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 double v101; // st6@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 float v102; // ST34_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 float v103; // ST30_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 unsigned int v104; // esi@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 signed int v105; // eax@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 int v106; // eax@196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 int v107; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 unsigned int v108; // ecx@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 __int16 v109; // ax@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 signed int v110; // ecx@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 signed int v111; // edi@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 signed int v112; // ecx@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 double v113; // st7@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 double v114; // st6@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 float v115; // ST34_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 float v116; // ST30_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 unsigned int v117; // esi@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 signed int v118; // eax@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 int v119; // eax@221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 int v120; // eax@223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 unsigned int v121; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 char v122; // al@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 signed int v123; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 double v124; // [sp+Ch] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 double v125; // [sp+Ch] [bp-7Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 double v126; // [sp+Ch] [bp-7Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 double v127; // [sp+Ch] [bp-7Ch]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 double v128; // [sp+Ch] [bp-7Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 double v129; // [sp+Ch] [bp-7Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 double v130; // [sp+Ch] [bp-7Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 double v131; // [sp+Ch] [bp-7Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 double v132; // [sp+Ch] [bp-7Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 double v133; // [sp+14h] [bp-74h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 double v134; // [sp+14h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 double v135; // [sp+14h] [bp-74h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 double v136; // [sp+14h] [bp-74h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 double v137; // [sp+14h] [bp-74h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 double v138; // [sp+14h] [bp-74h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 double v139; // [sp+14h] [bp-74h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 double v140; // [sp+14h] [bp-74h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 double v141; // [sp+14h] [bp-74h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 double v142; // [sp+1Ch] [bp-6Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 double v143; // [sp+1Ch] [bp-6Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 double v144; // [sp+1Ch] [bp-6Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 double v145; // [sp+1Ch] [bp-6Ch]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 double v146; // [sp+1Ch] [bp-6Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 double v147; // [sp+1Ch] [bp-6Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 double v148; // [sp+1Ch] [bp-6Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 double v149; // [sp+1Ch] [bp-6Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 double v150; // [sp+1Ch] [bp-6Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 double v151; // [sp+24h] [bp-64h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 double v152; // [sp+24h] [bp-64h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 double v153; // [sp+24h] [bp-64h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 double v154; // [sp+24h] [bp-64h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 double v155; // [sp+24h] [bp-64h]@115
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 int v175; // [sp+4Ch] [bp-3Ch]@13
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 int v182; // [sp+50h] [bp-38h]@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 int v183; // [sp+50h] [bp-38h]@194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 int v184; // [sp+50h] [bp-38h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 int v185; // [sp+54h] [bp-34h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 int v186; // [sp+54h] [bp-34h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 int v187; // [sp+54h] [bp-34h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 int v188; // [sp+54h] [bp-34h]@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 int v189; // [sp+54h] [bp-34h]@141
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 signed int v193; // [sp+5Ch] [bp-2Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 signed int v194; // [sp+5Ch] [bp-2Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 signed int v195; // [sp+5Ch] [bp-2Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 signed int v196; // [sp+5Ch] [bp-2Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 signed int v197; // [sp+5Ch] [bp-2Ch]@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 signed int v198; // [sp+5Ch] [bp-2Ch]@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 signed int v199; // [sp+5Ch] [bp-2Ch]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 signed int v200; // [sp+5Ch] [bp-2Ch]@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 signed int v201; // [sp+5Ch] [bp-2Ch]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 stru350 *v202; // [sp+60h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 signed int v203; // [sp+64h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 signed int v204; // [sp+64h] [bp-24h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 signed int v205; // [sp+64h] [bp-24h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 signed int v206; // [sp+64h] [bp-24h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 signed int v207; // [sp+64h] [bp-24h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 signed int v208; // [sp+64h] [bp-24h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 signed int v209; // [sp+64h] [bp-24h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 signed int v210; // [sp+64h] [bp-24h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 signed int v211; // [sp+64h] [bp-24h]@218
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 signed int v261; // [sp+A0h] [bp+18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 float v262; // [sp+A0h] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 float v263; // [sp+A0h] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 unsigned int v264; // [sp+A0h] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 signed int v265; // [sp+A0h] [bp+18h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 float v266; // [sp+A0h] [bp+18h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 float v267; // [sp+A0h] [bp+18h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 unsigned int v268; // [sp+A0h] [bp+18h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 signed int v269; // [sp+A0h] [bp+18h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 float v270; // [sp+A0h] [bp+18h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 float v271; // [sp+A0h] [bp+18h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 unsigned int v272; // [sp+A0h] [bp+18h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 signed int v273; // [sp+A0h] [bp+18h]@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 float v274; // [sp+A0h] [bp+18h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 float v275; // [sp+A0h] [bp+18h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 unsigned int v276; // [sp+A0h] [bp+18h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 signed int v277; // [sp+A0h] [bp+18h]@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 float v278; // [sp+A0h] [bp+18h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 float v279; // [sp+A0h] [bp+18h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 unsigned int v280; // [sp+A0h] [bp+18h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 signed int v281; // [sp+A0h] [bp+18h]@138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 float v282; // [sp+A0h] [bp+18h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 float v283; // [sp+A0h] [bp+18h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 unsigned int v284; // [sp+A0h] [bp+18h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 signed int v285; // [sp+A0h] [bp+18h]@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 float v286; // [sp+A0h] [bp+18h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 float v287; // [sp+A0h] [bp+18h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 unsigned int v288; // [sp+A0h] [bp+18h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 signed int v289; // [sp+A0h] [bp+18h]@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 float v290; // [sp+A0h] [bp+18h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 float v291; // [sp+A0h] [bp+18h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 unsigned int v292; // [sp+A0h] [bp+18h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 signed int v293; // [sp+A0h] [bp+18h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 float v294; // [sp+A0h] [bp+18h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 float v295; // [sp+A0h] [bp+18h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 unsigned int v296; // [sp+A0h] [bp+18h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 int v297; // [sp+ACh] [bp+24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 int v298; // [sp+ACh] [bp+24h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 int v299; // [sp+ACh] [bp+24h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 int v300; // [sp+ACh] [bp+24h]@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 int v301; // [sp+ACh] [bp+24h]@164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 int v302; // [sp+ACh] [bp+24h]@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 result = this->field_0[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 v202 = this;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 result = this->array_20[3];
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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 if ( result != 32 || (result = a6, v193 = a6, v231 = 0, a8 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 v13 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 v297 = 4 * (a9 - a7);
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 v261 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 v193 += v297;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 ++v231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 result = v231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 if ( v231 >= a8 )
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 v221 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 v212 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 v15 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 v16 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 v262 = (double)v261 / v221 * v212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 v151 = v262 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 v203 = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 v263 = (double)(v14 + 1) / v221 * v212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 v142 = v263 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 v17 = (double)v231 / v15 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 v133 = v17 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 v18 = (double)(v231 + 1) / v15 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 v124 = v18 + 6.7553994e15;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 v264 = 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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 v264 /= v19;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 v23 = v202->_450F55(HIDWORD(v240) | ((v252 | ((v264 | (v22 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 v24 = v193;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 v193 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 *(int *)v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 v14 = v203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 v261 = v203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 if ( v203 >= a7 )
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);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 v175 = a2 + 4 * (LODWORD(v151) + a5 * LODWORD(v133));
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:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 v175 += 4 * a5;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 v21 = v202->_450FB1(v20);
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:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 v264 += BYTE2(v21);
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 v194 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v232 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 v25 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 v298 = 2 * (a9 - a7);
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v265 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 v194 += v298;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 ++v232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 result = v232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 if ( v232 >= a8 )
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 v222 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 v213 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 v27 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 v28 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 v266 = (double)v265 / v222 * v213;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 v125 = v266 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 v204 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 v267 = (double)(v26 + 1) / v222 * v213;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 v134 = v267 + 6.7553994e15;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 v268 = 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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 v268 /= v31;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 v35 = v202->_450F55(HIDWORD(v241) | ((v253 | ((v268 | (v34 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 v36 = v194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 v194 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 *(short *)v36 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 v26 = v204;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 v265 = v204;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 if ( v204 >= a7 )
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);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 v185 = a2 + 4 * (LODWORD(v125) + a5 * LODWORD(v143));
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:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 v185 += 4 * a5;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 v33 = v202->_450FB1(v32);
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:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 v268 += BYTE2(v33);
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 v195 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 v233 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 v37 = a7;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 v269 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 v195 += a9 - a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 ++v233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 result = v233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 if ( v233 >= a8 )
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 v223 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 v214 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 v39 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 v40 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 v270 = (double)v269 / v223 * v214;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 v126 = v270 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 v205 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 v271 = (double)(v38 + 1) / v223 * v214;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 v135 = v271 + 6.7553994e15;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 v272 = 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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 v272 /= v43;
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 v47 = v202->_450F55(HIDWORD(v242) | ((v254 | ((v272 | (v46 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 v48 = v195++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 *(char *)v48 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 v38 = v205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 v269 = v205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 if ( v205 >= a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 v171 = LODWORD(v153) - LODWORD(v144);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 v186 = a2 + 4 * (LODWORD(v126) + a5 * LODWORD(v144));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 while ( SLODWORD(v126) >= SLODWORD(v135) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 v186 += 4 * a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 --v171;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 if ( !v171 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 v178 = (int *)v186;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 v163 = LODWORD(v135) - LODWORD(v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 v44 = *v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 v37 = v44 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 v45 = v202->_450FB1(v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 LODWORD(v242) = v37 + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 --v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 ++v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 --v163;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 if ( !v163 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 LODWORD(v242) = ((unsigned int)v45 >> 24) + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 v272 += BYTE2(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 v254 += BYTE1(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 HIDWORD(v242) += (unsigned __int8)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 result = this->array_20[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 if ( result != 32 || (result = a6, v196 = a6, v234 = 0, a8 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 v49 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 v299 = 4 * (a9 - a7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 v273 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 v196 += v299;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 ++v234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 result = v234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 if ( v234 >= a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 v224 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 v215 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 v51 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 v52 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 v274 = (double)v273 / v224 * v215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 v127 = v274 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 v206 = v50 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 v275 = (double)(v50 + 1) / v224 * v215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 v136 = v275 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 v53 = (double)v234 / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 v145 = v53 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 v54 = (double)(v234 + 1) / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 v154 = v54 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 v55 = (LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 v255 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 v276 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 v243 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 if ( SLODWORD(v145) < SLODWORD(v154) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 v58 = (unsigned int)v243 / ((LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 v276 /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 v255 /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 HIDWORD(v243) /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 if ( v58 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v58 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 v59 = v202->_450F55(HIDWORD(v243) | ((v255 | ((v276 | (v58 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 v60 = v196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 v196 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 *(int *)v60 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 v50 = v206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v273 = v206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 if ( v206 >= a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 v172 = LODWORD(v154) - LODWORD(v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 v187 = a2 + 2 * (LODWORD(v127) + a5 * LODWORD(v145));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 while ( SLODWORD(v127) >= SLODWORD(v136) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 LABEL_102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 v187 += 2 * a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 --v172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 if ( !v172 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 v179 = (int *)v187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 v164 = LODWORD(v136) - LODWORD(v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 v56 = *(short *)v179;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 v49 = v56 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 v57 = v202->_450FB1(v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 LODWORD(v243) = v49 + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 --v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 v179 = (int *)((char *)v179 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 --v164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 if ( !v164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 LODWORD(v243) = ((unsigned int)v57 >> 24) + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 LABEL_100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 v276 += BYTE2(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 v255 += BYTE1(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 HIDWORD(v243) += (unsigned __int8)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 v197 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 v235 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 v61 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 v300 = 2 * (a9 - a7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 v277 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 LABEL_133:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 v197 += v300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 ++v235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 result = v235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 if ( v235 >= a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 v225 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 v216 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 v63 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 v64 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 v278 = (double)v277 / v225 * v216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 v128 = v278 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 v207 = v62 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 v279 = (double)(v62 + 1) / v225 * v216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 v137 = v279 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 v65 = (double)v235 / v63 * v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 v146 = v65 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 v66 = (double)(v235 + 1) / v63 * v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 v155 = v66 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 v67 = (LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 v256 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 v280 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 v244 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 if ( SLODWORD(v146) < SLODWORD(v155) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 LABEL_128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 v70 = (unsigned int)v244 / ((LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 if ( v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v280 /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 v256 /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 HIDWORD(v244) /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 if ( v70 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 v70 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 v71 = v202->_450F55(HIDWORD(v244) | ((v256 | ((v280 | (v70 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 v72 = v197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 v197 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 *(short *)v72 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 v62 = v207;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 v277 = v207;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 if ( v207 >= a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 goto LABEL_133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 v173 = LODWORD(v155) - LODWORD(v146);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 v188 = a2 + 2 * (LODWORD(v128) + a5 * LODWORD(v146));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 while ( SLODWORD(v128) >= SLODWORD(v137) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 LABEL_127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 v188 += 2 * a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 --v173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 if ( !v173 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 v180 = (int *)v188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 v165 = LODWORD(v137) - LODWORD(v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 v68 = *(short *)v180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 v61 = v68 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 v69 = v202->_450FB1(v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 LODWORD(v244) = v61 + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 if ( v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v180 = (int *)((char *)v180 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 --v165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 if ( !v165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 goto LABEL_127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 LODWORD(v244) = ((unsigned int)v69 >> 24) + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 v280 += BYTE2(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 v256 += BYTE1(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 HIDWORD(v244) += (unsigned __int8)v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 v198 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 v236 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 v73 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 v281 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 if ( a7 > v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 LABEL_158:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 v198 += a9 - a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 ++v236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 result = v236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 if ( v236 >= a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 v226 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 v217 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 v75 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 v76 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 v282 = (double)v281 / v226 * v217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 v129 = v282 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 v208 = v74 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 v283 = (double)(v74 + 1) / v226 * v217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 v138 = v283 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 v77 = (double)v236 / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 v147 = v77 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 v78 = (double)(v236 + 1) / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 v156 = v78 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 v257 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 v79 = (LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 v284 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 v245 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 if ( SLODWORD(v147) < SLODWORD(v156) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 LABEL_153:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 v82 = (unsigned int)v245 / ((LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 if ( v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 v284 /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 v257 /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 HIDWORD(v245) /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 if ( v82 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 v82 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 v83 = v202->_450F55(HIDWORD(v245) | ((v257 | ((v284 | (v82 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 v84 = v198++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 *(char *)v84 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v74 = v208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 v281 = v208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 if ( v208 >= a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 goto LABEL_158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 v174 = LODWORD(v156) - LODWORD(v147);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 v189 = a2 + 2 * (LODWORD(v129) + a5 * LODWORD(v147));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 while ( SLODWORD(v129) >= SLODWORD(v138) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 v189 += 2 * a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 --v174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 if ( !v174 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 goto LABEL_153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 v166 = LODWORD(v138) - LODWORD(v129);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 v181 = (int *)v189;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 v80 = *(short *)v181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 v73 = v80 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 v81 = v202->_450FB1(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 LODWORD(v245) = v73 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 --v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 v181 = (int *)((char *)v181 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 --v166;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 if ( !v166 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 LODWORD(v245) = ((unsigned int)v81 >> 24) + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 v284 += BYTE2(v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 v257 += BYTE1(v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 HIDWORD(v245) += (unsigned __int8)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 result = this->array_20[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 if ( result == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 v201 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 v239 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 v111 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 v293 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 if ( a7 <= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 goto LABEL_236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 v229 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 v220 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 v113 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 v114 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 v294 = (double)v293 / v229 * v220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 v132 = v294 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 v211 = v112 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 v295 = (double)(v112 + 1) / v229 * v220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 v141 = v295 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 v115 = (double)v239 / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 v150 = v115 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 v116 = (double)(v239 + 1) / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 v159 = v116 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 v251 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 v260 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 v296 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 v248 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 if ( SLODWORD(v150) >= SLODWORD(v159) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 goto LABEL_231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 v169 = LODWORD(v159) - LODWORD(v150);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 v184 = a2 + a5 * LODWORD(v150);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 v118 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 v192 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 while ( v118 < SLODWORD(v141) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 v119 = *(char *)(v184 + v192);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 v111 = v119 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 v120 = v202->_450FB1(v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 v248 += v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 if ( !v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 --v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 goto LABEL_228;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 v248 += (unsigned int)v120 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 v296 += BYTE2(v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 v260 += BYTE1(v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 v251 += (unsigned __int8)v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 LABEL_228:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 ++v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 v118 = v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 v184 += a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 --v169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 while ( v169 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 LABEL_231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 if ( v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 v296 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 v260 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 v251 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 if ( v121 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 v121 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 v122 = v202->_450F55(v251 | ((v260 | ((v296 | (v121 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 v123 = v201++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 *(char *)v123 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 v112 = v211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 v293 = v211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 while ( v211 < a7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 LABEL_236:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 v201 += a9 - a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 ++v239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 result = v239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 if ( v239 >= a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 if ( result == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 result = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 v200 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 v238 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 if ( a8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 v98 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 v302 = 2 * (a9 - a7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 v99 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 v289 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 if ( a7 <= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 v228 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 v219 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 v100 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 v101 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 v290 = (double)v289 / v228 * v219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 v131 = v290 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 v210 = v99 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 v291 = (double)(v99 + 1) / v228 * v219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 v140 = v291 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 v102 = (double)v238 / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 v149 = v102 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 v103 = (double)(v238 + 1) / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 v158 = v103 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 v250 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 v259 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 v292 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 v247 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 if ( SLODWORD(v149) >= SLODWORD(v158) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 goto LABEL_206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 v168 = LODWORD(v158) - LODWORD(v149);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 v183 = a2 + a5 * LODWORD(v149);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 v105 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 v191 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 while ( v105 < SLODWORD(v140) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v106 = *(char *)(v183 + v191);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v98 = v106 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v107 = v202->_450FB1(v106);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v247 += v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 if ( !v98 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 --v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 goto LABEL_203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 v247 += (unsigned int)v107 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 v292 += BYTE2(v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v259 += BYTE1(v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 v250 += (unsigned __int8)v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 LABEL_203:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 ++v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 v105 = v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v183 += a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 --v168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 while ( v168 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 LABEL_206:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 if ( v104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 v292 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 v259 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 v250 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 if ( v108 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v108 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 v109 = v202->_450F55(v250 | ((v259 | ((v292 | (v108 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 v110 = v200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 v200 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 *(short *)v110 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 v99 = v210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v289 = v210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 while ( v210 < a7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v200 += v302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 ++v238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 result = v238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 if ( v238 >= a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 if ( result != 32 || (result = a6, v199 = a6, v237 = 0, a8 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 v85 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 v301 = 4 * (a9 - a7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 v285 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 if ( a7 <= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 goto LABEL_186;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 v227 = (double)a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 v218 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 v87 = (double)a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 v88 = (double)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 v286 = (double)v285 / v227 * v218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 v130 = v286 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 v209 = v86 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 v287 = (double)(v86 + 1) / v227 * v218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 v139 = v287 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 v89 = (double)v237 / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 v148 = v89 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 v90 = (double)(v237 + 1) / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 v157 = v90 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 v249 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 v258 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 v288 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 v246 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 if ( SLODWORD(v148) >= SLODWORD(v157) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 v167 = LODWORD(v157) - LODWORD(v148);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 v182 = a2 + a5 * LODWORD(v148);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 v92 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 v190 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 while ( v92 < SLODWORD(v139) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v93 = *(char *)(v182 + v190);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 v85 = v93 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 v94 = v202->_450FB1(v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 v246 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 if ( !v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 --v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 goto LABEL_178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 v246 += (unsigned int)v94 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 v288 += BYTE2(v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 v258 += BYTE1(v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 v249 += (unsigned __int8)v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 LABEL_178:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 ++v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 v92 = v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 v182 += a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 --v167;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 while ( v167 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 if ( v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 v288 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 v258 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 v249 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 if ( v95 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 v95 &= 0x7FFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 v96 = v202->_450F55(v249 | ((v258 | ((v288 | (v95 << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 v97 = v199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 v199 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 *(int *)v97 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 v86 = v209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 v285 = v209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 while ( v209 < a7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 LABEL_186:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v199 += v301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 ++v237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 result = v237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 if ( v237 < a8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 //----- (0044E1EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 int TextureFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 TextureFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 const void *v5; // ST0C_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 void *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 FILE *v7; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 signed int v9; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 int v11; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 int v12; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 signed int j; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 TextureFrame *v15; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 int v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 int k; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 FrameTableTxtLine v20; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 int v21; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 char *Str1; // [sp+280h] [bp-84h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 char *Str; // [sp+284h] [bp-80h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 int v24; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 int v25; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 int Argsa; // [sp+30Ch] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 Abortf("CTextureFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 v25 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 if ( v21 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 Abortf("CTextureFrameTable::load, too few arguments, %s line %i.", Args, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 v4 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 v5 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 v2->uNumTextures = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 v2->pTextures = (TextureFrame *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 Abortf("CTextureFrameTable::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 v2->uNumTextures = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 fseek(v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 strcpy(v2->pTextures[v2->uNumTextures].pTextureName, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 v2->pTextures[v2->uNumTextures].uAnimTime = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 for ( v2->pTextures[v2->uNumTextures].uFlags = 0; v9 < v21; ++v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 if ( !_strcmpi((&Str1)[4 * v9], "New") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 v10 = (int)&v2->pTextures[v2->uNumTextures].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 *(char *)v10 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 ++v2->uNumTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 if ( (signed int)(v2->uNumTextures - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 v13 = (int)&v2->pTextures[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 if ( !(*(char *)(v13 + 38) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 *(char *)(v13 + 18) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 while ( v11 < (signed int)(v2->uNumTextures - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 for ( j = 0; j < (signed int)v2->uNumTextures; *(short *)(Argsa + 16) = v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 v15 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 Argsa = (int)&v15[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 v16 = *(short *)(Argsa + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 if ( *(char *)(Argsa + 18) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 for ( k = (int)&v15[j]; *(char *)(k + 18) & 1; k += 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 v16 += *(short *)(k + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 LOWORD(v16) = v15[j].uAnimTime + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 //----- (0044F57C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 void *__fastcall SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *a2, int a3, int a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 MapInfo *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 SpawnPointMM7 *v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 char v8; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 int v9; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 int v11; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 int v12; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 int v13; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 int v14; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 int v15; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 int v16; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 int v17; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 int v18; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 int v19; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 int v20; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 Actor *v22; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 int v23; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 signed int v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 int v25; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 unsigned __int16 v26; // ax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 MonsterDesc *v27; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 signed int v28; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 __int16 v29; // cx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 __int16 v30; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 __int16 v31; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 int v32; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 int v33; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 int v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v36; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int v37; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 int v38; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int v39; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 std::string v40; // [sp-18h] [bp-100h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 void *v41; // [sp-14h] [bp-FCh]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 void *v42; // [sp-10h] [bp-F8h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 size_t v43; // [sp-Ch] [bp-F4h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 const char *v44; // [sp-8h] [bp-F0h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 char *v45; // [sp-4h] [bp-ECh]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 char Str; // [sp+Ch] [bp-DCh]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 char Str2; // [sp+2Ch] [bp-BCh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 char v48; // [sp+A4h] [bp-44h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 void *Src; // [sp+A8h] [bp-40h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 int v50; // [sp+ACh] [bp-3Ch]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 char Source; // [sp+B0h] [bp-38h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 int v52; // [sp+D0h] [bp-18h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 void *v53; // [sp+D4h] [bp-14h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 int v54; // [sp+D8h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 int v55; // [sp+DCh] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 int v56; // [sp+E0h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 int v57; // [sp+E4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 v5 = pMapInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 result = (void *)pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 result = (void *)(uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 v8 = (a2->uAttributes & 1) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 result = (void *)(a2->uAttributes & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 v8 = (char)result == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 if ( !v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 result = (void *)(a2->uIndex - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 v56 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 switch ( (int)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 v9 = pMapInfo->uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 v11 = v5->uEncounterMonster1AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 v45 = v5->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 v12 = v10 % (v11 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 v13 = v5->field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 v9 = pMapInfo->uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 v14 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 v15 = v5->uEncounterMonster2AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 v45 = v5->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 v12 = v14 % (v15 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 v13 = v5->field_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 v9 = pMapInfo->uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 v17 = v5->uEncounterMonster3AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 v45 = v5->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 v12 = v16 % (v17 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 v13 = v5->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 v57 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 v56 = v9 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 result = strcpy(&Source, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 result = (void *)sprintfex(&Source, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 if ( Source == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 v57 += a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 if ( v57 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 strcpy(&Str2, &Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 v56 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 v18 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 result = (void *)(v56 + uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 if ( (signed int)(v56 + uNumActors) >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 v19 = v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 v20 = v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 v21 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 v55 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 a4 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 a3 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v54 = pIndoor->GetSector(v19, v20, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 result = (void *)((((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v52 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 if ( v18 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v22 = &pActors[uNumActors];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 pActors[uNumActors].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 v23 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 v24 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 v25 = (unsigned __int16)word_4E8152[3 * v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 if ( v23 >= v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 if ( v23 < v25 + (unsigned __int16)word_4E8152[3 * v57 + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 if ( v24 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 if ( v24 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 v44 = "%s B";
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 if ( v24 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 sprintfex(&Str2, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 v26 = pMonsterList->GetMonsterByName(&Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 v50 = (signed __int16)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 v45 = &Str2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 if ( (signed __int16)v26 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 sprintfex(&Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 MessageBoxA(nullptr, &Str, nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 v27 = &pMonsterList->pMonsters[(signed __int16)v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 v28 = pMonsterStats->_4563FF(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 v28 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 Src = (char *)&pMonsterStats + 88 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 strcpy(v22->pActorName, *(const char **)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 v43 = 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 v42 = Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 v29 = *((short *)Src + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 v41 = &v22->pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 v22->sCurrentHP = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 memcpy(v41, v42, v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 v22->word_000086_some_monster_id = v50 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 v22->uActorRadius = v27->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 v22->uActorHeight = v27->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 v22->uMovementSpeed = v27->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 v30 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 v22->vInitialPosition.x = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 v22->vPosition.x = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 v31 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 v22->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 v22->vInitialPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 v22->vPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 v22->vInitialPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 v22->vPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 v22->uSectorID = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 v22->uGroup = v6->uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 v22->PrepareSprites((char)v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 v22->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 v32 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 v33 = v32 % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 v34 = stru_5C6E00->SinCos(v32 % 2048);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 a4 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 a3 = (unsigned __int64)(v34 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 v55 = a3 + v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 v35 = stru_5C6E00->SinCos(v33 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 a4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 a3 = (unsigned __int64)(v35 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 a4 = a3 + v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 v36 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 a3 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 v37 = pIndoor->GetSector(v55, a4, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 if ( v37 == v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 v38 = _46CEC3_get_floor_level(v55, a4, a3, v37, (int *)&v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 if ( v38 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 if ( abs(v38 - a3) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 a3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v22->uAttributes |= 0x080000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 v53 = (char *)v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 result = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 while ( (signed int)v53 < v56 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 //----- (0044FA4C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 signed int v3; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 char *v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 signed int result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 Actor *v6; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 char *v7; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 MonsterDesc *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 unsigned __int16 v9; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 int v10; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 int v11; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 int v12; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 const char *v15; // [sp-4h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 unsigned __int16 v16; // [sp+0h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 int v17; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 int v18; // [sp+8h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 int v19; // [sp+Ch] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 size_t v20; // [sp+10h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 int v21; // [sp+14h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 int v22; // [sp+18h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 unsigned int v23; // [sp+1Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 v16 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v17 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 if ( a2 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v15 = "Elemental Light C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 if ( a2 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 v15 = "Elemental Light B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 v15 = "Elemental Light A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 v20 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 while ( *(short *)v4 != Removed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 if ( v3 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 v20 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 v22 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v6 = &pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 v7 = (char *)&pMonsterStats->pInfos[v23 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 v6->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 v8 = &pMonsterList->pMonsters[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 strcpy(v6->pActorName, *(const char **)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 v6->sCurrentHP = *((short *)v7 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 memcpy(&v6->pMonsterInfo, v7, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 v6->word_000086_some_monster_id = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 v6->uActorRadius = v8->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 v6->uActorHeight = v8->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 v9 = v8->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v6->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v6->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 v6->pMonsterInfo.uExp = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v6->uMovementSpeed = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v10 = rand() % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(v10) * (signed __int64)v19) >> 16) + pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 v18 = stru_5C6E00->SinCos(v10 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v23 = (unsigned __int64)(v18 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v12 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 v13 = (unsigned __int64)(v18 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 v6->vInitialPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 v14 = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 LOWORD(v12) = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 v6->vInitialPosition.z = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v6->vPosition.z = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 LOWORD(v12) = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v6->vPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 v6->vInitialPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v6->vPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 v6->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 v6->uSectorID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 v6->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 v6->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 v6->uAlly = 9999;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 v6->uGroup = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 v6->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 v6->uAIState = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 v6->uCurrentActionLength = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 v6->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 || (v22 = pParty->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 result = pIndoor->GetSector(v11, v14, pParty->vPosition.y),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 result == v21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 && (result = _46CEC3_get_floor_level(v11, v14, v22, result, &v18), result != -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 && (result = abs(result - v22), result <= 1024) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 if ( v20 == uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 v6->uSummonerID = 8 * v17 | 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 result = v6->pActorBuffs[2].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 pParty->uTimePlayed + (signed __int64)((double)(a3 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 //----- (0044FFD8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 MapInfo *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 SpawnPointMM7 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 signed int v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 signed __int64 v12; // qtt@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 signed int v15; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 unsigned __int16 v16; // dx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 char *v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 unsigned __int16 v18; // ax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 int v19; // ST0C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 int v20; // ST08_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 int v21; // ST04_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 int v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 signed int v23; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 unsigned __int16 v24; // dx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 char *v25; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 unsigned __int16 v26; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 int v27; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 int v28; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 int v29; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 __int16 v30; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 int v32; // [sp+7Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 int v33; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 int v34; // [sp+84h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 v4 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 v5 = v4 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 v6 = 2 * (v2->field_2F + 7 * v3->uIndex) - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 v7 = (unsigned __int8)byte_4E8168[v6 + 16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 v8 = (unsigned __int8)byte_4E8168[v6 + 17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 v32 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 v9 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 v10 = v8 - v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 v12 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 result = v9 / v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 v13 = v33 + (unsigned __int64)(v12 % v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 if ( v13 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 if ( v32 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 if ( v32 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 v19 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 v20 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 v21 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 v22 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 if ( v3->uIndex == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 v14 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 if ( v3->uIndex != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 if ( v3->uIndex == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 v14 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 if ( v3->uIndex != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 if ( v3->uIndex == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 v14 = rand() % 1001 + 1000;
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 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 while ( v16 != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 if ( v15 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 v18 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 a1a.stru_24.uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 a1a.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 a1a.stru_24.uAdditionalValue = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 v14 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 a1a.stru_24.uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 v14 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 a1a.stru_24.uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 v14 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 a1a.stru_24.uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 result = a1a.stru_24.GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 while ( v24 != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 if ( v23 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 v26 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 a1a.uObjectDescID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 a1a.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 v27 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 v28 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 v29 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 a1a.vPosition.y = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 a1a.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 a1a.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 a1a.uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 a1a.vPosition.z = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 a1a.vPosition.x = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 a1a.field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 a1a.field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 a1a.field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 v30 = pIndoor->GetSector(v28, v27, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 a1a.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 a1a.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 a1a.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 a1a.uSectorID = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 return a1a.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 //----- (00450218) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 void __cdecl sub_450218_prolly_generate_chests_loot()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 Chest *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 MapInfo *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 ItemGen *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 signed int v8; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 int v10; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 int v11; // ebp@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 signed int v13; // ebp@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 ItemGen *v14; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 signed int v15; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 signed __int64 v16; // qtt@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 int v17; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 signed int v18; // [sp+10h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 int v19; // [sp+14h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 MapInfo *v20; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 Chest *v21; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 int v22; // [sp+20h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 signed int v23; // [sp+24h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 v18 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 v0 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 v1 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 v2 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 v21 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 v20 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 v3 = v1->mm7__vector_pItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 v23 = 140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 if ( (v3->uItemID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 v4 = rand() % 5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 v5 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 v6 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v7 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 v8 = v6 - v5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 v9 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 v19 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 if ( v9 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 if ( v18 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 if ( v18 < 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v10 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 if ( v19 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 v10 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 if ( v19 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 v10 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 v3->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 v10 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 v3->uAttributtes |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 v3->uAdditionalValue = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 v11 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 if ( v11 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 v22 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 if ( v12 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 v14 = &v21->mm7__vector_pItems[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 while ( v14->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 if ( v13 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 v15 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 v18 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 if ( v15 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 if ( v15 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 pItemsTable->GenerateItem(v19, 0, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 v14->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 v17 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 if ( v19 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 v17 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 v14->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v17 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 if ( v19 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 v17 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 v14->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 v17 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 v14->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 v14->uAdditionalValue = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v12 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 --v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 v17 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 v10 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 v3->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 v10 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 v3->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 pItemsTable->GenerateItem(v9, 0, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 v3->GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v2 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 --v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 while ( v23 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 v1 = v21 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 while ( (signed int)v21 < (signed int)&uNumChests );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 //----- (00450521) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 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
8275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 signed int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 unsigned __int16 v9; // cx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 char *v10; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 unsigned __int16 v11; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 LayingItem a1; // [sp+8h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v6 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 v10 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 while ( v9 != *(short *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 v10 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 if ( v8 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 a1.uObjectDescID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 a1.vPosition.y = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 a1.vPosition.x = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 a1.vPosition.z = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 a1.uFacing = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 a1.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 a1.uSectorID = pIndoor->GetSector(a3, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 return a1.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 //----- (0045063B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 int __fastcall sub_45063B(MapInfo *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 Actor *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 signed __int64 v4; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 int v6; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 int v9; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 int v12; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 int v14; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 int v16; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 int v17; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 int v20; // [sp+24h] [bp-20h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 MapInfo *v21; // [sp+28h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 int v22; // [sp+2Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 int v23; // [sp+30h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 int v24; // [sp+34h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 int v25; // [sp+38h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 int v26; // [sp+3Ch] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 int v27; // [sp+40h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 v24 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 v3 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 v22 = v3->pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 v4 = (signed __int64)((double)v22 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 if ( (int)v4 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 if ( v2 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 v6 = rand() % 1024 + 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 v20 = stru_5C6E00->SinCos(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 v20 = stru_5C6E00->SinCos(v7 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 v19.uIndex = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 v19.vPosition.y = v23 + pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 v19.vPosition.z = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 v19.vPosition.z = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 v19.vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 v23 + pParty->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 pParty->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 &v26,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 &v27,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 v9 = abs(v19.vPosition.y - pOutdoor->pBModels[v8].vBoundingCenter.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v10 = abs(v19.vPosition.x - pOutdoor->pBModels[v8].vBoundingCenter.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 if ( sub_4621DA(v10, v9, 0) < pOutdoor->pBModels[v8].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 if ( v23 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 v11 = v25 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 if ( v25 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 v11 = v25 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 v12 = rand() % 512 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 v13 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 v15 = stru_5C6E00->SinCos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 v20 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 v23 = (unsigned __int64)(v15 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 v16 = stru_5C6E00->SinCos(v14 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 v20 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 v23 = (unsigned __int64)(v16 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 v19.vPosition.y = v23 + pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 v19.vPosition.z = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 v19.uIndex = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 if ( v17 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 v18 = _46CEC3_get_floor_level(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 v19.vPosition.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 if ( v18 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 if ( abs(v18 - pParty->vPosition.y) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 while ( v26 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 v11 = v26 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 SpawnEncounter(v21, &v19, 0, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 result = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 //----- (00450929) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 int LevelDecoration::GetGlobalEvent()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 LevelDecoration *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 signed int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 int v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 int v9; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 int v12; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 int v13; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 v2 = v1->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 if ( v2 > 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 switch ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 case 209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 result = rand() % 7 + 183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 case 210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 result = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 case 211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 result = 151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 case 212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 result = 152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 case 213:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 result = 153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 case 214:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 result = 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 case 215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 result = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 case 216:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 result = 156;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 case 217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 result = 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 case 218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 result = 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 case 219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 result = 159;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 result = 160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 case 221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 result = 161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 if ( v2 == 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 result = rand() % 7 + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 if ( v2 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 v9 = v2 - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 return rand() % 6 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 v10 = v9 - 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 return 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 v11 = v10 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 if ( !v11 || (v12 = v11 - 3) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 return 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 v13 = v12 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 return rand() % 7 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 if ( v13 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 return rand() % 7 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 if ( v2 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 return 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 v3 = v2 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 return 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 v4 = v3 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 return 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 return rand() % 4 + 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 v6 = v5 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 return 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 v7 = v6 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 return 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 if ( v7 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 return 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 //----- (00450AAA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 void *__cdecl RespawnGlobalDecorations()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 LevelDecoration *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 result = memset(stru_5E4C90.field_4B, 0, 0x7Du);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 v3 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 if ( !v3->field_16_event_id )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 result = (void *)v3->IsInteractive();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 if ( v0 < 124 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 v3->field_1C = v0 + 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 stru_5E4C90.field_4B[v0++] = v3->GetGlobalEvent();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 while ( v2 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 //----- (00450B0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 bool __fastcall SpawnActor(unsigned int uMonsterID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 MonsterDesc *v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 MonsterInfo *v4; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 Vec3_int_ v5; // ST08_12@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 unsigned int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 Actor *v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 Actor actor; // [sp+4h] [bp-350h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 v1 = uMonsterID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 if ( uNumActors == 499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 v3 = &pMonsterList->pMonsters[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 v4 = &pMonsterStats->pInfos[v1 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 memset(&actor, 0, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 strcpy(actor.pActorName, v4->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 actor.sCurrentHP = LOWORD(v4->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 actor.word_000086_some_monster_id = v1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 actor.uActorRadius = v3->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 actor.uActorHeight = v3->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 actor.uMovementSpeed = v3->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 v5 = pParty->vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 actor.vInitialPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 actor.vPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 actor.uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 actor.vInitialPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 actor.vPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 actor.vInitialPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 actor.vPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 pSprites_LOD->DeleteSomeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 pPaletteManager->ResetNonTestLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 v6 = uNumActors - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 if ( dword_5C6DF8 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 dword_5C6DF8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 v6 = uNumActors++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 v7 = &pActors[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 memcpy(v7, &actor, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 v7->PrepareSprites(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 //----- (00450DA3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 int __cdecl GetAlertStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 result = pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 //----- (00450DDE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 stru350 *stru350::_450DDE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 _450DF1(" ", " ");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 return this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 //----- (00450DF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 void *stru350::_450DF1(const char *Src, const char *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 stru350 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 unsigned int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 int v6; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 unsigned int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 int v9; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 int v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 int v11; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 int v12; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 unsigned int v13; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 int v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 unsigned int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 int v18; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 char v19; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 unsigned int v20; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 int v21; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 unsigned int v23; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 int v24; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 int v26; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 int v27; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 unsigned int v28; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 int v29; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 int v30; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 int v31; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 unsigned int v32; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 int v33; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 unsigned int i; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 int v35; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 unsigned int v36; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 int v37; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 int v38; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 memcpy(this, Src, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 result = memcpy(v3->array_20, a3, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 (*(char *)&result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 if ( v3->field_0[1] & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 v5 = v3->field_0[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 while ( !(v5 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 while ( v5 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 v3->field_40 = 32 - v7 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 v3->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 v8 = v3->field_0[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 while ( !(v8 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 while ( v8 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 v11 = 24 - v10 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 v3->field_48 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 v13 = v3->field_0[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 while ( !(v13 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 while ( v13 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 v15 = 16 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 v16 = v3->field_0[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 v3->field_50 = v15 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 while ( !(v16 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 while ( v16 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 v19 = (v3->array_20[1] & 1) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 v3->field_58 = v17 - v18 + 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 v3->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 v20 = v3->array_20[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 while ( !(v20 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 while ( v20 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 v3->field_44 = 32 - v22 - v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 v23 = v3->array_20[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 while ( !(v23 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 while ( v23 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 v26 = 24 - v25 - v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 v3->field_4C = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 v28 = v3->array_20[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 while ( !(v28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 while ( v28 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 v31 = 16 - v29 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 v32 = v3->array_20[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 v3->field_54 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 for ( i = v32; !(i & 1); i >>= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 i >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 while ( i & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 v35 = 32 - v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 v36 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 v3->field_5C = v35 - v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 while ( !(v36 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 while ( v36 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 v3->field_5C = v37 - v38 + 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 //----- (00450F55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 unsigned int stru350::_450F55(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 v2 = a2 & dword_4E82C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 if ( this->array_20[1] & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 v2 = (unsigned int)v2 >> this->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 return v2 & this->array_20[7] | this->array_20[4] & ((a2 & (unsigned int)dword_4E82B4) >> this->field_4C) | this->array_20[5] & ((a2 & (unsigned int)dword_4E82B8) >> this->field_54) | this->array_20[6] & ((a2 & (unsigned int)dword_4E82BC) >> this->field_5C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 // 4E82B4: using guessed type int dword_4E82B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 // 4E82B8: using guessed type int dword_4E82B8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 // 4E82BC: using guessed type int dword_4E82BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 // 4E82C0: using guessed type int dword_4E82C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 //----- (00450FB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 int stru350::_450FB1(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 int v2; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 int v4; // [sp+Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 v4 = this->field_0[1] & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 v2 = a2 & this->field_0[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 v2 <<= this->field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 return v2 | ((a2 & this->field_0[4]) << this->field_48) | ((a2 & this->field_0[5]) << this->field_50) | ((a2 & this->field_0[6]) << this->field_58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 //----- (00452442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 int v4; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 __int16 v5; // ST14_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 __int16 v6; // dx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 __int16 v8; // ST10_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 unsigned __int16 v10; // dh@1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957 int v12; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 __int16 a3a; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 v5 = a2 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 v6 = (unsigned __int16)a4 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 v8 = a1 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 a3a = (unsigned __int16)a3 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 LOWORD(v7) = a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 LOWORD(v7) = a3a & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 LOWORD(v9) = v9 & 0x1C00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 v11 = v7 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 LOWORD(v7) = v5 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 v12 = v7 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 LOWORD(v7) = v8 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 return ((v8 & 7) + (v5 & 7) + (a3a & 7) + (v6 & 7)) | (v7 + v12) | ((v8 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 + (v5 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 + v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 //----- (0045281E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 // Calculates atan2(y/x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 // return value: angle in integer format (multiplier of Pi/1024)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 unsigned int stru193_math::Atan2(int x, int y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 stru193_math *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 signed int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 unsigned int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 signed int v9; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 signed __int64 v10; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 unsigned int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 int v12; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 int v13; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 int v14; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 unsigned int v15; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 signed int v16; // [sp-4h] [bp-10h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 v4 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 v5 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 v6 = abs(y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 if ( v5 < 65536 && v6 >> 15 >= v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 if ( !x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 result = v3->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 if ( y <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 result += v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 if ( y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 if ( x <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 x = -x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 if ( y >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 v16 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 if ( y >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 v4 = -y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 v9 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 LODWORD(v10) = v4 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 HIDWORD(v10) = v4 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 v11 = v3->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 v12 = v10 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 if ( v12 <= v3->pTanTable[(signed int)v3->uIntegerHalfPi >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 v11 = (signed int)v3->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 v7 = (signed int)v3->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 v7 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 if ( v12 <= v3->pTanTable[(signed int)(v7 + v11) >> 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 v11 = (signed int)(v7 + v11) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 v7 = (signed int)(v7 + v11) >> 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 v13 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 v14 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 while ( v13 < v14 && v12 >= v3->pTanTable[v13] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 if ( v9 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 v15 = v3->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 if ( v9 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 return v13 + v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 if ( v9 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 return v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 v15 = v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 return v15 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 if ( x <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 result = v3->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 //----- (00452969) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 stru193_math::stru193_math()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 stru193_math *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 double v3; // ST18_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 signed int v7; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 this->uIntegerDoublePi = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 this->uIntegerPi = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 this->uIntegerHalfPi = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 this->uDoublePiMask = 2047;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 this->uPiMask = 1023;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 this->uHalfPiMask = 511;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 this->pTanTable[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 this->pCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 this->pInvCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 v2 = (char *)&this->pInvCosTable[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 v3 = (double)v7 * 3.141592653589793 * 0.0009765625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 *((int *)v2 - 1040) = (signed __int64)(tan(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 *((int *)v2 - 520) = (signed __int64)(cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 *(int *)v2 = (signed __int64)(1.0 / cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 while ( v7 < (signed int)v1->uIntegerHalfPi );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 v4 = v1->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 if ( v4 < 520 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 v5 = (int)&v1->pCosTable[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 v6 = 520 - v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 *(int *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 *(int *)(v5 + 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 *(int *)(v5 - 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 v5 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 //----- (00452A9E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 signed int __fastcall sub_452A9E(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 int v2; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 if ( a1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 v4 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 result *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 v2 = ((unsigned int)v3 >> 30) | 4 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 v5 = 2 * result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 v3 *= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 if ( v2 >= (unsigned int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 v2 -= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 if ( a1 - result * result >= (unsigned int)(result - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 //----- (00452AE2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 int __fastcall MakeColorMaskFromBitDepth(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 signed __int64 v1; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 v1 = 4294967296i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 if ( a1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 LODWORD(v1) = HIDWORD(v1) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 HIDWORD(v1) *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 --a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 while ( a1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 //----- (00452AF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 void *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 unsigned __int16 *v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 unsigned int i; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 v4 = a1 | (a1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 *pPixels = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 v3 = pPixels + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 --uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 for ( i = uNumPixels & 1; i; --i ) // leftover pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 *v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 //----- (00452B2E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 unsigned int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 v2 = uDiceSides;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 if ( uDiceSides )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 if ( (signed int)uNumDice > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 v5 = uNumDice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 v3 += rand() % v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 //----- (00452B95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 void __cdecl SetSomeItemsNames()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 memset(&stru_5E4C50, 0, sizeof(stru_5E4C50));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 //----- (00452C30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 char *RemoveQuotes(char *Str)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 if ( *Str == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 Str[strlen(Str) - 1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 v1 = Str + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 //----- (00452C49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 void __cdecl InitializeGameText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 //char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 char *v1; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 int v2; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 //char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 //v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 if (pGlobalTXT_Raw)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 pAllocator->FreeChunk(pGlobalTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 pGlobalTXT_Raw = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 pGlobalTXT_Raw = (char *)pEvents_LOD->LoadRaw("global.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 strtok(pGlobalTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 strtok(nullptr, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 for (uint i = 0; i < 677; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 char *p = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 while (*++p != '\t' && *p);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 pGlobalTXT_LocalizationStrings[i] = RemoveQuotes(p + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 aMonthNames[2] = pGlobalTXT_LocalizationStrings[417];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 aMonthNames[3] = pGlobalTXT_LocalizationStrings[418];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 aMonthNames[4] = pGlobalTXT_LocalizationStrings[419];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 aMonthNames[5] = pGlobalTXT_LocalizationStrings[420];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 aMonthNames[6] = pGlobalTXT_LocalizationStrings[421];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 aCharacterConditionNames[0] = pGlobalTXT_LocalizationStrings[52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 aMonthNames[7] = pGlobalTXT_LocalizationStrings[422];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 aCharacterConditionNames[1] = pGlobalTXT_LocalizationStrings[241];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 aMonthNames[8] = pGlobalTXT_LocalizationStrings[423];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 aCharacterConditionNames[2] = pGlobalTXT_LocalizationStrings[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 aMonthNames[9] = pGlobalTXT_LocalizationStrings[424];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 aCharacterConditionNames[3] = pGlobalTXT_LocalizationStrings[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 aMonthNames[10] = pGlobalTXT_LocalizationStrings[425];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 aCharacterConditionNames[4] = pGlobalTXT_LocalizationStrings[69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 aMonthNames[11] = pGlobalTXT_LocalizationStrings[426];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 aCharacterConditionNames[5] = pGlobalTXT_LocalizationStrings[117];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 aCharacterConditionNames[6] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 aCharacterConditionNames[8] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 aCharacterConditionNames[10] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 aCharacterConditionNames[12] = pGlobalTXT_LocalizationStrings[162];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 aCharacterConditionNames[13] = pGlobalTXT_LocalizationStrings[231];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 aCharacterConditionNames[14] = pGlobalTXT_LocalizationStrings[58];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 aCharacterConditionNames[15] = pGlobalTXT_LocalizationStrings[220];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 aCharacterConditionNames[7] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 aCharacterConditionNames[9] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 aCharacterConditionNames[11] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 aCharacterConditionNames[16] = pGlobalTXT_LocalizationStrings[76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 pClassNames[9] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 pClassNames[10] = pGlobalTXT_LocalizationStrings[432];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 pClassNames[11] = pGlobalTXT_LocalizationStrings[27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 pClassNames[12] = pGlobalTXT_LocalizationStrings[262];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 pClassNames[13] = pGlobalTXT_LocalizationStrings[263];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 pClassNames[14] = pGlobalTXT_LocalizationStrings[264];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 pClassNames[15] = pGlobalTXT_LocalizationStrings[28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 pClassNames[16] = pGlobalTXT_LocalizationStrings[265];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 pClassNames[17] = pGlobalTXT_LocalizationStrings[267];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 pClassNames[18] = pGlobalTXT_LocalizationStrings[119];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 pClassNames[19] = pGlobalTXT_LocalizationStrings[124];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 pClassNames[20] = pGlobalTXT_LocalizationStrings[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 pClassNames[21] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 pClassNames[22] = pGlobalTXT_LocalizationStrings[33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 aCharacterConditionNames[17] = pGlobalTXT_LocalizationStrings[601];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 pClassNames[23] = pGlobalTXT_LocalizationStrings[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 aCharacterConditionNames[18] = pGlobalTXT_LocalizationStrings[98];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 pClassNames[24] = pGlobalTXT_LocalizationStrings[256];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 pClassNames[0] = pGlobalTXT_LocalizationStrings[253];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 pClassNames[25] = pGlobalTXT_LocalizationStrings[257];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 pClassNames[1] = pGlobalTXT_LocalizationStrings[254];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 pClassNames[26] = pGlobalTXT_LocalizationStrings[44];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 pClassNames[2] = pGlobalTXT_LocalizationStrings[255];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 pClassNames[27] = pGlobalTXT_LocalizationStrings[46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 pClassNames[3] = pGlobalTXT_LocalizationStrings[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 pClassNames[28] = pGlobalTXT_LocalizationStrings[268];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 pClassNames[4] = pGlobalTXT_LocalizationStrings[307];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 pClassNames[29] = pGlobalTXT_LocalizationStrings[269];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 pClassNames[5] = pGlobalTXT_LocalizationStrings[114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 pClassNames[30] = pGlobalTXT_LocalizationStrings[270];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 pClassNames[6] = pGlobalTXT_LocalizationStrings[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 pClassNames[31] = pGlobalTXT_LocalizationStrings[48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 pClassNames[7] = pGlobalTXT_LocalizationStrings[13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 pClassNames[32] = pGlobalTXT_LocalizationStrings[259];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 pClassNames[8] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 pClassNames[33] = pGlobalTXT_LocalizationStrings[260];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 pClassNames[34] = pGlobalTXT_LocalizationStrings[261];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 pClassNames[35] = pGlobalTXT_LocalizationStrings[49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 pSkillNames[0] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 pSkillNames[1] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 pSkillNames[2] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 pSkillNames[3] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 pSkillNames[4] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 pSkillNames[5] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 pSkillNames[6] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 pSkillNames[7] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 pSkillNames[23] = pGlobalTXT_LocalizationStrings[294];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 pSkillNames[9] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 pSkillNames[24] = pGlobalTXT_LocalizationStrings[295];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 pSkillNames[10] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 pSkillNames[25] = pGlobalTXT_LocalizationStrings[296];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 pSkillNames[11] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 pSkillNames[26] = pGlobalTXT_LocalizationStrings[297];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 pSkillNames[12] = pGlobalTXT_LocalizationStrings[283];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 pSkillNames[27] = pGlobalTXT_LocalizationStrings[298];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 pSkillNames[13] = pGlobalTXT_LocalizationStrings[284];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 pSkillNames[28] = pGlobalTXT_LocalizationStrings[299];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 pSkillNames[14] = pGlobalTXT_LocalizationStrings[285];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 pSkillNames[29] = pGlobalTXT_LocalizationStrings[300];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 pSkillNames[15] = pGlobalTXT_LocalizationStrings[286];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 pSkillNames[30] = pGlobalTXT_LocalizationStrings[50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 pSkillNames[16] = pGlobalTXT_LocalizationStrings[289];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 pSkillNames[31] = pGlobalTXT_LocalizationStrings[77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 aDayNames[0] = pGlobalTXT_LocalizationStrings[145];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 pSkillNames[17] = pGlobalTXT_LocalizationStrings[290];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 pSkillNames[32] = pGlobalTXT_LocalizationStrings[88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 aDayNames[1] = pGlobalTXT_LocalizationStrings[230];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 pSkillNames[18] = pGlobalTXT_LocalizationStrings[291];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 pSkillNames[33] = pGlobalTXT_LocalizationStrings[89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 aDayNames[2] = pGlobalTXT_LocalizationStrings[243];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 pSkillNames[19] = pGlobalTXT_LocalizationStrings[287];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 pSkillNames[34] = pGlobalTXT_LocalizationStrings[90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 aDayNames[3] = pGlobalTXT_LocalizationStrings[227];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 pSkillNames[20] = pGlobalTXT_LocalizationStrings[288];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 pSkillNames[35] = pGlobalTXT_LocalizationStrings[95];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 aDayNames[4] = pGlobalTXT_LocalizationStrings[91];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 pSkillNames[21] = pGlobalTXT_LocalizationStrings[292];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 pSkillNames[36] = pGlobalTXT_LocalizationStrings[301];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 aDayNames[5] = pGlobalTXT_LocalizationStrings[188];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 pSkillNames[8] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 pSkillNames[22] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 pSkillNames[37] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 aDayNames[6] = pGlobalTXT_LocalizationStrings[222];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 aNPCProfessionNames[0] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 aNPCProfessionNames[1] = pGlobalTXT_LocalizationStrings[308];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 aNPCProfessionNames[2] = pGlobalTXT_LocalizationStrings[309];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 aNPCProfessionNames[3] = pGlobalTXT_LocalizationStrings[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 aNPCProfessionNames[4] = pGlobalTXT_LocalizationStrings[306];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 aNPCProfessionNames[5] = pGlobalTXT_LocalizationStrings[310];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 aNPCProfessionNames[6] = pGlobalTXT_LocalizationStrings[311];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 aNPCProfessionNames[7] = pGlobalTXT_LocalizationStrings[312];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 aSpellSchoolNames[0] = pGlobalTXT_LocalizationStrings[87];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 aNPCProfessionNames[8] = pGlobalTXT_LocalizationStrings[313];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 aSpellSchoolNames[1] = pGlobalTXT_LocalizationStrings[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 aNPCProfessionNames[9] = pGlobalTXT_LocalizationStrings[314];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 aNPCProfessionNames[21] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 aNPCProfessionNames[10] = pGlobalTXT_LocalizationStrings[105];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 aSpellSchoolNames[2] = pGlobalTXT_LocalizationStrings[240];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 aNPCProfessionNames[11] = pGlobalTXT_LocalizationStrings[315];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 aNPCProfessionNames[22] = pGlobalTXT_LocalizationStrings[324];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 aNPCProfessionNames[12] = pGlobalTXT_LocalizationStrings[316];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 aSpellSchoolNames[3] = pGlobalTXT_LocalizationStrings[70];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 aNPCProfessionNames[13] = pGlobalTXT_LocalizationStrings[317];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 aNPCProfessionNames[23] = pGlobalTXT_LocalizationStrings[498];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 aSpellSchoolNames[4] = pGlobalTXT_LocalizationStrings[214];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 aNPCProfessionNames[14] = pGlobalTXT_LocalizationStrings[115];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 aNPCProfessionNames[24] = pGlobalTXT_LocalizationStrings[525];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 aSpellSchoolNames[5] = pGlobalTXT_LocalizationStrings[142];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 aNPCProfessionNames[15] = pGlobalTXT_LocalizationStrings[318];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 aNPCProfessionNames[25] = pGlobalTXT_LocalizationStrings[327];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 aSpellSchoolNames[6] = pGlobalTXT_LocalizationStrings[29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 aNPCProfessionNames[16] = pGlobalTXT_LocalizationStrings[319];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 aNPCProfessionNames[26] = pGlobalTXT_LocalizationStrings[328];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 aSpellSchoolNames[7] = pGlobalTXT_LocalizationStrings[133];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 aNPCProfessionNames[17] = pGlobalTXT_LocalizationStrings[320];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 aNPCProfessionNames[27] = pGlobalTXT_LocalizationStrings[329];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 aSpellSchoolNames[8] = pGlobalTXT_LocalizationStrings[54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 aNPCProfessionNames[18] = pGlobalTXT_LocalizationStrings[321];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 aNPCProfessionNames[28] = pGlobalTXT_LocalizationStrings[330];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 aAMPMNames[0] = pGlobalTXT_LocalizationStrings[472];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 aNPCProfessionNames[19] = pGlobalTXT_LocalizationStrings[322];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 aNPCProfessionNames[29] = pGlobalTXT_LocalizationStrings[331];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 aAMPMNames[1] = pGlobalTXT_LocalizationStrings[473];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 aNPCProfessionNames[20] = pGlobalTXT_LocalizationStrings[323];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 aNPCProfessionNames[30] = pGlobalTXT_LocalizationStrings[332];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 aNPCProfessionNames[31] = pGlobalTXT_LocalizationStrings[333];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 aNPCProfessionNames[32] = pGlobalTXT_LocalizationStrings[334];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 aNPCProfessionNames[33] = pGlobalTXT_LocalizationStrings[335];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 aNPCProfessionNames[34] = pGlobalTXT_LocalizationStrings[336];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 aNPCProfessionNames[35] = pGlobalTXT_LocalizationStrings[337];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 aNPCProfessionNames[36] = pGlobalTXT_LocalizationStrings[338];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 aNPCProfessionNames[37] = pGlobalTXT_LocalizationStrings[339];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 aNPCProfessionNames[38] = pGlobalTXT_LocalizationStrings[340];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 aNPCProfessionNames[39] = pGlobalTXT_LocalizationStrings[341];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 aNPCProfessionNames[40] = pGlobalTXT_LocalizationStrings[342];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 aNPCProfessionNames[56] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 aNPCProfessionNames[41] = pGlobalTXT_LocalizationStrings[343];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 aNPCProfessionNames[57] = pGlobalTXT_LocalizationStrings[600];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 aNPCProfessionNames[42] = pGlobalTXT_LocalizationStrings[596];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 aNPCProfessionNames[58] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 aNPCProfessionNames[43] = pGlobalTXT_LocalizationStrings[345];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 aMoonPhaseNames[0] = pGlobalTXT_LocalizationStrings[150];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 aNPCProfessionNames[44] = pGlobalTXT_LocalizationStrings[346];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 aMoonPhaseNames[1] = pGlobalTXT_LocalizationStrings[171];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 aNPCProfessionNames[45] = pGlobalTXT_LocalizationStrings[347];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 aNPCProfessionNames[46] = pGlobalTXT_LocalizationStrings[348];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 aNPCProfessionNames[47] = pGlobalTXT_LocalizationStrings[349];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 aNPCProfessionNames[48] = pGlobalTXT_LocalizationStrings[350];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 aAttributeNames[0] = pGlobalTXT_LocalizationStrings[144];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 aNPCProfessionNames[49] = pGlobalTXT_LocalizationStrings[597];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 aAttributeNames[1] = pGlobalTXT_LocalizationStrings[116];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 aNPCProfessionNames[50] = pGlobalTXT_LocalizationStrings[352];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 aAttributeNames[2] = pGlobalTXT_LocalizationStrings[163];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 aNPCProfessionNames[51] = pGlobalTXT_LocalizationStrings[353];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 aAttributeNames[3] = pGlobalTXT_LocalizationStrings[75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 aNPCProfessionNames[52] = pGlobalTXT_LocalizationStrings[598];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 aAttributeNames[4] = pGlobalTXT_LocalizationStrings[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 aNPCProfessionNames[53] = pGlobalTXT_LocalizationStrings[344];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 aAttributeNames[5] = pGlobalTXT_LocalizationStrings[211];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 aNPCProfessionNames[54] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 aAttributeNames[6] = pGlobalTXT_LocalizationStrings[136];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 aNPCProfessionNames[55] = pGlobalTXT_LocalizationStrings[599];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 aSpellNames[14] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 aSpellNames[33] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 aSpellNames[9] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 aSpellNames[34] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 aSpellNames[0] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 aSpellNames[10] = pGlobalTXT_LocalizationStrings[218];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 aSpellNames[20] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 aSpellNames[35] = pGlobalTXT_LocalizationStrings[235];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 aSpellNames[11] = pGlobalTXT_LocalizationStrings[217];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 aSpellNames[21] = pGlobalTXT_LocalizationStrings[443];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 aSpellNames[36] = pGlobalTXT_LocalizationStrings[246];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 aSpellNames[12] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 aSpellNames[24] = pGlobalTXT_LocalizationStrings[221];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 aSpellNames[37] = pGlobalTXT_LocalizationStrings[247];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 aSpellNames[13] = pGlobalTXT_LocalizationStrings[462];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 aSpellNames[26] = pGlobalTXT_LocalizationStrings[228];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 aSpellNames[38] = pGlobalTXT_LocalizationStrings[248];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 aSpellNames[15] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 aSpellNames[28] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 aSpellNames[39] = pGlobalTXT_LocalizationStrings[674];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 aSpellNames[16] = pGlobalTXT_LocalizationStrings[452];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 aSpellNames[29] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 aSpellNames[40] = pGlobalTXT_LocalizationStrings[249];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 aSpellNames[2] = pGlobalTXT_LocalizationStrings[219];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 aSpellNames[17] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 aSpellNames[30] = pGlobalTXT_LocalizationStrings[229];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 aSpellNames[41] = pGlobalTXT_LocalizationStrings[258];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 aSpellNames[5] = pGlobalTXT_LocalizationStrings[454];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 aSpellNames[3] = pGlobalTXT_LocalizationStrings[215];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 aSpellNames[7] = pGlobalTXT_LocalizationStrings[455];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 aSpellNames[18] = pGlobalTXT_LocalizationStrings[456];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 aSpellNames[31] = pGlobalTXT_LocalizationStrings[233];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 aSpellNames[42] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 aSpellNames[6] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 aSpellNames[25] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 aSpellNames[1] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 aSpellNames[4] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 aSpellNames[8] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 aSpellNames[19] = pGlobalTXT_LocalizationStrings[453];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 aSpellNames[22] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 aSpellNames[23] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 aSpellNames[27] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 aSpellNames[32] = pGlobalTXT_LocalizationStrings[234];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 aSpellNames[43] = pGlobalTXT_LocalizationStrings[657];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 //----- (00453E6D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 void StorylineText::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 StorylineText *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 char *v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 char v4; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 char *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 int v6; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 int v7; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 int v8; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 char *v9; // [sp+14h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 int Str; // [sp+18h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 if ( pHistoryTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 pAllocator->FreeChunk(pHistoryTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 pHistoryTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 strtok(pHistoryTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 Str = (int)&v2->field_4[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 v9 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 v8 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 v3 = strtok(v1, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 if ( *v3 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 v1 = 0;
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 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 v4 = v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 while ( v4 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 v6 = (int)&v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 if ( v3[(int)v5] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 *(char *)v6 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 if ( v5 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 if ( v9 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 *(char **)(Str - 8) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 if ( v9 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 *(char *)Str = atoi(v3);
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 - 2 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 *(char * *)(Str - 4) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 v3 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 while ( (signed int)(v9 - 1) <= 3 && (char *)v8 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 Str += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 //----- (00453F62) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 void MapStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 MapStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 unsigned int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 char *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 char v5; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 size_t v7; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 size_t v8; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 size_t v9; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 size_t v10; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 size_t v11; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 size_t v12; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 char Str[32]; // [sp+Ch] [bp-34h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 char *v14; // [sp+2Ch] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 int v15; // [sp+30h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 int v16; // [sp+34h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 unsigned int v17; // [sp+38h] [bp-8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 MapStats *v18; // [sp+3Ch] [bp-4h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 if ( pMapStatsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 pAllocator->FreeChunk(pMapStatsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 pMapStatsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 strtok(pMapStatsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 v1->uNumMaps = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 v3 = strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 v14 = &v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 switch ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 v1->pInfos[v2].pName = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 v1->pInfos[v2].pFilename = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v1->pInfos[v2].uNumResets = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 v1->pInfos[v2].uFirstVisitedAt = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v1->pInfos[v2]._per = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 v1->pInfos[v2].uRespawnIntervalDays = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v1->pInfos[v2]._alert_days = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v1->pInfos[v2]._steal_perm = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 v1->pInfos[v2].field_2D = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v1->pInfos[v2].field_2E = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 v1->pInfos[v2].field_2F = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v1->pInfos[v2].field_30 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 v1->pInfos[v2].field_31 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v1->pInfos[v2].field_32 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v1->pInfos[v2].field_33 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v1->pInfos[v2].pEncounterMonster1Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v1->pInfos[v2].field_34 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 v18->pInfos[0].uEncounterMonster1AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v7 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 if ( v17 >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 v18->pInfos[0].uEncounterMonster1AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 v8 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 if ( v17 == v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 v18->pInfos[0].uEncounterMonster1AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v18->pInfos[0].uEncounterMonster1AtMost = v18->pInfos[0].uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 v1->pInfos[v2].pEncounterMonster2Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 v1->pInfos[v2].field_37 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 v18->pInfos[0].uEncounterMonster2AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 v9 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 if ( v17 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 v18->pInfos[0].uEncounterMonster2AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 if ( v17 == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 v18->pInfos[0].uEncounterMonster2AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 v18->pInfos[0].uEncounterMonster2AtMost = v18->pInfos[0].uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 v1->pInfos[v2].pEncounterMonster3Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 v1->pInfos[v2].field_3A = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 v18->pInfos[0].uEncounterMonster3AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 v11 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 if ( v17 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 v18->pInfos[0].uEncounterMonster3AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 v12 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 if ( v17 == v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 v18->pInfos[0].uEncounterMonster3AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v18->pInfos[0].uEncounterMonster3AtMost = v18->pInfos[0].uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 v1->pInfos[v2].uRedbookTrackID = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 if ( strcmp(v4, "GENERIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 if ( strcmp(v4, "PADDEDCELL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 if ( strcmp(v4, "ROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 if ( strcmp(v4, "BATHROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 if ( strcmp(v4, "LIVINGROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 if ( strcmp(v4, "STONEROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 if ( strcmp(v4, "AUDITORIUM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 if ( strcmp(v4, "CONCERTHALL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 if ( strcmp(v4, "CAVE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 if ( strcmp(v4, "ARENA") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 if ( strcmp(v4, "HANGAR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 if ( strcmp(v4, "CARPETEDHALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 if ( strcmp(v4, "HALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 if ( strcmp(v4, "STONECORRIDOR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 if ( strcmp(v4, "ALLEY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 if ( strcmp(v4, "FOREST") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 if ( strcmp(v4, "CITY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 if ( strcmp(v4, "MOUNTAINS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 if ( strcmp(v4, "QUARRY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 if ( strcmp(v4, "PLAIN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 if ( strcmp(v4, "PARKINGLOT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 if ( strcmp(v4, "SEWERPIPE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 if ( strcmp(v4, "UNDERWATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 if ( strcmp(v4, "DRUGGED") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 if ( strcmp(v4, "DIZZY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 if ( strcmp(v4, "PSYCHOTIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 v1->pInfos[v2].uEAXEnv = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 v1->pInfos[v2].uEAXEnv = 25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 v1->pInfos[v2].uEAXEnv = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v1->pInfos[v2].uEAXEnv = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 v1->pInfos[v2].uEAXEnv = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 v1->pInfos[v2].uEAXEnv = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v1->pInfos[v2].uEAXEnv = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 v1->pInfos[v2].uEAXEnv = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 v1->pInfos[v2].uEAXEnv = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 v1->pInfos[v2].uEAXEnv = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 v1->pInfos[v2].uEAXEnv = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 v1->pInfos[v2].uEAXEnv = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 v1->pInfos[v2].uEAXEnv = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 v1->pInfos[v2].uEAXEnv = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 v1->pInfos[v2].uEAXEnv = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 v1->pInfos[v2].uEAXEnv = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 v1->pInfos[v2].uEAXEnv = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 v1->pInfos[v2].uEAXEnv = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 v1->pInfos[v2].uEAXEnv = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 v1->pInfos[v2].uEAXEnv = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 v1->pInfos[v2].uEAXEnv = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 v1->pInfos[v2].uEAXEnv = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 v1->pInfos[v2].uEAXEnv = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 v1->pInfos[v2].uEAXEnv = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 v1->pInfos[v2].uEAXEnv = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 v1->pInfos[v2].uEAXEnv = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 v1->pInfos[v2].uEAXEnv = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 v4 = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 while ( v16 - 1 <= 29 && !v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 while ( (signed int)v2 < 77 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 v1->uNumMaps = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 // 453F62: using guessed type char Str[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 //----- (004547A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 unsigned int MapStats::GetMapInfo(const char *Str2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 MapStats *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 unsigned int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 if ( (signed int)this->uNumMaps <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 v4 = (const char **)&this->pInfos[1].pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 while ( !*v4 || _strcmpi(*v4, Str2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 v4 += 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 if ( (signed int)v3 >= (signed int)v2->uNumMaps )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 //----- (004547E4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 void FactionTable::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 signed int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 int v7; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 signed int v8; // [sp+4h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 signed int v9; // [sp+8h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 FactionTable *v10; // [sp+Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 v10 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 if ( pHostileTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 pHostileTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 strtok(pHostileTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 v2 = strtok(v1, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 v9 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 v4 = (int)((char *)&v10[-7] + v8 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 v5 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 v5 = v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v7 = (int)&v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 if ( v2[(int)v6] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 *(char *)v7 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 if ( v6 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 if ( v3 >= 1 && v3 <= 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 *(char *)v4 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v4 += 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 v2 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 while ( v3 - 1 <= 90 && (char *)v9 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 while ( v8 < 89 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 if ( pHostileTXT_Raw != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 pHostileTXT_Raw = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 //----- (004548E2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 std::string v5; // [sp-18h] [bp-28h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 const char *v6; // [sp-8h] [bp-18h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 signed int v7; // [sp-4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 std::string *v8; // [sp+8h] [bp-8h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 int a3; // [sp+Fh] [bp-1h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v2 = (int)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 result = (int)a1->pProperties[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 if ( !_strcmpi((const char *)result, "Dispel") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 v7 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 ++*(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 v7 = 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 v7 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 v7 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 v7 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v7 = 38;
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), "Haste") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 v7 = 95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 v7 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 v7 = 90;
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), "ShrapMetal") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 v7 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 v7 = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 v7 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 if ( !_strcmpi(*(const char **)(v2 + 4), off_4E876C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 v7 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 v7 = 97;
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), "Reanimate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 v7 = 82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 v7 = 57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 v7 = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 sprintfex(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 v7 = 73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 v7 = 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 v7 = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 v7 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 v7 = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 v7 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 v7 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 v7 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 v7 = 81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 v7 = 93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 v7 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 v7 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 v7 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 v7 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 v7 = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 v7 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 v7 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 *(int *)v3 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 //----- (00454CB4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 int __thiscall ParseAttackType(unsigned __int8 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 unsigned __int8 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 int v3; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 int v4; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 if ( tolower(*a1) == 'f' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 if ( tolower(*v1) == 'a' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 if ( tolower(*v1) == 'w' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 if ( tolower(*v1) == 'e' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 tolower(v1[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 return 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 if ( tolower(*v1) == 's' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 return 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 if ( tolower(*v1) == 'm' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 v3 = -(tolower(v1[1]) != 'i');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 LOBYTE(v3) = v3 & 0xFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 result = v3 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 if ( tolower(*v1) == 'l' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 return 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 v4 = -(tolower(*v1) != 'd');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 LOBYTE(v4) = v4 & 0xFA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 result = v4 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 //----- (00454D7D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 signed int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 int *v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 size_t v10; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 int v11; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 signed int v12; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 v5 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 *(char *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 *(char *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 if ( (signed int)v10 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 LOBYTE(v8) = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 if ( (unsigned __int8)*v5 >= 0x30u && (unsigned __int8)v8 <= 0x39u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 *(char *)v4 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 LOBYTE(v8) = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 v7 = (int *)&v5[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 if ( tolower((unsigned __int8)v5[v6]) == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 *(char *)v11 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 *(char *)a3 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 *(char *)v7 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 v8 = tolower(*(char *)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 if ( v8 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 *(char *)a4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 while ( v6 < (signed int)v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 v4 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 //----- (00454E3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 int __fastcall ParseMissleAttackType(const char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 const char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 int v4; // [sp-4h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 v1 = Str1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 if ( _strcmpi(Str1, "ARROW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 if ( _strcmpi(v1, "ARROWF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 if ( _strcmpi(v1, "FIRE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 if ( _strcmpi(v1, off_4E887C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 if ( _strcmpi(v1, "WATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 if ( _strcmpi(v1, "EARTH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 if ( _strcmpi(v1, "SPIRIT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 if ( _strcmpi(v1, "MIND") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 if ( _strcmpi(v1, "BODY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 if ( _strcmpi(v1, "LIGHT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 if ( _strcmpi(v1, "DARK") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 if ( _strcmpi(v1, "ENER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 v4 = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 v4 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 v4 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 v4 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 v4 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 v4 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 v4 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 v4 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 v4 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 v4 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 //----- (00458244) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 unsigned int __fastcall SkillToMastery(unsigned __int16 a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 result = 1; // Normal
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 if ( HIBYTE(a1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 result = 4; // Grandmaster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 if ( (a1 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 if ( a1 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 result = 2; // Expert
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 result = 3; // Master
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 //----- (0045828B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 unsigned int __fastcall GetSpellColor(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 unsigned __int16 v1; // dx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 unsigned __int16 v2; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 unsigned __int16 v4; // [sp-4h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 if ( a1 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 if ( a1 < 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 goto LABEL_31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 v4 = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 if ( a1 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 v4 = 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v2 = 192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 LABEL_31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v1 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v2 = 235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v2 = 225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 v4 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 v1 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 v1 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 if ( a1 >= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 v1 = 212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 v2 = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 //----- (004583B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 LevelDecoration::LevelDecoration()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 this->field_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 this->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 this->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 this->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 this->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 this->uDecorationDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 this->field_16_event_id = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 this->uCog = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 //----- (00458600) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 void DecorationList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 DecorationList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 v2 = fopen("data\\ddeclist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 Abortf("Unable to save ddeclist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 fwrite(v1->pDecorations, 0x54u, v1->uNumDecorations, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 //----- (0045864C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 void DecorationList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 uNumDecorations = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 pDecorations = (DecorationDesc *)pAllocator->AllocNamedChunk(pDecorations,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 84 * uNumDecorations, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 memcpy(pDecorations, (char *)pSerialized + 4, 84 * uNumDecorations);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 //----- (00458693) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 void DecorationList::InitializeDecorationSprite(unsigned int uDecID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 pSpriteFrameTable->InitializeSprite(this->pDecorations[uDecID].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 //----- (004586B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 bool DecorationList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 DecorationList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 unsigned int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 FILE *v6; // ST18_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 unsigned __int16 v8; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 const char *v9; // ST20_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813 const char *v10; // ST18_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 __int16 v11; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 const char *v12; // ST14_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 unsigned __int16 v13; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 const char *v14; // ST10_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 __int16 v15; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 const char *v16; // ST0C_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 unsigned __int8 v17; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 const char *v18; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 unsigned __int8 v19; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 const char *v20; // ST04_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 unsigned __int8 v21; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 const char *v22; // ST00_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 unsigned __int8 v23; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 char v24; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 unsigned __int8 v25; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 int j; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 const char *v27; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 int v28; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 int v30; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 int v31; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 int v32; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 int v33; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 int v34; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 int v35; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 FrameTableTxtLine v37; // [sp+Ch] [bp-460h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 FrameTableTxtLine v38; // [sp+88h] [bp-3E4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 char Dest; // [sp+104h] [bp-368h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 char Buf; // [sp+17Ch] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 FrameTableTxtLine v41; // [sp+370h] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 FrameTableTxtLine v42; // [sp+3ECh] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 FILE *File; // [sp+468h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 unsigned int Argsa; // [sp+474h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 Abortf("DecorationDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 memcpy(&v42, frame_table_txt_parser(&Buf, &v41), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 v4 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 v2->uNumDecorations = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 v5 = pAllocator->AllocNamedChunk(v2->pDecorations, 84 * v4, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 v2->pDecorations = (DecorationDesc *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 Abortf("DecorationDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 v2->uNumDecorations = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 memcpy(&v42, frame_table_txt_parser(&Buf, &v38), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 strcpy(v2->pDecorations[v2->uNumDecorations].pName, v42.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 v8 = pSpriteFrameTable->FastFindSprite(v2->pDecorations[v2->uNumDecorations].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 v9 = v42.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 v2->pDecorations[v2->uNumDecorations].uSpriteID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 strcpy(v2->pDecorations[v2->uNumDecorations].field_20, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v10 = v42.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v2->pDecorations[v2->uNumDecorations].uType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 v12 = v42.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v2->pDecorations[v2->uNumDecorations].uRadius = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v14 = v42.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 v2->pDecorations[v2->uNumDecorations].uDecorationHeight = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v16 = v42.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v2->pDecorations[v2->uNumDecorations].uLightRadius = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 v18 = v42.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v2->pDecorations[v2->uNumDecorations].uColoredLightRed = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v20 = v42.pProperties[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v2->pDecorations[v2->uNumDecorations].uColoredLightGreen = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v21 = atoi(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v22 = v42.pProperties[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v2->pDecorations[v2->uNumDecorations].uColoredLightBlue = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 v2->pDecorations[v2->uNumDecorations].uSoundID = atoi(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v25 = __OFSUB__(v42.field_0, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v23 = v42.field_0 == 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v24 = v42.field_0 - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v2->pDecorations[v2->uNumDecorations].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 if ( !((unsigned __int8)(v24 ^ v25) | v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 strcpy(&Dest, v42.pProperties[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 memcpy(&v41, frame_table_txt_parser(&Dest, &v37), sizeof(v41));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 for ( j = 0; j < v41.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v27 = v41.pProperties[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 if ( _strcmpi(v41.pProperties[j], off_4E8CB8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 if ( _strcmpi(v27, "Invisible") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 if ( _strcmpi(v27, "FS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 if ( _strcmpi(v27, "FM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 if ( _strcmpi(v27, "FF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 if ( _strcmpi(v27, "Marker") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 if ( _strcmpi(v27, "LoopSlow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 if ( _strcmpi(v27, "EmitFire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 if ( _strcmpi(v27, "Dawn") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 if ( !_strcmpi(v27, "Dusk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 v35 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 *(char *)v35 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 v34 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 *(char *)v34 |= 0x40u;
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 v33 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 *(char *)v33 |= 0x20u;
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 v32 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 *(char *)v32 |= 0x10u;
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 v31 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 *(char *)v31 |= 8u;
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 v30 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 *(char *)v30 |= 4u;
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 v29 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 *(char *)v29 |= 2u;
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 v28 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 *(char *)v28 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 ++v2->uNumDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 //----- (00459064) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 void ObjectList::InitializeSprites()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 for (uint i = 0; i < uNumObjects; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 pSpriteFrameTable->InitializeSprite(pObjects[i].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 //----- (00459090) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 void ObjectList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 ObjectList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 v2 = fopen("data\\dobjlist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 Abortf("Unable to save dobjlist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 fwrite(v1->pObjects, 0x38u, v1->uNumObjects, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 //----- (004590DC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 void ObjectList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 uNumObjects = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 pObjects = (ObjectDesc *)pAllocator->AllocNamedChunk(pObjects, 56 * uNumObjects, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 memcpy(pObjects, (char *)pSerialized + 4, 56 * uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 //----- (00459123) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 bool ObjectList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 ObjectList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 __int32 v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 void *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 FILE *v7; // ST0C_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 char *i; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 unsigned __int16 v9; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 const char *v10; // ST20_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 __int16 v11; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 const char *v12; // ST1C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 __int16 v13; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 const char *v14; // ST18_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 __int16 v15; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 const char *v16; // ST14_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 __int16 v17; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 const char *v18; // ST10_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 __int16 v19; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 const char *v20; // ST0C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 int v21; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 const char *v22; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 int v23; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 int v24; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 int v26; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 int v27; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 int v28; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 int v29; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 int v30; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 int v31; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 const char *v32; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 const char *v33; // ST20_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 int v34; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 char v35; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 const char *v36; // ST1C_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 char v37; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 const char *v38; // ST18_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 FrameTableTxtLine v40; // [sp+8h] [bp-460h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 FrameTableTxtLine v41; // [sp+84h] [bp-3E4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 char Dest; // [sp+100h] [bp-368h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 char Buf; // [sp+178h] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 FrameTableTxtLine v44; // [sp+36Ch] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 FrameTableTxtLine v45; // [sp+3E8h] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 FILE *File; // [sp+464h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 unsigned int Argsa; // [sp+470h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 int Argsb; // [sp+470h] [bp+8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 pAllocator->FreeChunk(this->pObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 v2->pObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 v2->uNumObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 v4 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 File = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 Abortf("ObjectDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 if ( fgets(&Buf, 490, v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 if ( v45.field_0 && *v45.pProperties[0] != '/' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v5 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 v2->uNumObjects = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 v6 = pAllocator->AllocNamedChunk(v2->pObjects, 56 * v5, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 v2->pObjects = (ObjectDesc *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 if ( v6 == (void *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 Abortf("ObjectDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 memset(v6, v3, 56 * v2->uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v2->uNumObjects = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 fseek(v7, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 if ( v45.field_0 && *v45.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 v10 = v45.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v2->pObjects[v2->uNumObjects].uSpriteID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 v12 = v45.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 v2->pObjects[v2->uNumObjects].uObjectID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 v14 = v45.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v2->pObjects[v2->uNumObjects].uRadius = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v16 = v45.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v2->pObjects[v2->uNumObjects].uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v18 = v45.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v2->pObjects[v2->uNumObjects].uLifetime = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v20 = v45.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v2->pObjects[v2->uNumObjects].uSpeed = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 strcpy(&Dest, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 if ( v45.field_0 > 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 for ( Argsb = 0; Argsb < v44.field_0; ++Argsb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v21 = Argsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v22 = v44.pProperties[Argsb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 if ( !_strcmpi(v44.pProperties[Argsb], "NoDraw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 v23 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 *(char *)v23 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 if ( !_strcmpi(v22, "Lifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 v24 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 *(char *)v24 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 if ( !_strcmpi(v22, "FTLifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 v25 = (int)&v2->pObjects[v2->uNumObjects];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 *(short *)(v25 + 42) = 8 * pSpriteFrameTable->pSpriteSFrames[*(short *)(v25 + 40)].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 v26 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 *(char *)v26 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 v27 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 *(char *)v27 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 if ( !_strcmpi(v22, "NoPickup") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 v28 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 *(char *)v28 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 if ( !_strcmpi(v22, "NoGravity") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 v29 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 *(char *)v29 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 if ( !_strcmpi(v22, "FlagOnIntercept") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 v30 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 *(char *)v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 if ( !_strcmpi(v22, "Bounce") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 v31 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 *(char *)v31 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 v32 = v45.pProperties[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 if ( !_strcmpi(v45.pProperties[v21], "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 if ( !_strcmpi(v32, "Lines") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 if ( !_strcmpi(v44.pProperties[v21], "bits") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 v33 = v44.pProperties[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 v34 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 *(char *)(v34 + 1) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 v35 = atoi(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 v36 = v44.pProperties[v21 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 v2->pObjects[v2->uNumObjects].uParticleTrailColorR = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 v37 = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 v38 = v44.pProperties[v21 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 v2->pObjects[v2->uNumObjects].uParticleTrailColorG = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 v2->pObjects[v2->uNumObjects].uParticleTrailColorB = atoi(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 ++v2->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 //----- (0045BAA5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 int __thiscall sub_45BAA5(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 sub_45BAB6(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 //----- (0045BAB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 std::string *__fastcall sub_45BAB6(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 size_t v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 stru_69BD44 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 return &stru_69BD44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 //----- (0045E03A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 unsigned __int16 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 int v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 unsigned __int8 v5; // cf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 unsigned int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 unsigned __int16 *v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 int j; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 unsigned __int16 *v9; // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 LONG v11; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 signed __int64 v12; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 unsigned int v13; // ST10_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 HRESULT v14; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 int v15; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 signed __int64 v16; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 signed int v17; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 unsigned __int16 *v18; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 int k; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 DDSURFACEDESC2 Dst; // [sp+4h] [bp-A0h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 unsigned __int16 *pPixels; // [sp+80h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 float v23; // [sp+84h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 unsigned __int16 *_this; // [sp+88h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 float v25; // [sp+8Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 unsigned int v26; // [sp+90h] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 int v27; // [sp+94h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 int v28; // [sp+98h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 int i; // [sp+9Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 int v30; // [sp+A0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v30 = width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 v2 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 v27 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v23 = 452.0 / (double)width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v25 = 336.0 / (double)height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 pPixels = (unsigned __int16 *)operator new(2 * height * width);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 pRenderer->SetGameRenderStates();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 v9 = (unsigned __int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 v11 = Dst.lPitch >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 for ( i = 0; i < v27; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 v28 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 if ( v30 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v26 = v11 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 v12 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 *v3 = v9[v26 + (int)v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 v13 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v5 = v30 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 v6 = (unsigned int)v30 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v7 = &v3[2 * v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 for ( j = v5; j; --j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 _this = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 v26 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 if ( pRenderer->pTargetSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 v15 = v26 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v16 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 *v3 = _this[v15 + (int)v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 while ( i < v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 v18 = &v3[2 * ((unsigned int)v30 >> 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 for ( k = v30 & 1; k; --k )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 --v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 while ( v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 return pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 //----- (0045E26C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 void __thiscall SaveScreenshot(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 unsigned __int16 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 v1 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 v2 = MakeScreenshot(92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 pRenderer->SavePCXImage(v1, (char *)v2, 92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 //----- (0045E361) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 void __fastcall GameUI_DrawLoadMenu(unsigned int uDialogueType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 unsigned int v1; // ebp@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 unsigned int v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 signed int v3; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 FILE *v4; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 FILE *v5; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 unsigned int v6; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 GUIButton *v7; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 const char *v8; // [sp-8h] [bp-26Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 char *v9; // [sp-4h] [bp-268h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 enum TEXTURE_TYPE v10; // [sp-4h] [bp-268h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 unsigned int uDialogueType_; // [sp+10h] [bp-254h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 RGBTexture *pTex; // [sp+10h] [bp-254h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 SavegameHeader *Dest; // [sp+14h] [bp-250h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 const char *Str1; // [sp+18h] [bp-24Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 LODWriteableFile v15; // [sp+1Ch] [bp-248h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 int v16; // [sp+260h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 uDialogueType_ = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 dword_6BE138 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 memset(pSavegameUsedSlots, 0, 0xB4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 memset(&pSavegameThumbnails, 0, 0x708u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 if ( uDialogueType_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 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
11467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 v1 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 v2 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 v1 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 v2 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 pRenderer->DrawTextureIndexed(241u, 302u, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 pRenderer->DrawTextureIndexed(18u, 141u, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 351u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 302u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 pRenderer->DrawTextureRGB(0, 0, &stru_506F20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 pGUIWindow_CurrentMenu = GUIWindow::Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 saveload_dlg_xs[uDialogueType_],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 saveload_dlg_ys[uDialogueType_],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 saveload_dlg_zs[uDialogueType_],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 saveload_dlg_ws[uDialogueType_],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 (enum WindowType)24,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);// "Reading..."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 pSavegameList->Initialize(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 if ( dword_6A0C9C > (signed int)uNumSavegameFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 dword_6A0C9C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 uLoadGameUI_SelectedSlot = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 v15.AllocSubIndicesAndIO(0x12Cu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 if ( (signed int)uNumSavegameFiles > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 Dest = pSavegameHeader;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 pTex = pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 Str1 = (const char *)pSavegameList->pSavesNames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 sprintfex(pTmpBuf, "saves\\%s", Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 if ( _access(pTmpBuf, 6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 v15.LoadFile(pTmpBuf, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 v4 = v15.FindContainer("header.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 fread(Dest, 0x64u, 1u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 if ( !_strcmpi(Str1, pGlobalTXT_LocalizationStrings[613]) )// "AutoSave.MM7"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 strcpy(Dest->pName, pGlobalTXT_LocalizationStrings[16]);// "Autosave"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 v5 = v15.FindContainer("image.pcx", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 v9 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 pSavegameUsedSlots[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 strcpy(Dest->pName, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 pTex->LoadFromFILE(v5, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 v15.CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 pSavegameUsedSlots[v3] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 Str1 += 280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 ++pTex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 ++Dest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 if ( v3 >= (signed int)uNumSavegameFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 v9 = pGlobalTXT_LocalizationStrings[72]; // "Empty"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 v15.FreeSubIndexAndIO();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 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
11547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 v10 = (TEXTURE_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 v8 = "LS_saveD";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 v6 = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 v10 = (TEXTURE_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 v8 = "LS_loadD";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 uTextureID_x_d = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 uTextureID_LS_ = pIcons_LOD->LoadTexture(v8, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 191u, 18u, 1, 0, 0xA5u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 pGUIWindow_CurrentMenu->CreateButton(21u, 219u, 191u, 18u, 1, 0, 0xA5u, 1u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 pGUIWindow_CurrentMenu->CreateButton(21u, 240u, 191u, 18u, 1, 0, 0xA5u, 2u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 pGUIWindow_CurrentMenu->CreateButton(21u, 261u, 191u, 18u, 1, 0, 0xA5u, 3u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 pGUIWindow_CurrentMenu->CreateButton(21u, 282u, 191u, 18u, 1, 0, 0xA5u, 4u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 pGUIWindow_CurrentMenu->CreateButton(21u, 303u, 191u, 18u, 1, 0, 0xA5u, 5u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 pGUIWindow_CurrentMenu->CreateButton(21u, 324u, 191u, 18u, 1, 0, 0xA5u, 6u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 241u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 302u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 105u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 40u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 0xA4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 350u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 302u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 105u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 40u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 0xA6u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 215u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 199u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 17u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 17u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 0xA2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 v7 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 215u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 0x143u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 0xA3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 uNumSavegameFiles,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 v16 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 ptr_69BD58 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 // 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
11625 // 6A0C9C: using guessed type int dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 // 6BE138: using guessed type int dword_6BE138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 //----- (0045E93E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 void __cdecl GameUI_DrawSaveMenu()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 unsigned int v0; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 unsigned int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 unsigned int *v2; // ebp@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 char *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 FILE *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 FILE *v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 const char *v6; // ST64_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 GUIButton *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 char *v8; // [sp+10h] [bp-254h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 SavegameHeader *Dest; // [sp+14h] [bp-250h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 RGBTexture *this_; // [sp+18h] [bp-24Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 LODWriteableFile v11; // [sp+1Ch] [bp-248h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 int v12; // [sp+260h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 memset(pSavegameUsedSlots, 0, 0xB4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 memset(&pSavegameThumbnails, 0, 0x708u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 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
11662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 v0 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 v1 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 v0 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 v1 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 0x15Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 pRenderer->DrawTextureIndexed(0x12u, 0x8Du, (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 SavegameList::Initialize(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 v11.AllocSubIndicesAndIO(0x12Cu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v2 = pSavegameUsedSlots;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 Dest = pSavegameHeader;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 this_ = pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v8 = (char *)pSavegameList->pSavesNames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v3 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 if ( !*v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 v3 = "1.mm7";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 sprintfex(pTmpBuf, "saves\\%s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 if ( _access(pTmpBuf, 0) || _access(pTmpBuf, 6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 v6 = pGlobalTXT_LocalizationStrings[72];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 strcpy(Dest->pName, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 v11.LoadFile(pTmpBuf, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 v4 = v11.FindContainer("header.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 fread(Dest, 0x64u, 1u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 v5 = v11.FindContainer("image.pcx", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 this_->LoadFromFILE(v5, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 v11.CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 *v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 v8 += 280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 ++this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 ++Dest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 while ( (signed int)v8 < (signed int)&_69FBB4_ptr_iterator_end );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 v11.FreeSubIndexAndIO();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (WindowType)(WINDOW_Chest|WINDOW_Credits|0x2), 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 pGUIWindow_CurrentMenu->CreateButton(21u, 198u, 0xBFu, 0x12u, 1, 0, 0xA5u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 pGUIWindow_CurrentMenu->CreateButton(21u, 218u, 0xBFu, 0x12u, 1, 0, 0xA5u, 1u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 pGUIWindow_CurrentMenu->CreateButton(21u, 238u, 0xBFu, 0x12u, 1, 0, 0xA5u, 2u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 pGUIWindow_CurrentMenu->CreateButton(21u, 258u, 0xBFu, 0x12u, 1, 0, 0xA5u, 3u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 pGUIWindow_CurrentMenu->CreateButton(21u, 278u, 0xBFu, 0x12u, 1, 0, 0xA5u, 4u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 pGUIWindow_CurrentMenu->CreateButton(21u, 298u, 0xBFu, 0x12u, 1, 0, 0xA5u, 5u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 pGUIWindow_CurrentMenu->CreateButton(21u, 318u, 0xBFu, 0x12u, 1, 0, 0xA5u, 6u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 ptr_69BD64 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 0xF1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 0x69u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 0x28u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 0xA4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 (Texture *)(uTextureID_LS_ != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_LS_] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 ptr_69BD60 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 0x15Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 0x69u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 0x28u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 0xA6u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 (Texture *)(uTextureID_x_d != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_d] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 ptr_69BD5C = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 0xD7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 0xC7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 0xA2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 (Texture *)(uTextureID_AR_UP_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_UP_DN] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 v7 = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 0xD7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 0x143u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 0x11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 0xA3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 0x22u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 (Texture *)(uTextureID_AR_DN_DN != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_AR_DN_DN] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 v12 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 ptr_69BD58 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 // 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
11789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 //----- (0045EE8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 void __fastcall LoadGame(unsigned int uSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 char v2; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 signed int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 signed int v4; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 char *v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 unsigned int v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 char *v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 FILE *v9; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 FILE *v10; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 FILE *v11; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 FILE *v12; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 FILE *v13; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 FILE *v14; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 unsigned int v15; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 Player *v16; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 int *v17; // esi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 int v18; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 int v19; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 int v20; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 int v21; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 int v22; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 bool v23; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 AudioPlayer *v24; // ebx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 bool v25; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 bool v26; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 signed int v27; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 RGBTexture *v28; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 std::string v29; // [sp-18h] [bp-108h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 int v30; // [sp-Ch] [bp-FCh]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 int v31; // [sp-8h] [bp-F8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 signed int v32; // [sp-4h] [bp-F4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 char DstBuf; // [sp+Ch] [bp-E4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 char pContainer; // [sp+20h] [bp-D0h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 char Str[123]; // [sp+70h] [bp-80h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 char a3[5]; // [sp+EBh] [bp-5h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 v1 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 v2 = pSavegameUsedSlots[uSlot] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 dword_5B65C8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 v24 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 *(int *)&a3[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 v32 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 v31 = *(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", *(int *)&a3[1], v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 while ( v3 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 ++*(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 while ( *(int *)&a3[1] < 5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 *(int *)&a3[1] = (int)(char *)&pParty + 2508;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 if ( byte_4ED498 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 v5 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 while ( *(int *)v5 != 2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)(*(int *)&a3[1] + 6432))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 + 4998 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 v5 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 if ( v4 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 pSoundList->_4A9DCD(v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 v8 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 while ( *(int *)v8 != 2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)(*(int *)&a3[1] + 6432))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 + 4999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 v8 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 if ( (signed int)v7 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 pSoundList->_4A9DCD(v7, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 *(int *)&a3[1] += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 while ( *(int *)&a3[1] < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 sprintfex(pTmpBuf, "saves\\%s", pSavegameList->pSavesNames[v1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 if ( !CopyFileA(pTmpBuf, "data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 pNew_LOD->LoadFile("data\\new.lod", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 v9 = pNew_LOD->FindContainer("header.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 fread(&DstBuf, 0x64u, 1u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:549", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 v10 = pNew_LOD->FindContainer("party.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 fread(&pParty, 0x16238u, 1u, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 101);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:559", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 v11 = pNew_LOD->FindContainer("Timer.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 fread(&pEventTimer, 0x28u, 1u, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:569", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 v12 = pNew_LOD->FindContainer("overlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 fread(&pOtherOverlayList, 0x3F0u, 1u, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 103);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:579", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v13 = pNew_LOD->FindContainer("npcdata.bin", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 fread(pNPCStats->pNewNPCData, 0x94BCu, 1u, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 pNPCStats->_476C60();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:590", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 v14 = pNew_LOD->FindContainer("npcgroup.bin", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 fread(pNPCStats->pGroups_copy, 0x66u, 1u, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 105);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:600", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 v16 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 if ( v16->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 if ( (signed int)v16 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 uActiveCharacter = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 v17 = (int *)&pParty->pPlayers[0].uQuickSpell;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 v18 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 if ( *(char *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 stru_AA1058[v19]._494836(*(char *)v17, v18 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 *(int *)&a3[1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 v20 = (int)((char *)v17 - 263);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 if ( *(int *)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 v21 = *(int *)((char *)&v17[9 * *(int *)v20 - 1559] - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 if ( pItemsTable->pItems[v21].uEquipType == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 ++*(int *)&a3[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 v20 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 if ( *(int *)&a3[1] > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 v32 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 v31 = *((int *)&pSpellDatas[66].field_8 + v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 stru_A750F8[v19]._494836(v31, v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 v17 += 1743;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 while ( v18 - 9 < 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 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
12016 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 LOBYTE(v23) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 if ( pParty->uAlignment == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 v22 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 SetUserInterface(v22, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 pEventTimer->StopGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 v24 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 v25 = pGames_LOD->DoesContainerExist((const char *)&pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 v32 = (signed int)&pContainer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 sprintfex(pTmpBuf, "levels\\%s", &pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 v26 = _access(pTmpBuf, 4) != -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 if ( !v25 && !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 v32 = (signed int)&pContainer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 sprintfex(pTmpBuf, "Unable to find: %s!", &pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 Abortf(pTmpBuf, v30, v31, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 strcpy(pCurrentMapName, &pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 LOWORD(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 | 0x2001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 if ( (signed int)uNumSavegameFiles > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 v28 = pSavegameThumbnails;
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 v28->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 while ( v27 < (signed int)uNumSavegameFiles );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 v32 = (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 v24->SetMusicVolume(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 v32 = (signed __int64)(pSoundVolumeLevels[(char)uSoundVolumeMultiplier] * 128.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 v24->SetMasterVolume(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 pParty->sRotationY = uTurnSpeed * pParty->sRotationY / (signed int)uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 bFlashQuestBook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 // 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
12069 // 4ED498: using guessed type char byte_4ED498;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 // 50794A: using guessed type char bFlashQuestBook;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 // 5B65C8: using guessed type int dword_5B65C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 //----- (0045F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 int __fastcall SaveGame(int a1, __int16 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 void *v3; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 const char *v7; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 FILE *v8; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 int v9; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 void *v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 void *v11; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 void *v12; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 void *v13; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 void *v14; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 void *v15; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 void *v16; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 int v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 unsigned int v18; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 unsigned int v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 char *v20; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 void *v21; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 void *v22; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 BSPModel *v23; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 signed int v24; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 unsigned __int8 v25; // zf@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 unsigned __int8 v26; // sf@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 signed int v27; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 void *v28; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 void *v29; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 void *v30; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 void *v31; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 int v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 int v33; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 DWORD v34; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 std::string v35; // [sp-18h] [bp-288h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 const char *v36; // [sp-10h] [bp-280h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 const char *v37; // [sp-Ch] [bp-27Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 const char *v38; // [sp-8h] [bp-278h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 int v39; // [sp-4h] [bp-274h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 CHAR Buffer; // [sp+Ch] [bp-264h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 char Dir; // [sp+8Ch] [bp-1E4h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 char Drive; // [sp+ACh] [bp-1C4h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 int v43; // [sp+CCh] [bp-1A4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 char Dest[20]; // [sp+E0h] [bp-190h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 unsigned __int64 v45; // [sp+F4h] [bp-17Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 char Filename; // [sp+130h] [bp-140h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 char Ext; // [sp+150h] [bp-120h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 char v48; // [sp+151h] [bp-11Fh]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 char Source[32]; // [sp+170h] [bp-100h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 char Str[120]; // [sp+190h] [bp-E0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 int v51; // [sp+208h] [bp-68h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 int v52; // [sp+20Ch] [bp-64h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 int v53; // [sp+210h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 int v54; // [sp+214h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 int Src; // [sp+218h] [bp-58h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 char v56; // [sp+21Ch] [bp-54h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 char v57; // [sp+21Dh] [bp-53h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 char v58; // [sp+21Eh] [bp-52h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 char v59; // [sp+21Fh] [bp-51h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 int v60; // [sp+220h] [bp-50h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 int v61; // [sp+224h] [bp-4Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 int v62; // [sp+228h] [bp-48h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 LOD::Directory pDir; // [sp+22Ch] [bp-44h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 std::string *v64; // [sp+24Ch] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 size_t Size; // [sp+250h] [bp-20h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 __int16 *v66; // [sp+254h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 void *DstBuf; // [sp+258h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 __int16 *v68; // [sp+25Ch] [bp-14h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 unsigned int v69; // [sp+260h] [bp-10h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 int v70; // [sp+264h] [bp-Ch]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 std::string *v71; // [sp+268h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 int a3; // [sp+26Fh] [bp-1h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 v66 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 v64 = (std::string *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 strcpy(byte_6BE3B0, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 result = _strcmpi(pCurrentMapName, "d05.blv");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 DstBuf = operator new(0xF4240u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 pDir.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 v52 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 v51 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 v62 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 v53 = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 v54 = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 pParty->vPosition.x = pParty->vPrevPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 pParty->vPosition.z = pParty->vPrevPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 pParty->vPosition.y = pParty->vPrevPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 pParty->uFallStartY = pParty->vPrevPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 pParty->sRotationY = pParty->sPrevRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 pParty->sRotationX = pParty->sPrevRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 pIndoor->uLastVisitDay = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 pOutdoor->uLastVisitDay = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 v3 = MakeScreenshot(150, 112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 strcpy((char *)&pDir, "image.pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 pRenderer->_49F5A2((int)v3, 150, 112, DstBuf, 1000000, (int)&pDir.uDataSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 free(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 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
12177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 0x12u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 0x8Du,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 (Texture *)(uTextureID_save_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_save_up] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 v36 = pGlobalTXT_LocalizationStrings[190];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 v4 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[190]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v4 + 25, 219, 0, v36, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 v37 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 v5 = pFontSmallnum->AlignText_Center(0xBAu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v5 + 25, 0x103u, 0, v37, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 v36 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 v6 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v6 + 25, 299, 0, v36, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 if ( pNew_LOD->Write(&pDir, DstBuf, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:773", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 strcpy(Dest, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 v45 = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 strcpy((char *)&pDir, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 pDir.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 if ( pNew_LOD->Write(&pDir, &v43, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 v39 = 201;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 201);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:784", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 strcpy((char *)&pDir, "party.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 pDir.uDataSize = 90680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 if ( pNew_LOD->Write(&pDir, &pParty, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 v39 = 202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 202);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:793", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 strcpy((char *)&pDir, "Timer.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 pDir.uDataSize = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 if ( pNew_LOD->Write(&pDir, &pEventTimer, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 v39 = 203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 203);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:802", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 strcpy((char *)&pDir, "overlay.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 pDir.uDataSize = 1008;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 if ( pNew_LOD->Write(&pDir, &pOtherOverlayList, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 v39 = 204;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:811", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 strcpy((char *)&pDir, "npcdata.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 pDir.uDataSize = 38076;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 if ( pNew_LOD->Write(&pDir, pNPCStats->pNewNPCData, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 v39 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 205);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:820", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 strcpy((char *)&pDir, "npcgroup.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 pDir.uDataSize = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 if ( pNew_LOD->Write(&pDir, pNPCStats->pGroups_copy, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 v39 = 206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 206);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:829", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 v70 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 v69 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v39 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 v38 = (const char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 sprintfex(Str, "data\\lloyd%d%d.pcx", v70, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 v8 = fopen(Str, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 v39 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 v38 = (const char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 sprintfex(Str, "lloyd%d%d.pcx", v70, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 fseek(v8, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 pDir.uDataSize = ftell(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 rewind(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 fread(DstBuf, pDir.uDataSize, 1u, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 strcpy((char *)&pDir, Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 fclose(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 remove(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 if ( pNew_LOD->Write(&pDir, DstBuf, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v39 = 207;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 207);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:857", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 Size = 5080748;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 while ( (signed int)v69 <= 5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 while ( v70 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 if ( !v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 sub_42FA22_mess_with_laying_item_list();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 v9 = (int)malloc(0xF4240u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 v71 = (std::string *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 Src = 91969;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 v56 = 109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 v57 = 118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 v58 = 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 v59 = 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 memcpy((void *)v9, &Src, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 v10 = DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 pIndoor->dlv.uNumFacesInBModels = pIndoor->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 pIndoor->dlv.uNumBModels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 pIndoor->dlv.uNumDecorations = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 memcpy(DstBuf, &pIndoor->dlv, 0x28u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 v10 = (char *)v10 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 memcpy(v10, pIndoor->_visible_outlines, 0x36Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 v11 = (char *)v10 + 875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 if ( (signed int)pIndoor->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 v38 = (char *)v68 + (unsigned int)pIndoor->pFaces + 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 memcpy(v11, v38, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 v68 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 v11 = (char *)v11 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 while ( v70 < (signed int)pIndoor->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 v68 = &pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 memcpy(v11, v68, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 v68 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 v11 = (char *)v11 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 while ( v70 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 memcpy(v11, &uNumActors, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 v12 = (char *)v11 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 memcpy(v12, pActors, 836 * uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 v13 = (char *)v12 + 836 * uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 memcpy(v13, &uNumLayingItems, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 v13 = (char *)v13 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 memcpy(v13, pLayingItems, 112 * uNumLayingItems);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 v14 = (char *)v13 + 112 * uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 memcpy(v14, &uNumChests, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 v14 = (char *)v14 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 memcpy(v14, pChests, 5324 * uNumChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 v15 = (char *)v14 + 5324 * uNumChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 memcpy(v15, pIndoor->pDoors, 0x3E80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 v15 = (char *)v15 + 16000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 memcpy(v15, pIndoor->ptr_0002B4_doors_ddata, pIndoor->blv.uDoors_ddata_Size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 v16 = (char *)v15 + pIndoor->blv.uDoors_ddata_Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 memcpy(v16, &stru_5E4C90, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 v17 = (int)((char *)v16 + 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 memcpy((void *)v17, &pIndoor->uLastVisitDay, 0x38u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 pOutdoor->ddm.uNumFacesInBModels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 v19 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 v20 = (char *)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 v18 += *(int *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 v20 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 pOutdoor->ddm.uNumFacesInBModels = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 while ( v19 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v21 = DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 pOutdoor->ddm.uNumBModels = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 pOutdoor->ddm.uNumDecorations = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 memcpy(DstBuf, &pOutdoor->ddm, 0x28u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 v21 = (char *)v21 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 memcpy(v21, pOutdoor->array_528, 0x3C8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 v21 = (char *)v21 + 968;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 memcpy(v21, pOutdoor->array_8F0, 0x3C8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 v22 = (char *)v21 + 968;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 v23 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 v24 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 v25 = *(int *)&v23->pModelName[v24] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 v26 = *(int *)&v23->pModelName[v24] < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 if ( !(v26 | v25) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 v38 = (char *)v68 + *(int *)&v23->pModelName[v24 + 8] + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 memcpy(v22, v38, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 v23 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 v68 += 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 v22 = (char *)v22 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 v66 = (__int16 *)((char *)v66 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 while ( (signed int)v66 < *(int *)&pOutdoor->pBModels->pModelName[v24] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 ++v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 v24 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 while ( v70 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 v66 = &pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 memcpy(v22, v66, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 v66 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 v22 = (char *)v22 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 while ( v27 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 memcpy(v22, &uNumActors, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 v28 = (char *)v22 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 memcpy(v28, pActors, 836 * uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 v29 = (char *)v28 + 836 * uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 memcpy(v29, &uNumLayingItems, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 v29 = (char *)v29 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 memcpy(v29, pLayingItems, 112 * uNumLayingItems);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 v30 = (char *)v29 + 112 * uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 memcpy(v30, &uNumChests, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 v30 = (char *)v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 memcpy(v30, pChests, 5324 * uNumChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 v31 = (char *)v30 + 5324 * uNumChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 memcpy(v31, &stru_5E4C90, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 v17 = (int)((char *)v31 + 200);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 memcpy((void *)v17, &pOutdoor->uLastVisitDay, 0x38u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 v9 = (int)v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 v32 = v17 + 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 strcpy(Source, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 _splitpath(Source, &Drive, &Dir, &Filename, &Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 v48 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 Size = v32 - (int)DstBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 v69 = 999984;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 LOBYTE(v33) = zlib::MemZip((char *)v9 + 16, (unsigned int *)&v69, DstBuf, v32 - (int)DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 if ( v33 || (signed int)v69 > (signed int)Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 memcpy((void *)(v9 + 16), DstBuf, Size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 v69 = Size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 v69 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 memcpy((void *)(v9 + 8), &v69, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 memcpy((void *)(v9 + 12), &Size, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 sprintfex(Source, "%s%s", &Filename, &Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 strcpy((char *)&pDir, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 pDir.uDataSize = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 if ( pNew_LOD->Write(&pDir, (const void *)v9, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 v39 = 208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 208);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:1071", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 free((void *)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 free(DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 if ( v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 if ( !CopyFileA("data\\new.lod", "saves\\autosave.mm7", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 v34 = GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 FormatMessageA(0x1000u, 0, v34, 0x400u, &Buffer, 0x80u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 v39 = 300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 sprintfex(Str, pGlobalTXT_LocalizationStrings[612], 300);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 MessageBoxA(nullptr, Str, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\LoadSave.cpp:1097", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 pParty->vPosition.x = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 pParty->vPosition.z = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 pParty->vPosition.y = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 pParty->uFallStartY = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 pParty->sRotationY = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 result = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 pParty->sRotationX = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 // 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
12497
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 //----- (00460078) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 void __fastcall DoSavegame(unsigned int uSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 int v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 RGBTexture *v3; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 int bNotArena; // [sp+2Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 unsigned int v6; // [sp+30h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 v1 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 v6 = uSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 bNotArena = _strcmpi(pCurrentMapName, "d05.blv");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 if ( bNotArena )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 LOD::Directory pDir; // [sp+Ch] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 SaveGame(0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 v2 = 100 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 strcpy(&pSavegameHeader->pLocationName[v2], pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 *(int *)((char *)&pSavegameHeader->uWordTime + v2) = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 *(int *)((char *)&pSavegameHeader->uWordTime + v2 + 4) = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 strcpy((char *)&pDir, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 pDir.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 pNew_LOD->Write(&pDir, (char *)&pSavegameHeader + v2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 sprintfex(pTmpBuf, "saves\\save%03d.mm7", v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 CopyFileA("data\\new.lod", pTmpBuf, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 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
12528 v3 = pSavegameThumbnails;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 v3->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 while ( (signed int)v3 < (signed int)&unk_6A0758 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 if ( bNotArena )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 pNew_LOD->_4621A7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 ShowStatusBarString(pGlobalTXT_LocalizationStrings[583], 2u);// "No saving in the Arena"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 pIcons_LOD->_4355F7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 ShowStatusBarString(pGlobalTXT_LocalizationStrings[656], 2u);// "Game Saved!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 // 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
12546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 //----- (004601B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 void __fastcall sub_4601B7(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 unsigned __int16 v1; // bx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 unsigned int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 unsigned int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 unsigned int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 unsigned int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 unsigned int v7; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 signed __int64 v8; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 unsigned int v9; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 unsigned __int64 v10; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 __int64 v11; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 char v12; // di@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 unsigned __int64 v13; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 unsigned int v14; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 __int64 v15; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 int v16; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 signed int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 const char *v18; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 int v19; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 const char *v20; // ST18_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 const char *v22; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 int v23; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 const char *v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 int v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 GUIWindow Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 /*unsigned int Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 unsigned int v27; // [sp+10h] [bp-74h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 int v28; // [sp+14h] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 int v29; // [sp+18h] [bp-6Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 unsigned int v30; // [sp+1Ch] [bp-68h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 unsigned int v31; // [sp+20h] [bp-64h]@8*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 __int64 v32; // [sp+60h] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 int v33; // [sp+68h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 unsigned int v34; // [sp+70h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 __int64 v35; // [sp+74h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 int v36; // [sp+7Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 int a4; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 a4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 (Texture *)(uTextureID_loadsave != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 v2 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 v3 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 v2 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 v3 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 pRenderer->DrawTextureIndexed(0x12u, 0x8Bu, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 0x15Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 memset(&Dst, 0, 0x54u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 Dst.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 v4 = pGUIWindow_CurrentMenu->uFrameY - LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 Dst.uFrameWidth = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 v4 += 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 Dst.uFrameY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 v5 = LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 Dst.uFrameZ = Dst.uFrameX + 219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 Dst.uFrameHeight = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 Dst.uFrameW = v5 + v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 v6 = uLoadGameUI_SelectedSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 if ( *((int *)&pSavegameThumbnails->pPixels + 10 * uLoadGameUI_SelectedSlot) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 pRenderer->DrawTextureRGB(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 pGUIWindow_CurrentMenu->uFrameX + 276,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 pGUIWindow_CurrentMenu->uFrameY + 171,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 pSavegameThumbnails + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 v6 = uLoadGameUI_SelectedSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 v7 = pMapStats->GetMapInfo(&pSavegameHeader->pLocationName[100 * v6]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[v7].pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 v8 = (signed __int64)((double)*(signed __int64 *)((char *)&pSavegameHeader->uWordTime + 100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 * uLoadGameUI_SelectedSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 * 0.234375)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 HIDWORD(v32) = (unsigned __int64)((signed __int64)((double)*(signed __int64 *)((char *)&pSavegameHeader->uWordTime
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 + 100 * uLoadGameUI_SelectedSlot)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 * 0.234375)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 / 60) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 v8 /= 60i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 v10 = (unsigned int)v8 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 v34 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 v11 = (unsigned int)(v10 / 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 LODWORD(v13) = (unsigned int)v11 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 HIDWORD(v13) = HIDWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 v33 = v13 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 v36 = v13 / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 v15 = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 v14 = (unsigned __int64)(v35 % 24) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 LODWORD(v35) = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 HIDWORD(v15) = v34 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 v36 += 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 v16 = v12 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 Dst.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 HIDWORD(v35) = (v14 & 0x80000000u) == 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 && ((signed int)v14 > 0 || (unsigned int)v15 >= 0xC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 && (signed int)v14 <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 0x18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 0xC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 if ( !(v14 | (unsigned int)v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 v17 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 LODWORD(v15) = v15 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 "%s %d:%02d%s\n%d %s %d",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 aDayNames[HIDWORD(v15) % 7],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 aAMPMNames[HIDWORD(v35)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 7 * v16 + HIDWORD(v15) % 7 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 aMonthNames[v33],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 if ( GetCurrentMenuID() == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 v18 = pGlobalTXT_LocalizationStrings[135];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 v19 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[135]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, v18, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 v20 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 v21 = pFontSmallnum->AlignText_Center(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 0xBAu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106u, 0, v20, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 v22 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 v23 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, v22, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v34 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 v34 = uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 a4 = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 v36 = dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 v24 = (const char *)(&pSavegameHeader + dword_6A0C9C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 if ( v36 >= (signed int)v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 HIDWORD(v35) = v36 == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 0x64u) : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 if ( pGUIWindow_CurrentMenu->field_40 != 1 || v36 != uLoadGameUI_SelectedSlot )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1Bu, a4, HIDWORD(v35), v24, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 0x1Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 a4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 HIDWORD(v35),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 (const char *)pKeyActionMap->pPressedKeysBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 175,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 a4 += 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 v24 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 while ( a4 < 346 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 // 6A0C9C: using guessed type int dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 //----- (004606F7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 void __cdecl sub_4606F7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 sub_4601B7(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 //----- (004606FE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 void __cdecl sub_4606FE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 sub_4601B7(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 //----- (00460706) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 void __cdecl TryLoadLevelFromLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 FILE *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 FILE *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 __int32 v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 char Ext[256]; // [sp+4h] [bp-40Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 char Dir; // [sp+104h] [bp-30Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 char Filename[256]; // [sp+204h] [bp-20Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 char a1[260]; // [sp+304h] [bp-10Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 char Drive; // [sp+408h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 int DstBuf; // [sp+40Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 strcpy(a1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 _splitpath(a1, &Drive, &Dir, Filename, Ext);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 sprintfex(a1, "levels\\%s%s", Filename, ".lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 v0 = fopen(a1, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 fseek(v0, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 v2 = ftell(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 rewind(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 ptr_6A0D08 = pAllocator->AllocNamedChunk(ptr_6A0D08, v2, "LevelLod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 fread(ptr_6A0D08, v2, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 fseek(v1, v2 - 6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 DstBuf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 fread(&DstBuf, 4u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 fread(&_6A0D10_txt_lod_loading__unused, 2u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 _6A0D0C_txt_lod_loading = (int)((char *)ptr_6A0D08 + DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 fclose(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 // 6A0D0C: using guessed type int 6A0D0C_txt_lod_loading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 // 6A0D10: using guessed type int 6A0D10_txt_lod_loading__unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 //----- (0046080D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 void __cdecl sub_46080D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 // 6A0D0C: using guessed type int 6A0D0C_txt_lod_loading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 //----- (0046082C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 bool Initialize_GamesLOD_NewLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 pGames_LOD->AllocSubIndicesAndIO(0x12Cu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 if (pGames_LOD->LoadFile("data\\games.lod", 1))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 pNew_LOD->AllocSubIndicesAndIO(0x12Cu, 0x186A0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 //----- (0046086A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 int __cdecl MaybeDoAutosave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 int v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 int v2; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 FILE *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 unsigned int v9; // [sp+16Ch] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 void *pSave; // [sp+170h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 unsigned int v11; // [sp+174h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 pSave = pAllocator->AllocNamedChunk(0, 0xF4240u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 remove("data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 this_.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 strcpy(this_.array_000004, "MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 strcpy(this_.array_000054, "newmaps for MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 this_.dword_0000A4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 this_.dword_0000A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 a3.dword_000018 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 a3.word_00001E = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 strcpy((char *)&a3, "current");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 pNew_LOD->_461492(&this_, &a3, "data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 if ( pNew_LOD->LoadFile("data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 pNew_LOD->CreateTempFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 pNew_LOD->uNumSubIndices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 pDir.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 v1 = (signed int)pGames_LOD->uNumSubIndices / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 if ( (signed int)pGames_LOD->uNumSubIndices / 2 < (signed int)pGames_LOD->uNumSubIndices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 v2 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 v11 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 v9 = pGames_LOD->uNumSubIndices - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 memcpy(&pDir, (char *)pGames_LOD->pSubIndices + v2, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 v3 = pGames_LOD->FindContainer((const char *)pGames_LOD->pSubIndices + v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 fread(pSave, pGames_LOD->pSubIndices[v11 / 0x20].uDataSize, 1u, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 pNew_LOD->AppendDirectory(&pDir, pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 v11 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 v2 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 v7.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 strcpy(pSavegameHeader->pLocationName, "out01.odm");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 strcpy((char *)&v7, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 v7.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 pNew_LOD->AppendDirectory(&v7, &pSavegameHeader);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 pNew_LOD->Save();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 pParty->vPrevPosition.y = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 pParty->vPrevPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 pParty->vPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 pParty->vPosition.y = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 pParty->uFallStartY = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 pParty->sPrevRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 pParty->sRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 pParty->vPrevPosition.z = 1816;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 pParty->vPosition.z = 1816;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 pParty->sPrevRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 SaveGame(1, (__int16 *)1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 pAllocator->FreeChunk(pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 //----- (00460A78) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 void __thiscall PrepareToLoadBLV(unsigned int bLoading)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 unsigned int v2; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 MapInfo *v3; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 int v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 int v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 SpawnPointMM7 *v8; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 char v9; // bl@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 int v10; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 char *v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 int v12; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 unsigned int v13; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 char *v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 __int16 v15; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 int v16; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 DecorationDesc *v17; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 int *v19; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 char v20; // dl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 int v21; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 char v22; // cl@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 signed int v23; // ebx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 char *v24; // esi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 int v25; // eax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 char *v26; // esi@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 int v27; // eax@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 char v28; // zf@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 __int16 v29; // ax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 signed int v30; // edi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 int v31; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 char Args; // [sp+350h] [bp-C4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 int v34[4]; // [sp+3E8h] [bp-2Ch]@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 int v35; // [sp+3F8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 char b[4]; // [sp+3FCh] [bp-18h]@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 MapInfo *v37; // [sp+400h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 int v38; // [sp+404h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 unsigned int v39; // [sp+408h] [bp-Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 int pDest; // [sp+40Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 int i; // [sp+410h] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 v37 = (MapInfo *)bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 pGameLoadingUI_ProgressBar->Reset(0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 bNoNPCHiring = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 pDest = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 uCurrentlyLoadedLevelType = (LEVEL_TYPE)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 if ( Is_out15odm_underwater() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d23.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 bNoNPCHiring = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 pPaletteManager->field_267AD3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 pPaletteManager->field_267AD4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 pPaletteManager->field_267AD5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 v39 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 v3 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 v1 = v3->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 v38 = GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 v3 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 dword_6BE13C_uCurrentlyLoadedLocationID = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 TryLoadLevelFromLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 uNumStationaryLightsApplied = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 v4 = pIndoor->Load(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 pCurrentMapName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 (char *)&pDest)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 sprintfex(&Args, "Unable to open %s", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 sprintfex(&Args, "File %s is not a BLV File", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 v6 = v5 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 Abortf("Attempt to open new level before clearing old");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 if ( v6 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 Abortf("Out of memory loading indoor level");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 if ( !v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 pDest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 if ( pDest == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 for ( i = 0; i < (signed int)pIndoor->uNumSpawnPoints; ++v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 v8 = &pIndoor->pSpawnPoints[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 if ( pIndoor->pSpawnPoints[v7].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 SpawnEncounter(v3, v8, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 v3->SpawnRandomTreasure(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 pSoundList->_4A9A67(pDoorSoundIDsByLocationID[v39], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 pSoundList->_4A9A67(pDoorSoundIDsByLocationID[v39] + 1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 if ( pIndoor->uNumDoors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 if ( pIndoor->pDoors[v10].uAttributes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 pIndoor->pDoors[v10].uState = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 pIndoor->pDoors[v10].uTimeSinceTriggered = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 pIndoor->pDoors[v10].uAttributes = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 v11 = (char *)&pIndoor->pDoors[v10].uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 if ( !*(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 if ( *(short *)v11 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 *(short *)v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 if ( i >= pIndoor->uNumDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 *(short *)v11 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 pIndoor->pDoors[v10].uTimeSinceTriggered = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 pIndoor->pDoors[v10].uAttributes = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 if ( (signed int)pIndoor->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 if ( pIndoor->pFaces[v12].uBitmapID != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 HIWORD(pBitmaps_LOD->pTextures[pIndoor->pFaces[v12].uBitmapID].palette) = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pIndoor->pFaces[v12].uBitmapID].palette);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 while ( i < (signed int)pIndoor->uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 v14 = (char *)&pLevelDecorations[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 pDecorationList->InitializeDecorationSprite(*((short *)v14 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 v15 = pDecorationList->pDecorations[*((short *)v14 - 4)].uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 if ( v15 != (short)v13 && _6807E0_num_decorations_6807B8 < 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 pSoundList->_4A9A67(v15, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 v16 = _6807E0_num_decorations_6807B8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 _6807B8_level_decorations_ids[v16] = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 if ( !(*(v14 - 6) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 v17 = &pDecorationList->pDecorations[*((short *)v14 - 4)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 if ( !((unsigned __int8)v9 & v17->uFlags) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 v18 = v17->uLightRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 if ( v18 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 if ( pRenderer->pRenderD3D == (RenderD3D *)v13 || pRenderer->bUseColoredLights == v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 v20 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 v19 = (int *)255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 *(int *)b = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 v19 = (int *)v17->uColoredLightRed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 v20 = v17->uColoredLightGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 *(int *)b = v17->uColoredLightBlue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 pStationaryLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 *((int *)v14 - 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 *(int *)v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 *((short *)v14 + 2) + v17->uDecorationHeight / 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 v18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 b[0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 byte_4E94D0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 if ( *((short *)v14 + 7) == (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 if ( ((LevelDecoration *)(v14 - 8))->IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 if ( v35 < 124 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 v21 = v35 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 *((short *)v14 + 10) = v35 + 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 v22 = stru_5E4C90.field_0[v21 + 74];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 v35 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 *(v14 - 6) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 v14 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 while ( i < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 if ( (signed int)uNumLayingItems > (signed int)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 v24 = (char *)&pLayingItems[0].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 if ( *((short *)v24 - 17) != (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 v25 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 if ( *(int *)v24 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 if ( v25 != 220 && pItemsTable->pItems[v25].uEquipType == 14 && *((int *)v24 + 1) == v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 *((int *)v24 + 1) = rand() % 15 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 pItemsTable->SetSpecialBonus((ItemGen *)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 v24 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 while ( v23 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 i = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 if ( (signed int)uNumActors > (signed int)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 v26 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 v27 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 if ( v27 & 0x100000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 if ( !v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 v28 = v38 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 v28 = v38 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 ((Actor *)(v26 - 36))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 v29 = *((short *)v26 + 70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 v26[25] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 if ( v29 != 11 && v29 != 19 && (!*((short *)v26 + 2) || !*((int *)v26 + 18)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 *((short *)v26 + 70) = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 ((Actor *)(v26 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 *((short *)v26 + 70) = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 *(int *)v26 = v27 | 0x10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 v26 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 while ( i < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 Actor this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 this_.pMonsterInfo.uID = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 this_.PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 pParty->sRotationY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 pParty->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 pParty->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 pParty->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 pParty->uFallStartY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 v31 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 if ( pPlayers[v31]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 v34[v30++] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 while ( v31 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 if ( v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 if ( pDest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 qword_A750D8 = 256i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 word_A750E0 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 word_A750E2 = LOWORD(v34[rand() % v30]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 // 4E94D0: using guessed type char byte_4E94D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 // 519AB4: using guessed type int uNumStationaryLightsApplied;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 // 6807E0: using guessed type int _6807E0_num_decorations_6807B8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 // 6A0D0C: using guessed type int 6A0D0C_txt_lod_loading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 // 6BE13C: using guessed type int dword_6BE13C_uCurrentlyLoadedLocationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 // A750D8: using guessed type __int64 qword_A750D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 // A750E0: using guessed type __int16 word_A750E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 // A750E2: using guessed type __int16 word_A750E2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 // 460A78: using guessed type int var_2C[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 //----- (004610AA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 OutdoorCamera *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 v2 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 pGameLoadingUI_ProgressBar->Reset(0x1Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 ODM_LoadAndInitialize(pCurrentMapName, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 //----- (00461103) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 void __cdecl sub_461103()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 GUIProgressBar *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 __int16 v3; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 int v4; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 size_t v5; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 signed int v6; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 char *v7; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 signed int v8; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 int v9; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 MonsterInfo *v10; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 int *v11; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 int v13; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 __int16 v14; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 signed int v15; // [sp+10h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 signed int v16; // [sp+10h] [bp-4Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 signed int v17; // [sp+14h] [bp-48h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 signed int v18; // [sp+14h] [bp-48h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 int v19; // [sp+18h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 signed int v20; // [sp+18h] [bp-44h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 int v21[16]; // [sp+1Ch] [bp-40h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 sub_450218_prolly_generate_chests_loot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 v0 = pGameLoadingUI_ProgressBar;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 pParty->field_7B5_in_arena_quest = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 dword_5C6DF8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 pNPCStats->field_17FC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 v19 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 v2 = (char *)&pActors[0].uNPC_ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 v3 = *((short *)v2 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 v17 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 if ( v3 >= 115 && v3 <= 186 || v3 >= 232 && v3 <= 249 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 v4 = (v3 - 1) % 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 if ( 2 == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 if ( *(short *)v2 && *(short *)v2 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 if ( v4 != 0 || *(short *)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 if ( *(short *)v2 > 0 && *(short *)v2 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->array_13EF4[pNPCStats->field_17FC0], v3, 0, v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 v14 = LOWORD(pNPCStats->field_17FC0) + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 ++pNPCStats->field_17FC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 *(short *)v2 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 *(short *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 while ( v15 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 v5 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 v16 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 if ( (signed int)uNumActors > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 v7 = (char *)&pActors[0].pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 if ( v6 > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 if ( v21[v8] == *((short *)v7 + 26) - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 while ( v8 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 if ( v8 == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 v21[v6++] = *((short *)v7 + 26) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 v20 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 if ( v6 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 v7 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 while ( v16 < (signed int)v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 if ( v6 > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 v9 = v21[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 v18 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 v10 = &pMonsterStats->pInfos[v9 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 v11 = (int *)pMonsterList->pMonsters[v9].pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 pSoundList->_4A9A67(*(short *)v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 v11 = (int *)((char *)v11 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v10->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 while ( v1 < v20 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 v0 = pGameLoadingUI_ProgressBar;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 v0->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 if ( dword_6BE368_debug_settings_2 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 uNumActors = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 if ( dword_6BE368_debug_settings_2 & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 uNumLevelDecorations = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 sub_4613C4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 v0->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 pIndoorCamera->pos.y = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 pIndoorCamera->pos.x = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 pIndoorCamera->pos.z = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 pIndoorCamera->sRotationY = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 pIndoorCamera->sRotationX = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 uLevel_StartingPointType = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 pSprites_LOD->_461397();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 pPaletteManager->LockTestAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 if ( pParty->pPickedItem.uItemID != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 // 6BE368: using guessed type int dword_6BE368_debug_settings_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 // 461103: using guessed type int var_40[16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 //----- (004613C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 int __cdecl sub_4613C4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 unsigned __int16 v0; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 size_t v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 LevelDecoration *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 _6836C8_num_decorations_6807E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 v0 = pDecorationList->GetDecorIdByName("Event Trigger");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 v1 = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 v2 = (signed __int16)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 v4 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 if ( v4->uDecorationDescID == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 v5 = _6836C8_num_decorations_6807E8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 _6807E8_level_decorations_ids[v5] = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 while ( result < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 //----- (004621DA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 int __fastcall sub_4621DA(signed int a1, signed int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 signed int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 signed int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 signed int v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 if ( a1 < a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 a1 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 a2 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 v4 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 if ( a1 < a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 a1 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 if ( a2 < v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 v4 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 return (11 * a2 >> 5) + a1 + (v4 >> 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 //----- (0046224A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 int __cdecl sub_46224A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 _702AC4_unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 _702ACC_unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 _702AC0_unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 // 702AC0: using guessed type int 702AC0_unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 // 702AC4: using guessed type int 702AC4_unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 // 702ACC: using guessed type char 702ACC_unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 //----- (00462620) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 int __cdecl crt_init_globals_462620()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 dword_6BE364_game_settings_1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 bUseLoResSprites = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 uCurrentlyLoadedLevelType = (LEVEL_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 //----- (00462659) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 void __cdecl crt_init_globals_462659()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 fWalkSpeedMultiplier = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 fBackwardMovementSlowdownMultiplier = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 fTurnSpeedMultiplier = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 flt_6BE150_look_up_down_dangle = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 // 6BE144: using guessed type float fWalkSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 // 6BE148: using guessed type float fBackwardMovementSlowdownMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 // 6BE14C: using guessed type float fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 // 6BE150: using guessed type float flt_6BE150_look_up_down_dangle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 //----- (0046269B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 void __cdecl crt_init_globals_46269B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 //----- (0046271C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 void __cdecl crt_init_globals_46271C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 ofn.lStructSize = 0x4Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 ofn.hwndOwner = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 ofn.hInstance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 ofn.lpstrFilter = "Indoor BLV Files (*.blv)";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 ofn.lpstrCustomFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 ofn.nMaxCustFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 ofn.nFilterIndex = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 ofn.lpstrFile = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 ofn.nMaxFile = 260;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 ofn.nMaxFileTitle = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 ofn.lpstrInitialDir = "levels";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 ofn.lpstrTitle = "Might and Magic® VII - Load Which Level?";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 ofn.Flags = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 ofn.nFileOffset = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 ofn.nFileExtension = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 ofn.lpstrDefExt = "blv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 ofn.lCustData = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 ofn.lpfnHook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 ofn.lpTemplateName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 ofn.lpstrFileTitle = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 //----- (004627B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 void __cdecl MainMenu_Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 unsigned int v0; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 Texture *v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 unsigned int v2; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 Texture *v3; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 unsigned int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 Texture *v5; // ebp@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 unsigned int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 Texture *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 GUIButton *v8; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 unsigned int v9; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 int v10; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 int v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 unsigned int v12; // [sp-18h] [bp-54h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 Texture *v13; // [sp-14h] [bp-50h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 GUIButton *v14; // [sp+0h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 GUIWindow *v15; // [sp+4h] [bp-38h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 LONG uMouseX; // [sp+8h] [bp-34h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 LONG uMouseY; // [sp+Ch] [bp-30h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 POINT v18; // [sp+10h] [bp-2Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 POINT v19; // [sp+18h] [bp-24h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 MSG Msg; // [sp+20h] [bp-1Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 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
13655 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 pWindow_Credits = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Credits, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 v0 = pIcons_LOD->LoadTexture("title_new", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 pMainMenu_BtnNew = pWindow_Credits->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 0x1EFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 0xACu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 (v0 != -1 ? pIcons_LOD->pTextures[v0].uTextureWidth : 24),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 (v0 != -1 ? pIcons_LOD->pTextures[v0].uTextureHeight : 26),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 0x36u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 0x4Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 v2 = pIcons_LOD->LoadTexture("title_load", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 pMainMenu_BtnLoad = pWindow_Credits->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 0x1EFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 0xE3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 (v2 != -1 ? pIcons_LOD->pTextures[v2].uTextureWidth : 24),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 (v2 != -1 ? pIcons_LOD->pTextures[v2].uTextureHeight : 26),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 0x37u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 0x4Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 v4 = pIcons_LOD->LoadTexture("title_cred", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 pMainMenu_BtnCredits = pWindow_Credits->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 0x1EFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 0x11Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 (v4 != -1 ? pIcons_LOD->pTextures[v4].uTextureWidth : 24),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 (v4 != -1 ? pIcons_LOD->pTextures[v4].uTextureHeight : 26),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 0x38u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 0x43u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 v5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 v6 = pIcons_LOD->LoadTexture("title_exit", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 pMainMenu_BtnExit = pWindow_Credits->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 0x1EFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 0x151u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureHeight : 26),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 0x39u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 v7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 stru_506F20.Load("title.pcx", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 SetCurrentMenuID(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 SetForegroundWindow(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 SendMessageA(hWnd, 0x1Cu, 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 while ( !uCurrentMenuID || uCurrentMenuID == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 uMouseX = pMouse->GetCursorPos(&v18)->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 uMouseY = pMouse->GetCursorPos(&v19)->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 v15 = pWindow_Credits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 if ( uCurrentMenuID == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 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
13739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 stru_506F20.Load("lsave640.pcx", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Credits, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 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
13744 GameUI_DrawLoadMenu(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 v15 = pGUIWindow_CurrentMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 pRenderer->DrawTextureRGB(0, 0, &stru_506F20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 if ( uCurrentMenuID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 if ( uCurrentMenuID == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 crt_deconstruct_ptr_6A0118();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 pGUIWindow_CurrentMenu = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 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
13779 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 if ( !ptr_507BDC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 v8 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 v14 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 if ( uMouseX >= (signed int)v8->uX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 && uMouseX <= (signed int)v8->uZ
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 && uMouseY >= (signed int)v8->uY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 && uMouseY <= (signed int)v8->uW
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 && v15 == pWindow_Credits )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 v9 = v8->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 v10 = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 v11 = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 if ( v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 v13 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 v12 = 337;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 v12 = 282;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 v13 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 v12 = 227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 v13 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 v12 = 172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 pRenderer->DrawTextureIndexed(495u, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 v8 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 v14 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 v8 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 if ( pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 pWindow_Credits->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 // 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
13860 // 6BE364: using guessed type int dword_6BE364_game_settings_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 //----- (004637EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 signed int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 unsigned int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 Render *v5; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 HANDLE v6; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 Keyboard *v7; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 HDC v9; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 HDC v10; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 int v11; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 char v12; // zf@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 signed int v13; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 int v14; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 int v15; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 int v16; // eax@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 int v17; // eax@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 int v18; // eax@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 int v19; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 int v20; // eax@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 int v21; // eax@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 int v22; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 int v23; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 int v24; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 int v25; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 int v26; // eax@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 char v27; // al@174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 bool v28; // ebx@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 char v29; // dl@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 char v30; // cl@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 bool v31; // ebx@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 void *v32; // ebx@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 float v33; // ST04_4@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 float v34; // ST04_4@254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 HWND v35; // [sp+8h] [bp-64h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 UINT v36; // [sp+Ch] [bp-60h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 WPARAM v37; // [sp+10h] [bp-5Ch]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 LPARAM v38; // [sp+14h] [bp-58h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 int pXY[2]; // [sp+64h] [bp-8h]@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 int a2; // [sp+7Ch] [bp+10h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 if ( Msg > WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910 switch ( Msg )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 case WM_DEVICECHANGE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 if ( wParam == 0x8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 case WM_SIZING:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 case WM_LBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 LABEL_210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 goto LABEL_263;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 if ( uCurrentMenuID != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 goto LABEL_229;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 case WM_RBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13943 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 case WM_LBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 pArcomageGame->stru1.field_0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 case WM_RBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 if ( pAsyncMouse != v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 back_to_game();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 pArcomageGame->stru1.field_0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 case WM_LBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 if ( uCurrentMenuID != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 LABEL_229:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 sub_41CD4F(0x29u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 LABEL_230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 if ( pGame != (Game *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 if ( pAsyncMouse != (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, v28, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 UI_OnMouseLeftClick(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 case WM_RBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 if ( pAsyncMouse == (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 if ( pGame != (Game *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 if ( pAsyncMouse != (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 v33 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &stru_F93E30, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 if ( pAsyncMouse == (void *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 case WM_MBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 if ( pGame && !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 v34 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &a3, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 if ( !pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 sub_417871(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 case WM_MOUSEMOVE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 pXY[0] = (unsigned __int16)lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 pXY[1] = lParam >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 ArcomageGame::OnMouseMove((POINT *)pXY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 ArcomageGame::OnMouseClick(0, wParam & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 v29 = (wParam >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 LABEL_262:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 v30 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 LABEL_263:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 ArcomageGame::OnMouseClick(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 if ( Msg == WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 if ( wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 if ( Msg > WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 if ( Msg == WM_WINDOWPOSCHANGED )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 if ( pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 if ( Msg != WM_KEYFIRST )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 if ( Msg == WM_KEYUP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 if ( wParam == VK_CONTROL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 dword_507B98_ctrl_pressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 if ( Msg == WM_CHAR )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 if ( !pKeyActionMap->_459F10(wParam) && !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 GUI_HandleHotkey(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 if ( Msg != WM_COMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 if ( wParam != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 if ( wParam == 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 pRenderer->SavePCXScreenshot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 if ( wParam == 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 pArcomageGame->field_F6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 if ( wParam != 40001 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 v36 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 v35 = ::hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 LABEL_104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 SendMessageA(v35, v36, v37, v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 if ( dword_506E68 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 pKeyActionMap->_459F10(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 if ( wParam != 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 if ( wParam == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 dword_507B98_ctrl_pressed = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 v12 = ptr_507BC0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 if ( wParam <= 0x24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 if ( wParam > 0x28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 if ( wParam != 115 || pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 v37 = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 v36 = 273;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 v35 = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 goto LABEL_104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 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
14179 && 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
14180 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 if ( !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 sub_41CD4F(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 pArcomageGame->stru1.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 if ( (signed int)(unsigned __int16)v13 > 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 if ( v13 > 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 v24 = v13 - 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 LOBYTE(pArcomageGame->stru1.field_8) = 123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 if ( !v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 LOBYTE(pArcomageGame->stru1.field_8) = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 LOBYTE(pArcomageGame->stru1.field_8) = 125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 if ( v26 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 LOBYTE(pArcomageGame->stru1.field_8) = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 if ( v13 == 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 LOBYTE(pArcomageGame->stru1.field_8) = 43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 v21 = v13 - 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 LOBYTE(pArcomageGame->stru1.field_8) = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 LOBYTE(pArcomageGame->stru1.field_8) = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 v23 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 LOBYTE(pArcomageGame->stru1.field_8) = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 if ( v23 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 LOBYTE(pArcomageGame->stru1.field_8) = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 if ( (unsigned __int16)v13 == 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 LOBYTE(pArcomageGame->stru1.field_8) = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 if ( v13 > 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 v18 = v13 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 LOBYTE(pArcomageGame->stru1.field_8) = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 LOBYTE(pArcomageGame->stru1.field_8) = 35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 LOBYTE(pArcomageGame->stru1.field_8) = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 LOBYTE(pArcomageGame->stru1.field_8) = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 if ( v13 == 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 LOBYTE(pArcomageGame->stru1.field_8) = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 v14 = v13 - 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 LOBYTE(pArcomageGame->stru1.field_8) = 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 v15 = v14 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 LOBYTE(pArcomageGame->stru1.field_8) = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 v16 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 LOBYTE(pArcomageGame->stru1.field_8) = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 LOBYTE(pArcomageGame->stru1.field_8) = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 LOBYTE(pArcomageGame->stru1.field_8) = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 pArcomageGame->field_F5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 pArcomageGame->field_F4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 pArcomageGame->uGameResult = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 pArcomageGame->field_B0 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 if ( wParam != 114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 SendMessageA(hWnd, 0x111u, 0x68u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 v37 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 LOBYTE(pArcomageGame->stru1.field_8) = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 if ( Msg == WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 if ( wParam && (GetForegroundWindow() == hWnd || GetForegroundWindow() == hInsertCDWindow) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 dword_4E98BC_bApplicationActive = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 v10 = GetDC(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 a2 = GetDeviceCaps(v10, BITSPIXEL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 v11 = GetDeviceCaps(v10, PLANES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 ReleaseDC(0, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 if ( a2 != 16 || v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 Abortf(pGlobalTXT_LocalizationStrings[62]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 if ( BYTE1(dword_6BE364_game_settings_1) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 BYTE1(dword_6BE364_game_settings_1) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 if ( BYTE1(dword_6BE364_game_settings_1) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 if ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 pRenderer->RestoreFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 pRenderer->_4A184C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 if ( !(dword_6BE364_game_settings_1 & 0x100) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 dword_6BE364_game_settings_1 |= 0x100u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 if ( pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 BYTE1(dword_6BE364_game_settings_1) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 if ( pMiscTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 BYTE1(dword_6BE364_game_settings_1) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 if ( pGame && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 if ( Msg == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 v9 = GetDC(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 if ( GetDeviceCaps(v9, BITSPIXEL) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 ReleaseDC(hWnd, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 Abortf("You must be running in 256 color mode or higher. You can change the screen depth with the control panel display icon.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 ReleaseDC(hWnd, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 if ( Msg == WM_DESTROY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 v6 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 SetPriorityClass(v6, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 if ( pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 v7 = pGame->pKeyboardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 if ( LOBYTE(v7->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 pAsyncKeyboard->_45B3A4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 pAsyncMouse->_46B1DD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 PostQuitMessage(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 if ( Msg == WM_SETFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 if ( ::hWnd == (HWND)wParam )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 _def_wnd_proc:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 if ( Msg != WM_KILLFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 if ( Msg == WM_PAINT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 if ( !GetUpdateRect(hWnd, 0, 0) || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 BeginPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 EndPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 //----- (00464479) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 int v0; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 pPaletteManager->ResetNonLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 pBitmaps_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 pSprites_LOD->DeleteSomeOtherSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 pIcons_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 pRenderer->field_1036B8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 pRenderer->_gpu_memory_used = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 sub_46080D();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 pIndoor->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 pOutdoor->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 uCurrentlyLoadedLevelType = (LEVEL_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 pSpriteFrameTable->ResetSomeSpriteFlags();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 v0 = uNumVisibleWindows;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 while ( v0 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 //----- (004646F0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 void PrepareWorld(unsigned int this_)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 v1 = this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 pGame->pVisInstance->_4C1A02();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 pParty->uFlags = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 pStru277->_427D48(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 DoPrepareWorld(0, (v1 == 0) + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 //----- (00464761) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 void __thiscall Game_DeinitializeAndTerminate(int exitCode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 v1 = exitCode;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 v2 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 SetPriorityClass(v2, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 pRenderer->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 if ( !DestroyWindow(hWnd) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 hWnd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 exit(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 //----- (004647AB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 void __cdecl FinalInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 pViewport->_4C02F8((signed __int64)(flt_6BE3A0 * 65536.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 pIndoorCamera->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 65,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 viewparams->uScreenZ - viewparams->uScreenX + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 viewparams->uScreenW - viewparams->uScreenY + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 InitializeTurnBasedAnimations(&stru_50C198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 // 6BE3A0: using guessed type float flt_6BE3A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 //----- (00464839) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 char __cdecl Is_out15odm_underwater()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 return _strcmpi(pCurrentMapName, "out15.odm") == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 //----- (00464851) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 void __cdecl SetUnderwaterFog()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 day_fogrange_1 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 day_fogrange_2 = 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 //----- (00464866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 void __fastcall DoPrepareWorld(unsigned int bLoading, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 char *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 char *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 size_t v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 char Str1[20]; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 unsigned int v9; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 v9 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 pDecalBuilder->Reset(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 pGameLoadingUI_ProgressBar->_443484(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 v3 = strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 strcpy(Str1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 Level_LoadEvtAndStr(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 LoadLevel_InitializeLevelEvt();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 v4 = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 *(short *)v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 v4 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 while ( (signed int)v4 < (signed int)((char *)&pObjectList->uNumObjects + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 v5 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 uLevelMapStatsID = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 if ( !_strcmpi(pCurrentMapName, "out15.odm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 pParty->field_6F4_packedid = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 if ( _strcmpi(Str1, "blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 PrepareToLoadODM(v9, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 PrepareToLoadBLV(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 pAudioPlayer->SetMapEAX();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 sub_461103();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 if ( !_strcmpi(pCurrentMapName, "d11.blv") || !_strcmpi(pCurrentMapName, "d10.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 v6 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 v7 = (char *)&pActors[0].pMonsterInfo.uTreasureType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 *(v7 - 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 *(int *)(v7 + 59) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 v7 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 bDialogueUI_InitializeActor_NPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 OnMapLoad();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 pGameLoadingUI_ProgressBar->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 _flushall();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 // 5C35C4: using guessed type int bDialogueUI_InitializeActor_NPC_ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 //----- (004649EF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 int v3; // [sp+4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 DWORD cbData; // [sp+8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 DWORD dwDisposition; // [sp+10h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 BYTE Data[4]; // [sp+14h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 HKEY hKey; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 HKEY phkResult; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 HKEY v10; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 HKEY v11; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 v3 = uDefValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 cbData = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v10, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 if ( !RegCreateKeyExA(v10, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v11, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 *(int *)Data = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 RegCloseKey(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 RegCloseKey(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 return *(int *)Data;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 //----- (00464B02) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 size_t v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 const char *Str; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 HKEY v8; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 HKEY v9; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 Str = pString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v8, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 if ( !RegCreateKeyExA(v8, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v9, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 v2 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 RegSetValueExA(v9, lpValueName, 0, 1u, (const BYTE *)Str, v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 RegCloseKey(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 //----- (00464BEF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 LSTATUS (__stdcall *v4)(HKEY); // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 LSTATUS result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 DWORD Type; // [sp+Ch] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 LPCSTR lpValueName; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 DWORD cbData; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 LPBYTE Dest; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 DWORD dwDisposition; // [sp+1Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775 HKEY phkResult; // [sp+20h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 HKEY hKey; // [sp+24h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 HKEY v13; // [sp+28h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 HKEY v14; // [sp+2Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 cbData = uBufLen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 Dest = (LPBYTE)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 lpValueName = pKeyName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 || RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 || RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v13, &dwDisposition)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 || RegCreateKeyExA(v13, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v14, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 if ( RegQueryValueExA(v14, lpValueName, 0, &Type, Dest, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 RegCloseKey(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 result = RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 result = v4(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 result = v4(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 if ( hKey )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 result = v4(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 if ( phkResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 result = v4(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 //----- (00464D32) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 BYTE Data[4]; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 HKEY v7; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 HKEY v8; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 *(int *)Data = val;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, nullstring, 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, nullstring, 0, 0xF003Fu, 0, &v7, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 if ( !RegCreateKeyExA(v7, "1.0", 0, nullstring, 0, 0xF003Fu, 0, &v8, &dwDisposition) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 RegSetValueExA(v8, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 RegCloseKey(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 //----- (00464E17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 bool __fastcall CheckMM7CD(char c)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 char DstBuf[256]; // [sp+Ch] [bp-218h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 char strCommand[256]; // [sp+10Ch] [bp-118h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 char Filename[20]; // [sp+20Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 wchar_t pMagicPath[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 swprintf(pMagicPath, L"%C:\\anims\\magic7.vid", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 if (GetFileAttributesW(pMagicPath) == -1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 wsprintfA(strCommand, "info CD UPC wait");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 wsprintfA(strCommand, "close CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 *Filename = c;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 auto f = fopen(Filename, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 if (!f)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 if (!fseek(f, 0, SEEK_END))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 if (!fseek(f, -100, SEEK_CUR))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 fread(DstBuf, 1u, 0x64u, f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 //----- (00464F1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 char v4; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 INT_PTR v12; // [sp-4h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 if ( a2 == 272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 hInsertCDWindow = hDlg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 v7 = v6 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 v8 = v7 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 v9 = v8 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 if ( v9 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 v11 = "Odwolaj";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 SetWindowTextA(hDlg, "Inserire il secondo CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 v11 = "Annulla";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 SetWindowTextA(hDlg, "Insérez le CD 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 v11 = "Supprimer";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 v11 = "Cancelar";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 v11 = "Abbrechen";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 v10(hDlg, 2, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 if ( a2 == 273 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 if ( a3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 EndDialog(hDlg, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 v4 = a3 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 v4 = a2 == 1025;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 //----- (00465061) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 char drive[4] = {'X', ':', '\\', 0};
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 bool bGotCDFromRegistry = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 HKEY hSoftware = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 hNWC = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 hMM7 = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 hVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 DWORD cbData = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 bGotCDFromRegistry = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 RegCloseKey(hVersion);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 RegCloseKey(hMM7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 RegCloseKey(hNWC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 RegCloseKey(hSoftware);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 if (bGotCDFromRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 if (CheckMM7CD(*drive))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 while (true)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 for (uint i = 0; i < 26; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 drive[0] = 'A' + i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 if (GetDriveTypeA(drive) == DRIVE_CDROM)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 if (CheckMM7CD(bGotCDFromRegistry))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 WriteWindowsRegistryString("CDDrive", drive);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", ::hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 //----- (004651F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 bool MM7_Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 //int v32; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 //int v33; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 //int v34; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 //int v35; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 //unsigned int v36; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 //float v37; // ST2C_4@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 //HWND v38; // [sp-Ch] [bp-170h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 srand(GetTickCount());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 /*GetDiskFreeSpaceA(0, &SectorsPerCluster, &BytesPerSector, &hdc, &TotalNumberOfClusters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 v4 = hdc * BytesPerSector * SectorsPerCluster;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 if ( (unsigned int)v4 < 0x1E00000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 "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
15067 (unsigned int)v4 / 1024i64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 v41 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 v40 = "More Hard Drive Space Required";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 v39 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 WNDCLASSEXW wcxw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 wcxw.cbSize = sizeof(wcxw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 wcxw.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 wcxw.lpfnWndProc = (WNDPROC)aWinProc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 wcxw.cbClsExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 wcxw.cbWndExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 wcxw.hInstance = GetModuleHandleW(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 wcxw.hCursor = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 wcxw.hIcon = wcxw.hIconSm = LoadIconW(wcxw.hInstance, L"MM7_ICON");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 wcxw.lpszMenuName = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 wcxw.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 wcxw.lpszClassName = L"Might and Magic Trilogy";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 if (!RegisterClassExW(&wcxw))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 Log::Warning(L"Cannot register window class");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 auto hDesktopDC = GetDC(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 uint uDesktopWidth = GetDeviceCaps(hDesktopDC, HORZRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 uint uDesktopHeight = GetDeviceCaps(hDesktopDC, VERTRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 if (GetDeviceCaps(hDesktopDC, BITSPIXEL) != 16 ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 GetDeviceCaps(hDesktopDC, PLANES) != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 dword_6BE364_game_settings_1 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 ReleaseDC(nullptr, hDesktopDC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 uint uTotalWinWidth = 2 * GetSystemMetrics(SM_CXFRAME) + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 uint uTotalWinHeight = GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYFRAME) + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 uint uWinCenteredPosX = (uDesktopWidth - uTotalWinWidth) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 uint uWinCenteredPosY = (uDesktopHeight - uTotalWinHeight) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 uWindowX = ReadWindowsRegistryInt("window X", uWinCenteredPosX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 uWindowX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 WriteWindowsRegistryInt("window X", uWindowX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 uWindowY = ReadWindowsRegistryInt("window Y", uWinCenteredPosY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 uWindowY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 WriteWindowsRegistryInt("window Y", uWindowY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 hWnd = CreateWindowExW(0, wcxw.lpszClassName, L"Might and Magic® VII",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 uWindowStyle = WS_SYSMENU | WS_GROUP | WS_DLGFRAME | WS_BORDER,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 640, 480,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 hOSMenu = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 wcxw.hInstance,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 pRenderer = Render::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 if (!pRenderer)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 Log::Warning(L"Render creation failed");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 if (!pRenderer->Initialize(bWindowMode, uDefaultDevice, bColoredLights, uLevelOfDetail, bTinting))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 Log::Warning(L"Render failed to initialize");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 pAllocator = Allocator::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 if (!pAllocator->Initialize(26 * 1024))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 L"Unable to Allocate 26Mb of RAM",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 L"More RAM Memory Required", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 return false;
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 wchar_t pCurrentDir[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 _wgetcwd(pCurrentDir, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 wchar_t pMM6IniFile[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 wsprintf(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 pParty = new Party;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 pParty->sEyelevel = pParty->uDefaultEyelevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 bUseRegistry = GetPrivateProfileIntW(L"settings", L"registry", 1, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 MM6_Initialize(pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 pKeyActionMap = new KeyboardActionMapping;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 pEventTimer = Timer::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 pEventTimer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 OnTimer(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 GameUI_StatusBar_UpdateTimedString(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 pGame = Game::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 pMouse = pGame->pMouseInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 RECT rcWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 GetWindowRect(hWnd, &rcWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 RECT rcClient;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 GetClientRect(hWnd, &rcClient);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 uWindowWidth = rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 uWindowHeight = rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 MoveWindow(hWnd, uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 if (bCanLoadFromCD)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 if (!FindMM7CD(hWnd, &cMM7GameCDDriveLetter))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 ShowWindow(hWnd, SW_SHOWNORMAL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 pIcons_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 if (!pIcons_LOD->LoadIconsOrEvents("data\\icons.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 pIcons_LOD->dword_011BA4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 pEvents_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 if (!pEvents_LOD->LoadIconsOrEvents("data\\events.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 InitializeGameText();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 pBitmaps_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 if (!pBitmaps_LOD->LoadBitmaps("data\\bitmaps.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 bUseLoResSprites = ReadWindowsRegistryInt("resolution", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 bUseLoResSprites = GetPrivateProfileIntW(L"settings", L"resolution", 0, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 const char *pSpritesFile = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 if (bUseLoResSprites)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 pSpritesFile = "data\\spriteLO.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 pSpritesFile = "data\\sprites.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 pSprites_LOD = new LODFile_Sprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 if (!pSprites_LOD->LoadSprites(pSpritesFile))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 if (!pSpriteFrameTable->FromFileTxt("data\\sft.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 Abortf("Unable to open sft.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 if (!pDecorationList->FromFileTxt("data\\declist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 Abortf("Unable to open declist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 if (!pObjectList->FromFileTxt("data\\objlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 Abortf("Unable to open objlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 if (!pMonsterList->FromFileTxt("data\\monlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 Abortf("Unable to open monlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 if (!pIconsFrameTable->FromFileTxt("data\\ift.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 Abortf("Unable to open ift.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 if (!pTextureFrameTable->FromFileTxt("data\\tft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 Abortf("Unable to open tft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 if (!pTileTable->FromFileTxt("data\\tile.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 Abortf("Unable to open tile.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 if (!pPlayerFrameTable->FromFileTxt("data\\pft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 Abortf("Unable to open pft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 if (!pChestList->FromFileTxt("data\\chest.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 Abortf("Unable to open chest.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 if (!pOverlayList->FromFileTxt("data\\overlay.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 Abortf("Unable to open overlay.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 if (!pSoundList->FromFileTxt("data\\sounds.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 Abortf("Unable to open sounds.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 auto pSFT = pEvents_LOD->LoadRaw("dsft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 pSpriteFrameTable->FromFile(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 free(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 auto pTFT = pEvents_LOD->LoadRaw("dtft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 pTextureFrameTable->FromFile(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 free(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 auto pTiles = pEvents_LOD->LoadRaw("dtile.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 pTileTable->FromFile(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 free(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 auto pPFT = pEvents_LOD->LoadRaw("dpft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 pPlayerFrameTable->FromFile(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 free(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 auto pIFT = pEvents_LOD->LoadRaw("dift.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 pIconsFrameTable->FromFile(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 free(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 auto pDecs = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 pDecorationList->FromFile(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 free(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 auto pObjs = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 pObjectList->FromFile(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 free(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 auto pMons = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 pMonsterList->FromFile(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 free(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 auto pChests = pEvents_LOD->LoadRaw("dchest.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 pChestList->FromFile(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 free(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 auto pOverlays = pEvents_LOD->LoadRaw("doverlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 pOverlayList->FromFile(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 free(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 auto pSounds = pEvents_LOD->LoadRaw("dsounds.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 pSoundList->FromFile(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 free(pSounds);
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 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 pSpriteFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 pDecorationList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 pObjectList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 pMonsterList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 pIconsFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 pTextureFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 pTileTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 pPlayerFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 pChestList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 pOverlayList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 pSoundList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 // color depth != 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 // or
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 // not in window
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 SetMenu(hWnd, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 SetWindowLongA(hWnd, GWL_EXSTYLE, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 pRenderer->InitializeFullscreen(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 ClipCursor(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 pRenderer->SwitchToWindow(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 uSoundVolumeMultiplier = ReadWindowsRegistryInt("soundflag", 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 if (uSoundVolumeMultiplier < 0 || uSoundVolumeMultiplier > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 uSoundVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 uMusicVolimeMultiplier = ReadWindowsRegistryInt("musicflag", 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 if (uMusicVolimeMultiplier < 0 || uMusicVolimeMultiplier > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 uMusicVolimeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 uVoicesVolumeMultiplier = ReadWindowsRegistryInt("CharVoices", 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 if (uVoicesVolumeMultiplier < 0 || uVoicesVolumeMultiplier > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 uVoicesVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 byte_6BE388_graphicsmode = ReadWindowsRegistryInt("graphicsmode", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 if (byte_6BE388_graphicsmode < 0 || byte_6BE388_graphicsmode > 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 byte_6BE388_graphicsmode = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 uGammaPos = ReadWindowsRegistryInt("GammaPos", 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 if (uGammaPos < 0 || uGammaPos > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 uGammaPos = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 if ( ReadWindowsRegistryInt("Bloodsplats", 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 pGame->uFlags2 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 pGame->uFlags2 &= 0xFFFFFFDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 dword_6BE384_2dacceloff = ReadWindowsRegistryInt("2dacceloff", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 if ( !(dword_6BE364_game_settings_1 & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 pAudioPlayer->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 pVideoPlayer = new VideoPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 pVideoPlayer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 switch ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 uTurnSpeed = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 uTurnSpeed = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 uTurnSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 //----- (00465D0B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 void __cdecl SecondaryInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 //_UNKNOWN *v0; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 //char **v1; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 //char *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 //__int16 uIconID; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 __int16 v4; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 int v7; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 ObjectDesc *v8; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 signed int v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 signed int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 signed int v11; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 char pContainer[32]; // [sp+10h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 pMouse->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 CreateAsyncMouse();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 CreateAsyncKeyboard();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 pItemsTable = new ItemsTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 pItemsTable->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 pBitmaps_LOD->dword_011BA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 pPaletteManager->field_267AD0 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 pPaletteManager->field_267AD1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 pPaletteManager->field_267AD2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 pSprites_LOD->field_ECAC = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 pObjectList->InitializeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 pOverlayList->InitializeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 if ( !(dword_6BE364_game_settings_1 & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 pSoundList->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 static const char *pUIAnimNames[4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 "glow03", "glow05",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 "torchA", "wizeyeA"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 static unsigned short _4E98D0[4][4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 {479, 0, 329, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504 {585, 0, 332, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 {468, 0, 0, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 {606, 0, 0, 0}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 for (uint i = 0; i < 4; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 pUIAnims[i]->uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 pUIAnims[i]->uAnimTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517 pUIAnims[i]->x = _4E98D0[i][0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 pUIAnims[i]->y = _4E98D0[i][2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 if ( (signed int)pObjectList->uNumObjects > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 BYTE3(v7) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 v8 = &pObjectList->pObjects[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 *(short *)((char *)&v7 + 1) = v8->uParticleTrailColorR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 LOBYTE(v7) = v8->uParticleTrailColorG;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 v8->uParticleTrailColor = v8->uParticleTrailColorB | (v7 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 while ( v5 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 flt_6BE3A0 = 0.55000001f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 MainMenuUI_Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 pGame->pStru6Instance->LoadAnimations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 sprintf(pContainer, "HDWTR%03u", v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 pRenderer->pHDWaterBitmapIDs[v9++] = pBitmaps_LOD->LoadTexture(pContainer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 while ( v9 < 7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 pNPCStats = new NPCStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 pNPCStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551 Initialize_GlobalEVT();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15552 pBitmaps_LOD->dword_11B80 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 if ( pBitmaps_LOD->dword_11B84 < (signed int)pBitmaps_LOD->uNumLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 pSprites_LOD->field_ECA4 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 if ( pSprites_LOD->field_ECA0 < (signed int)pSprites_LOD->uNumLoadedSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 pPaletteManager->LockAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 _mkdir("Saves");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 while ( v11 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 while ( v10 < 5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 Initialize_GamesLOD_NewLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 dword_576E2C = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 dword_576E28 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 bool MM_Main(const wchar_t *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 HWND hPrevWnd; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 HWND hPrevWnd_; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 HWND v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 //bool v9; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 OtherOverlay *v10; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 signed int v11; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 unsigned int v12; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 HANDLE v13; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 unsigned int startms; // [sp+8h] [bp-24h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 RECT Rect; // [sp+Ch] [bp-20h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 int a2[4]; // [sp+1Ch] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 if (pCmdLine && *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 if (wcsstr(pCmdLine, L"-usedefs"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 bDebugResouces = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 if (wcsstr(pCmdLine, L"-window"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 dword_6BE368_debug_settings_2 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 if (wcsstr(pCmdLine, L"-nosound"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 dword_6BE364_game_settings_1 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 if (wcsstr(pCmdLine, L"-noanim"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 dword_6BE364_game_settings_1 |= 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 bNoVideo = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 stru_51076C.registry_debug_flags = ReadWindowsRegistryInt("debug flags", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 v8 = sub_4AC1C9(0, (Vec4_int_ *)a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 Rect.left = *(int *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 Rect.top = *(int *)(v8 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 Rect.right = *(int *)(v8 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 Rect.bottom = *(int *)(v8 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 uCPUSpeed = Rect.bottom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 if (MM7_Initialize())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 SetWindowPos(hWnd, (HWND)((int)HWND_MESSAGE|0x2), 320, 240, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 Rect.left = 325;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 Rect.top = 245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 Rect.right = 326;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 Rect.bottom = 246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 ClipCursor(&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 SetUserInterface(1, false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 WriteWindowsRegistryInt("Ran once", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 dword_6BE364_game_settings_1 |= 0x4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 pGame->InitializeGammaController();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 SecondaryInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 pRenderer->Clip_v2(0, 0, 639u, 479u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 FinalInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 MainMenu_Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 if ( uGameState == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 if ( uCurrentMenuID == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 v10 = (OtherOverlay *)&pOtherOverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 v11 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 v10->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 --v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 while ( v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 strcpy(pCurrentMapName, pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 pParty->CreateDefaultParty(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 PlayerCreationUI_Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 if ( PlayerCreationUI_Loop() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 bFlashQuestBook = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 pGame->pCShow->PlayMovie(MOVIE_Intro, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 MaybeDoAutosave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 if ( uCurrentMenuID == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 if ( uCurrentMenuID == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 uGameState = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 if ( uCurrentMenuID == 5 || uCurrentMenuID == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 if ( uCurrentMenuID != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 pMouse->Activate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 pParty->CreateDefaultParty(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 crt_init_globals_46271C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 extern OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 pMouse->Activate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 _chdir("..\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 strcpy(pCurrentMapName, ofn.lpstrFileTitle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 pMouse->Activate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 pGame->Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 if ( uGameState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 v12 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 goto LABEL_57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 if ( uGameState == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 LABEL_57:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 SetCurrentMenuID(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 if ( uGameState == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 extern MENU_STATE __cdecl CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 if ( !(dword_6BE364_game_settings_1 & 0x10) && pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 pAudioPlayer->SetMusicVolume(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 unsigned int end_ms;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 0xEu, &startms, &end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 //----- (004637E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 char __cdecl sub_4637E0_is_there_popup_onscreen()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 return dword_507BF0_is_there_popup_onscreen == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 //----- (00465F5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 void __cdecl CreateAsyncMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 if (!pAsyncMouse &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 pRenderer->bUserDirect3D &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 pRenderer->uAcquiredDirect3DDevice == 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 pAsyncMouse = new AsyncMouse(&pRenderer->pDirectDraw4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 //----- (00465FF0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 void __cdecl CreateAsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 if (!pAsyncKeyboard &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 pGame->pKeyboardInstance->bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 pAsyncKeyboard = new AsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 if (pAsyncKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 //----- (00466082) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 void MM6_Initialize(const wchar_t *pIniFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 //int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 UINT v1; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 size_t v2; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 size_t v3; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 size_t v4; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 //char v5[120]; // [sp+Ch] [bp-17Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 //char String[120]; // [sp+84h] [bp-104h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 unsigned int v9; // [sp+184h] [bp-4h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 //_getcwd(v5, 120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 viewparams = new ViewingParams;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 viewparams->uScreenX = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 viewparams->uScreenY = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 viewparams->uScreenZ = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 viewparams->uScreenW = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 pAudioPlayer = new AudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 if ( pAudioPlayer->uMixerChannels > 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 pAudioPlayer->uMixerChannels = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 if (GetPrivateProfileIntW(L"settings", L"nointro", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 dword_6BE364_game_settings_1 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 if (GetPrivateProfileIntW(L"settings", L"nosound", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 dword_6BE364_game_settings_1 |= 0x10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 if (GetPrivateProfileIntW(L"settings", L"nowalksound", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 dword_6BE364_game_settings_1 |= 0x20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 if (GetPrivateProfileIntW(L"settings", L"nologo", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 dword_6BE364_game_settings_1 |= 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 if (GetPrivateProfileIntW(L"settings", L"nointro", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 dword_6BE364_game_settings_1 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 dword_6BE368_debug_settings_2 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 v1 = ReadWindowsRegistryInt("startinwindow", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 v1 = GetPrivateProfileIntW(L"debug", L"startinwindow", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 if (v1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 dword_6BE368_debug_settings_2 |= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 dword_6BE368_debug_settings_2 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 dword_6BE368_debug_settings_2 |= 0x10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 dword_6BE368_debug_settings_2 |= 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 wchar_t pStartingMapNameW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 sprintf(pStartingMapName, "%S", pStartingMapNameW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 if ( strlen(pStartingMapName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 if ( pStartingMapName[v9] == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 pStartingMapName[v9] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 v2 = strlen(pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 while ( v9 < v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 pOutdoorCamera = new OutdoorCamera;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 outdoor_day_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.r", 81, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 outdoor_day_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.g", 121, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 outdoor_day_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.b", 236, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 outdoor_day_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.r", 153, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 outdoor_day_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.g", 193, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 outdoor_day_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.b", 237, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 outdoor_night_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.r", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 outdoor_night_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.g", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 outdoor_night_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.b", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 outdoor_night_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.r", 11, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 outdoor_night_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.g", 41, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 outdoor_night_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.b", 129, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 pOutdoorCamera->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 pOutdoorCamera->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 pOutdoorCamera->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 pOutdoorCamera->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 pOutdoorCamera->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 pOutdoorCamera->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 mipmapping_terrain_mm1 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm1", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 mipmapping_terrain_mm2 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm2", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 mipmapping_terrain_mm3 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm3", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 mipmapping_building_mm1 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm1", 1024, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 mipmapping_building_mm2 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm2", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 pOutdoorCamera->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 wchar_t pDefaultSkyTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 wchar_t pDefaultGroundTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 wchar_t pFloat[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 if ( strlen(pDefaultSkyTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 if ( pDefaultSkyTexture[v3] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 pDefaultSkyTexture[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 while ( v3 < strlen(pDefaultSkyTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 if ( strlen(pDefaultGroundTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 if ( pDefaultGroundTexture[v4] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 pDefaultGroundTexture[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 while ( v4 < strlen(pDefaultGroundTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 texmapping_terrain_subdivsize = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivsize", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 texmapping_terrain_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivpow2", 4, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 texmapping_building_subdivsize = GetPrivateProfileIntW(L"texmapping", L"building_subdivsize", 32, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 texmapping_building_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"building_subdivpow2", 5, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 //----- (004666D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 void __cdecl MM7Initialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 if ( !byte_6BE388_graphicsmode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 outdoor_grid_band_1 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 outdoor_grid_band_2 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 outdoor_grid_band_3 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 pOutdoorCamera->shading_dist_mist = 8192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 pOutdoorCamera->bNoSky = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 mipmapping_terrain_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 mipmapping_terrain_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 mipmapping_building_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 mipmapping_building_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 pOutdoorCamera->shading_dist_shade = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 pOutdoorCamera->terrain_gamma = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 pOutdoorCamera->building_gamme = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 mipmapping_terrain_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 mipmapping_building_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 pOutdoorCamera->shading_dist_shademist = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 pOutdoorCamera->outdoor_no_wavy_water = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 sub_47F4D3(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 viewparams->uSomeY = viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 viewparams->uSomeX = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 viewparams->uSomeZ = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 viewparams->uSomeW = viewparams->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 pViewport = new Viewport;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 pViewport->SetScreen(viewparams->uScreenX, viewparams->uScreenY, viewparams->uScreenZ, viewparams->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 //----- (00466B8C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 int __cdecl AbortWithError()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 if ( !aborting_app )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 aborting_app = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 SaveGame(1, 0); // "Internal Error"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 // "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
16022 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 // 720018: using guessed type int aborting_app;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 //----- (00466BE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 void Abortf(const char *Format, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 va_list va; // [sp+8h] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 va_start(va, Format);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 vsprintf(pTmpBuf, Format, va);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 pMouse->Activate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 MessageBoxA(0, pTmpBuf, "Error", 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 //----- (00466C40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 // #define MENU_MAIN 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 // #define MENU_NEWGAME 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 // #define MENU_CREDITS 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 // #define MENU_LOAD 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 // #define MENU_CREATEPARTY 6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 // #define MENU_MAINMENULOAD 9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 void __thiscall SetCurrentMenuID(unsigned int uMenu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 v1 = uMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 if ( uCurrentMenuID == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 if ( uMenu != -1 && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 if ( uMenu == -1 && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 uCurrentMenuID = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 //----- (00466CA0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070 unsigned int __cdecl GetCurrentMenuID()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 return uCurrentMenuID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 if ( v4 > -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 switch ( v4 + 2005532212 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 v7 = "DDERR_SURFACENOTATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 v7 = "DDERR_TOOBIGHEIGHT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 v7 = "DDERR_TOOBIGSIZE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 v7 = "DDERR_TOOBIGWIDTH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 case 50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 v7 = "DDERR_UNSUPPORTEDFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 case 60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 v7 = "DDERR_UNSUPPORTEDMASK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 case 61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 v7 = "DDERR_INVALIDSTREAM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 case 77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 v7 = "DDERR_VERTICALBLANKINPROGRESS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 case 80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 v7 = "DDERR_WASSTILLDRAWING";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 case 100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 v7 = "DDERR_XALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 v7 = "DDERR_INVALIDDIRECTDRAWGUID";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 v7 = "DDERR_DIRECTDRAWALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 v7 = "DDERR_NODIRECTDRAWHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 v7 = "DDERR_PRIMARYSURFACEALREADYEXISTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 case 105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 v7 = "DDERR_NOEMULATION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 case 106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 v7 = "DDERR_REGIONTOOSMALL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 case 107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 v7 = "DDERR_CLIPPERISUSINGHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 case 108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 v7 = "DDERR_NOCLIPPERATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 case 109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 v7 = "DDERR_NOHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 case 110:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 v7 = "DDERR_HWNDSUBCLASSED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 case 111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 v7 = "DDERR_HWNDALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 case 112:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 v7 = "DDERR_NOPALETTEATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 case 113:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 v7 = "DDERR_NOPALETTEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 case 114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 v7 = "DDERR_BLTFASTCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 case 115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 v7 = "DDERR_NOBLTHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 case 116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 v7 = "DDERR_NODDROPSHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 case 117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 v7 = "DDERR_OVERLAYNOTVISIBLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 case 118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 v7 = "DDERR_NOOVERLAYDEST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 case 119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 v7 = "DDERR_INVALIDPOSITION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 case 120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 v7 = "DDERR_NOTAOVERLAYSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 case 121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 v7 = "DDERR_EXCLUSIVEMODEALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 case 122:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 v7 = "DDERR_NOTFLIPPABLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 case 123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 v7 = "DDERR_CANTDUPLICATE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 case 125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 v7 = "DDERR_CANTCREATEDC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 case 126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 v7 = "DDERR_NODC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 case 127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 v7 = "DDERR_WRONGMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 case 128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 v7 = "DDERR_IMPLICITLYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 case 129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 v7 = "DDERR_NOTPALETTIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 case 130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 v7 = "DDERR_UNSUPPORTEDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 case 131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 v7 = "DDERR_NOMIPMAPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 case 132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 v7 = "DDERR_INVALIDSURFACETYPE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 case 140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 v7 = "DDERR_NOOPTIMIZEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 case 141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 v7 = "DDERR_NOTLOADED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 case 142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 v7 = "DDERR_NOFOCUSWINDOW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 case 160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 v7 = "DDERR_DCALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 case 170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 v7 = "DDERR_NONONLOCALVIDMEM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 case 180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 v7 = "DDERR_CANTPAGELOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 case 200:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 v7 = "DDERR_CANTPAGEUNLOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 v7 = "DDERR_NOTPAGELOCKED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 case 230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 v7 = "DDERR_MOREDATA";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 case 231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 v7 = "DDERR_EXPIRED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 case 235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 v7 = "DDERR_VIDEONOTACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 case 239:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 v7 = "DDERR_DEVICEDOESNTOWNSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 case 124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 if ( v4 != -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 if ( v4 > -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 if ( v4 <= -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 if ( v4 == -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 v7 = "DDERR_NOVSYNCHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 if ( v4 > -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 if ( v4 == -2005532382 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 v7 = "DDERR_NOROTATIONHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 if ( v4 == -2005532362 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 v7 = "DDERR_NOSTRETCHHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 if ( v4 == -2005532356 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 v7 = "DDERR_NOT4BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 if ( v4 == -2005532355 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 v7 = "DDERR_NOT4BITCOLORINDEX";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 if ( v4 == -2005532352 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 v7 = "DDERR_NOT8BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 if ( v4 == -2005532342 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 v7 = "DDERR_NOTEXTUREHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 if ( v4 == -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 v7 = "DDERR_NORASTEROPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 if ( v4 == -2005532442 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 v7 = "DDERR_NOFLIPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 if ( v4 == -2005532432 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 v7 = "DDERR_NOGDI";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 if ( v4 == -2005532422 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 v7 = "DDERR_NOMIRRORHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 if ( v4 == -2005532417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 v7 = "DDERR_NOTFOUND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 if ( v4 == -2005532412 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 v7 = "DDERR_NOOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 if ( v4 == -2005532402 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 v7 = "DDERR_OVERLAPPINGRECTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 if ( v4 <= -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 if ( v4 == -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 v7 = "DDERR_PALETTEBUSY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 if ( v4 == -2005532332 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 v7 = "DDERR_NOZBUFFERHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 if ( v4 == -2005532322 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 v7 = "DDERR_NOZOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 if ( v4 == DDERR_OUTOFCAPS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 v7 = "DDERR_OUTOFCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 if ( v4 == DDERR_OUTOFVIDEOMEMORY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 v7 = "DDERR_OUTOFVIDEOMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 if ( v4 == DDERR_OVERLAYCANTCLIP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 v7 = "DDERR_OVERLAYCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 if ( v4 == DDERR_OVERLAYCOLORKEYONLYONEACTIVE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 v7 = "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 if ( v4 == -2005532272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 v7 = "DDERR_COLORKEYNOTSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 if ( v4 == -2005532262 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 v7 = "DDERR_SURFACEALREADYATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 if ( v4 == -2005532252 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 v7 = "DDERR_SURFACEALREADYDEPENDENT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 if ( v4 != -2005532242 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 if ( v4 == -2005532237 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 v7 = "DDERR_CANTLOCKSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 if ( v4 == -2005532232 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 v7 = "DDERR_SURFACEISOBSCURED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 if ( v4 == -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 v7 = "DDERR_NOEXCLUSIVEMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 if ( v4 <= -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 if ( v4 == -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 v7 = "DDERR_INVALIDCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 if ( v4 > -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 if ( v4 == -2005532652 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 v7 = "DDERR_CANNOTDETACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 if ( v4 == -2005532632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 v7 = "DDERR_CURRENTLYNOTAVAIL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 if ( v4 == -2005532617 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 v7 = "DDERR_EXCEPTION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 if ( v4 == -2005532582 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 v7 = "DDERR_HEIGHTALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 if ( v4 == -2005532577 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 v7 = "DDERR_INCOMPATIBLEPRIMARY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 if ( v4 == -2005532572 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 v7 = "DDERR_INVALIDCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 if ( v4 == -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 v7 = "DDERR_CANNOTATTACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 if ( v4 == -2147467263 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 v7 = "DDERR_UNSUPPORTED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 if ( v4 == -2147467259 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 v7 = "DDERR_GENERIC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 if ( v4 == -2147221008 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 v7 = "DDERR_NOTINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 if ( v4 == -2147024882 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 v7 = "DDERR_OUTOFMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 if ( v4 == -2147024809 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 v7 = "DDERR_INVALIDPARAMS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 if ( v4 == -2005532667 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 v7 = "DDERR_ALREADYINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 LABEL_173:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 v13 = strlen(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 v12 = (char *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 std::stringoperator_assign__const_char_ptr__(&a1, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 pRenderer->field_40110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 v15 = &v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 std::string40E2C8(&v11, Str, (int)((char *)&hr + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 v10 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 Str = (char *)&v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 std::string40E2C8(&v9, "Direct Draw Error", (int)((char *)&a3 + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 LOBYTE(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 CheckHRESULT_stru0::ShowMessageBox(v6, &a1, v9, v10, v11, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 sprintfex(&Src, "Unknown DirectDraw/Direct3D error number %X", v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 v13 = strlen(&Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 v12 = &Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 if ( v4 > -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 if ( v4 == -2005532467 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 v7 = "DDERR_NOCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 if ( v4 == -2005532462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 v7 = "DDERR_NOCOLORCONVHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 if ( v4 == -2005532460 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 v7 = "DDERR_NOCOOPERATIVELEVELSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 if ( v4 == -2005532457 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 v7 = "DDERR_NOCOLORKEY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 if ( v4 == -2005532452 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 v7 = "DDERR_NOCOLORKEYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 if ( v4 == -2005532450 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 v7 = "DDERR_NODIRECTDRAWSUPPORT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 if ( v4 == -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 v7 = "DDERR_NOALPHAHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 if ( v4 == -2005532552 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 v7 = "DDERR_INVALIDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 if ( v4 == -2005532542 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 v7 = "DDERR_INVALIDOBJECT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 if ( v4 == -2005532527 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 v7 = "DDERR_INVALIDPIXELFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 if ( v4 != -2005532522 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 if ( v4 == -2005532512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 v7 = "DDERR_LOCKEDSURFACES";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 if ( v4 == -2005532502 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 v7 = "DDERR_NO3D";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 //----- (00467D5D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 int __thiscall sub_467D5D(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 return *(int *)(_this + 7204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 //----- (00467E7F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 Player *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 int v4; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 ItemGen _this; // [sp+Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 Player *v9; // [sp+30h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 int v10; // [sp+34h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 int *v11; // [sp+38h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 v1 = uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 v2 = (unsigned __int8)byte_4E8398[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 v3 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 v11 = (int *)((char *)&v3->pEquipment + 4 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 v4 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 v10 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 *(char *)(v5 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 pParty->SetHoldingItem((ItemGen *)(v5 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 v6 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 _this.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 memcpy((void *)(v5 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 *v11 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 v7 = v3->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 if ( (v7 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 pParty->pPickedItem.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 memcpy(&v9->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v9->pInventoryItems[v7]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 *v11 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 //----- (00467F48) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 void __fastcall sub_467F48(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 if ( !ptr_507BC4 && a1 >= 700 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 if ( a1 <= 782 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 ptr_507BC4 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)30, v1 - 700, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 // 720980: using guessed type int uTextureID_720980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 //----- (00467F9F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 void __cdecl free_book_subwindow()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 if ( ptr_507BC4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 ptr_507BC4->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 ptr_507BC4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 //----- (00467FB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 char __cdecl sub_467FB6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 char *v1; // ST18_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 unsigned int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 GUIWindow a1; // [sp+Ch] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 memcpy(&a1, ptr_507BC4, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 a1.str_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 a1.uFrameX = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 a1.uFrameY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 a1.uFrameWidth = 468;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 v0 = pFontSmallnum->CalcTextHeight(pScrolls[(unsigned int)ptr_507BC4->ptr_1C], &a1, 0, 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 + 2 * LOBYTE(pFontCreate->uFontHeight)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 + 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 a1.uFrameHeight = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 if ( (signed int)(v0 + a1.uFrameY) > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 v0 = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 a1.uFrameHeight = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 a1.uFrameW = v0 + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 a1._415551(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 a1.uFrameX += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 a1.uFrameWidth -= 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 a1.uFrameY += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 a1.uFrameHeight -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 v1 = pItemsTable->pItems[(unsigned int)ptr_507BC4->ptr_1C + 700].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 sprintfex(pTmpBuf, format_4E2D80, v2, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 return a1.DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 LOBYTE(pFontCreate->uFontHeight) - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 pScrolls[(unsigned int)ptr_507BC4->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 //----- (00468F8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 void __cdecl OnPaperdollLeftClick()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 unsigned int v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 unsigned int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 unsigned __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 unsigned int v6; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 unsigned int v8; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 int v9; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 int v10; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 int v11; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 int v12; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 int v13; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 char v14; // zf@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 int v15; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 int v16; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 int v17; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 unsigned int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 unsigned int v19; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 int v20; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 int v21; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 unsigned int v22; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 unsigned int v23; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 int v24; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 unsigned int v26; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 int v27; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 int v28; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 int v29; // esi@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 int v30; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 int v31; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 unsigned int v32; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 unsigned int v33; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 int v34; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 unsigned int v35; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 int v36; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 int v37; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 ItemGen *v38; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 __int16 v39; // dx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 signed int v40; // [sp-1Ch] [bp-68h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 unsigned int v41; // [sp-18h] [bp-64h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 signed int v42; // [sp-14h] [bp-60h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 signed int v43; // [sp-10h] [bp-5Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 int v44; // [sp-Ch] [bp-58h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 unsigned int v45; // [sp-8h] [bp-54h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 int v46; // [sp-4h] [bp-50h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 ItemGen _this; // [sp+Ch] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 unsigned int v48; // [sp+30h] [bp-1Ch]@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 unsigned int v49; // [sp+34h] [bp-18h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 unsigned int v50; // [sp+38h] [bp-14h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 int v51; // [sp+3Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 unsigned int v52; // [sp+40h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 int v53; // [sp+44h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 unsigned int v54; // [sp+48h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 v1 = v0->pEquipment.uMainHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 v2 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 v54 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 v53 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 if ( v1 && pItemsTable->pItems[*(int *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uEquipType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 v51 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 v4 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 if ( v4 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 if ( (signed int)SkillToMastery(v5) < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 v0->PlaySound(39, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 if ( (v4 == 8 || v4 == 1 || v4 == 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 && v1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 && pItemsTable->pItems[*(int *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uSkillType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 sub_467E7F_EquipBody(3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 WetsuitOn(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 v6 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 switch ( v52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 sub_467E7F_EquipBody(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 v52 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 v7 = (int)&v0->pEquipment.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 if ( !*(int *)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 v8 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 if ( (v8 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 v7 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 if ( (signed int)v52 > 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 v9 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 pParty->pPickedItem.uBodyAnchor = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 *(&v0->pEquipment.uOffHand + v9) = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 if ( v52 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 v52 = v0->pEquipment.field_3C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 v10 = (int)((char *)v0 + 36 * v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 *(char *)(v10 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 pParty->SetHoldingItem((ItemGen *)(v10 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 _this.uBodyAnchor = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 v11 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 memcpy((void *)(v10 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 v0->pEquipment.field_3C = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 v12 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 *(char *)(v12 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 v13 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 v14 = v51 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 memcpy((void *)(v12 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 v0->pEquipment.uOffHand = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 if ( (v52 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 v17 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 v0->pEquipment.uOffHand = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 v15 = (int)((char *)v0 + 36 * (v53 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 *(char *)(v15 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 v16 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 v0->pEquipment.uOffHand = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 v0->pEquipment.uMainHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 case 0xCu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 && pParty->pPickedItem.uItemID != 64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 && pParty->pPickedItem.uItemID != 65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 v18 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 v19 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 v18 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 v19 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 v49 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 if ( (signed int)v18 >= 560 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 v20 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 *(char *)(v20 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 v21 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 memcpy((void *)(v20 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 v0->pEquipment.uOffHand = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 v22 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 v50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 v23 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 if ( (v23 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 v50 = (unsigned int)&v0->pInventoryItems[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 v0->pEquipment.uOffHand = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 if ( v52 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 v22 = *(int *)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 if ( !v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 v26 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 if ( (v26 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 v50 = (unsigned int)&v0->pInventoryItems[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 v0->pEquipment.uMainHand = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 v24 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 *(char *)(v24 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 pParty->SetHoldingItem((ItemGen *)(v24 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 v25 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 memcpy((void *)(v24 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 v0->pEquipment.uMainHand = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 v50 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 if ( v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 stru_A750F8[uActiveCharacter - 1]._494836(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 *((int *)&pSpellDatas[66].field_8 + v50),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 uActiveCharacter - 1 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 if ( v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 v27 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 *(char *)(v27 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 pParty->SetHoldingItem((ItemGen *)(v27 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 v28 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 memcpy((void *)(v27 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 v0->pEquipment.uMainHand = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 if ( (v52 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 v29 = (int)((char *)v0 + 36 * (v54 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 *(char *)(v29 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 pParty->SetHoldingItem((ItemGen *)(v29 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 v30 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 v0->pEquipment.uMainHand = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 v31 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 v0->pEquipment.uMainHand = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 v0->UseItem_DrinkPotion_etc(uActiveCharacter, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 v32 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 v33 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 v49 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 v48 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 v32 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 v33 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 v36 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 v37 = (int)((char *)v0 + 36 * v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 v50 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 v38 = (ItemGen *)(v37 + 532);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 v14 = v38->uItemID == 604;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 v52 = pItemsTable->pItems[v38->uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 LABEL_95:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 if ( unk_50C9A0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 v39 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 *((int *)ptr_507BD4->ptr_1C + 3) = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 *((short *)ptr_507BD4->ptr_1C + 3) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 ptr_50C9A4 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 unk_50C9A0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 dword_50C9D4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 dword_50C9D0 = 113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 dword_50C9D8 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 if ( !ptr_50C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 pParty->SetHoldingItem(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 *(&v0->uBirthYear + *(char *)(v50 + 556)) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 v38->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 v35 = v0->pEquipment.uBow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 auto _a = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v35 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 pParty->SetHoldingItem(_a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 _a->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 v0->pEquipment.uBow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 //----- (0046A0A1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17165 int __thiscall UnprojectX(int x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 v1 = pGame->pIndoorCameraD3D->flt_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 //----- (0046A0F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 int __thiscall UnprojectY(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 v1 = pGame->pIndoorCameraD3D->flt_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 return stru_5C6E00->Atan2(_this - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 //----- (0046A14B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 char __cdecl OnPressSpace()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 SHORT v0; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 int *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 char *v2; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 unsigned int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 signed int v4; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 unsigned int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 int v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 int v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 int v8; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 int *v9; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 signed int v10; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 int i; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 int v12; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 int v13; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 int j; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 int v16; // [sp+4h] [bp-1Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 char *v17; // [sp+8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 unsigned int v18; // [sp+Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 int v19; // [sp+10h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 int *v20; // [sp+14h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 int *v21; // [sp+18h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 int v22; // [sp+1Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 v0 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 pGame->_44EB12((v0 & 0x8001) != 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 v1 = (int *)pGame->pVisInstance->get_picked_object_zbuf_val();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 if ( v1 != (int *)-1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 LOBYTE(v1) = DoInteractionWithTopmostZObject((unsigned __int16)v1, (signed int)(unsigned __int16)v1 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 v2 = (char *)v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 v1 = (int *)((char *)v1 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 v3 = 640 * viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 v20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 if ( (signed int)v2 >= (signed int)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 v4 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v7 = *v1 & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 if ( v4 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 if ( dword_7207F0[v6] == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 v19 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 while ( v6 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 if ( (v7 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 v16 = (unsigned int)v7 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 if ( (signed int)(((unsigned int)*v21 >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17284 if ( (unsigned int)*v21 > 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 if ( v19 == v22 && v4 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 v8 = *v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 dword_7207EC[v4] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 dword_72065C[v4] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 v1 = v21 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 v21 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 v2 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 v3 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 if ( v22 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 v9 = dword_720660;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 for ( i = v10; i < v22; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 v12 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 v13 = dword_720660[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 if ( v13 < *v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 *v9 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 dword_720660[i] = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 LOBYTE(v1) = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 while ( v10 - 1 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 for ( j = 0; j < v22; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 if ( !(char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 // 72065C: using guessed type int dword_72065C[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 // 7207EC: using guessed type int dword_7207EC[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 //----- (0046A334) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 BLVFace *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 unsigned int v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 unsigned __int16 v6; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 ODMFace *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 LevelDecoration *v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 __int16 v9; // ax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 int v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 int v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 int v12; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 Actor *v13; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 unsigned __int16 v14; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 unsigned __int16 v15; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 const char *v16; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 int v17; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 int v18; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 ItemGen *v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 unsigned int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 int v21; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 std::string v22; // [sp-18h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 const char *v23; // [sp-8h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 int v24; // [sp-4h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 char v25; // [sp+8h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 int v26; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 int a3; // [sp+13h] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 switch ( a1 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 v17 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 v26 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 v18 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 || v17 >= 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 || !pLayingItems[v18].uObjectDescID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 v19 = &pLayingItems[v18].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 v20 = pLayingItems[v18].stru_24.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 if ( pItemsTable->pItems[v20].uEquipType == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 party_finds_gold(v19->uAdditionalValue, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 v21 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 ShowStatusBarString(pTmpBuf2, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 if ( v19->uItemID == 506 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 _449B7E_toggle_bit((char *)pParty->_award_bits, 184, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 if ( v19->uItemID == 455 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 _449B7E_toggle_bit((char *)pParty->_award_bits, 185, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 if ( !pParty->AddItem(v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 pParty->SetHoldingItem(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 v21 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 LayingItem::_42F933(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 v12 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 v13 = &pActors[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 v14 = v13->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 if ( v14 == 4 || v14 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 if ( v14 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 stru_50C198.LootActor(&pActors[a1 >> 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 if ( !v13->GetActorsRelation(0) && !(BYTE2(v13->uAttributes) & 8) && v13->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 Actor::FaceObject(v12, 4u, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 if ( v13->uNPC_ID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 v15 = pNPCStats->pGroups_copy[v13->uGroup];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 v16 = pNPCStats->pCatchPhrases[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 strcpy(byte_5B0938, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 sub_4451A8_press_any_key(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 v8 = &pLevelDecorations[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 v9 = v8->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 EventProcessor(v9, a1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 LOBYTE(v8->field_2) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 if ( !pLevelDecorations[a1 >> 3].IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 v10 = v8->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 v11 = stru_5E4C90.field_0[v10] + 380;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 _5C3420_pDecoration = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 if ( (a1 & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 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
17473 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 if ( a1 >> 9 >= pOutdoor->uNumBModels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uFaceAttributes) & 0x10)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 || (v6 = v7->sCogTriggeredID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 EventProcessor((signed __int16)v6, v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 v4 = &pIndoor->pFaces[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 v5 = v4->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 if ( !(v5 & 0x2000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 ShowNothingHereStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17493 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 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
17495 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 // 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
17501
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 //----- (0046A6AC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 int __fastcall sub_46A6AC(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 unsigned int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 int *v5; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 signed int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 unsigned __int16 v8; // ax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 int i; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 int v11; // [sp+0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 unsigned int v12; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 unsigned int v13; // [sp+8h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 int v14; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 int *v15; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 int v16; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 result = sub_46A7C8(a1, a2, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 v4 = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 v12 = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 v15 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17534 v13 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 if ( (signed int)v4 < (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 v5 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 v6 = ((v12 - v4 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 if ( (*(char *)v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 if ( *v5 <= a3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 v7 = (signed int)(unsigned __int16)*v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 v8 = pActors[v7].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 if ( v8 != 4 && v8 != 11 && v8 != 17 && v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 for ( i = 0; i < v16; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 if ( *(int *)(v14 + 4 * i) == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 if ( i == v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 if ( i < v11 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 v10 = v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 *(int *)(v14 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 v5 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17573 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17575 v15 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17576 --v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 result = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 //----- (0046A7C8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 int __fastcall sub_46A7C8(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17590 unsigned int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 unsigned int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17592 unsigned int v7; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 unsigned __int16 v8; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 float v9; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 unsigned int v12; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17597 int v13; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 int v14; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 int v15; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 unsigned int a1a; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 v13 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 v14 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 a1a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 v12 = pRenderer->GetBillboardDrawListSize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17607 if ( (signed int)v12 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17611 v3 = pRenderer->GetParentBillboardID(a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 v4 = pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17614 if ( (v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 if ( v4 <= (unsigned int)(a3 << 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 v6 = v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620 v8 = pActors[v6].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17623 if ( v8 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 if ( v8 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17627 if ( v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17629 if ( v8 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 v9 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 if ( v15 < v14 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 v10 = v15++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17637 *(int *)(v13 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 ++a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 while ( (signed int)a1a < (signed int)v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 return v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 //----- (0046A89E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 int __fastcall sub_46A89E(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 unsigned int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 unsigned int v10; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 unsigned int v11; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 __int16 v12; // ax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 int v13; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 int v15; // [sp+4h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 int v16; // [sp+8h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 int v17; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 int v18; // [sp+10h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17672 int v19; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 v16 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 v5 = abs(*((short *)v4 - 17) - pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 v17 = abs(*((short *)v4 - 16) - pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17685 v18 = abs(*((short *)v4 - 15) - pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 v7 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 v8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 if ( v6 < v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17691 v9 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 v7 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 if ( v6 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 v10 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 v6 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 v8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 if ( v7 < (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17704 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 v7 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 v12 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 if ( *(short *)v4 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 if ( v12 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 if ( v12 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 if ( v12 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 if ( v12 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 v13 = v19++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17721 *(int *)(v16 + 4 * v13) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 if ( v19 >= v15 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733 while ( v3 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 //----- (0046A99B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 int __cdecl sub_46A99B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17745 signed int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 int *v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17748 int v7; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 int v8; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 int v9; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 unsigned __int8 v10; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 char v11; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 char v12; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754 int *v14; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 signed int v15; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 int i; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 int v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 int v18; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 int v19; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 unsigned int v20; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 BLVFace *v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 unsigned int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 const char *v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 const char *v24; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17765 LevelDecoration *v25; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 LevelDecoration *v26; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 __int16 v27; // ax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 int v28; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 int v29; // [sp+14h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 int v30; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 signed int v31; // [sp+1Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17772 int v32; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 v1 = (signed int)(viewparams->uScreenW + viewparams->uScreenY) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 v2 = (signed int)(viewparams->uScreenX + viewparams->uScreenZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 v3 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 v30 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 v28 = v1 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 if ( v1 - 50 >= v1 + 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 v5 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 v29 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 v31 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17789 v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17790 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 v8 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 if ( (unsigned int)*v6 <= 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 while ( v9 < v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 if ( v9 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 if ( v8 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 dword_720020_zvalues[v7] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 dword_7201B0_zvalues[v7] = (unsigned __int16)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17815 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 v32 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 if ( v7 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 if ( !v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 v4 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17832 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17833 v5 = v29 + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17834 v29 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 if ( v30 < v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17837 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17841 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 if ( !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17844 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 if ( !((unsigned __int8)(v11 ^ v12) | v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 v14 = dword_720020_zvalues;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 for ( i = v15; i < v32; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 v17 = dword_720020_zvalues[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 if ( v17 < *v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 dword_720020_zvalues[i] = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17857 *v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17860 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17861 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17863 while ( v15 - 1 < v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 v0 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 if ( v0 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 v19 = dword_720020_zvalues[v18] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17872 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 if ( (dword_720020_zvalues[v18] & 7) == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17875 if ( v20 >= 0x3E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17876 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17877 if ( !(pLayingItems[v20].uAttributes & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17879 v23 = pLayingItems[v20].stru_24.GetDisplayName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17881 v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17884 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 if ( (dword_720020_zvalues[v18] & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 if ( v20 >= 0xBB8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 v24 = (const char *)&pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17893 if ( (dword_720020_zvalues[v18] & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17895 if ( (dword_720020_zvalues[v18] & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 v21 = &pIndoor->pFaces[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 if ( !(BYTE3(v21->uAttributes) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17901 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17906 if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 >= pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 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
17909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17912 v23 = _444732_GetEventHintString(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17913 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17917 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17918 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17919 if ( v18 >= v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 v25 = &pLevelDecorations[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17923 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17924 v27 = v25->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 v23 = _444732_GetEventHintString(v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17928 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17929 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17930 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17932 if ( v25->IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 v24 = (const char *)dword_722240[2 * stru_5E4C90.field_0[v26->field_1C]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17935 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17936 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 sub_41C0B8_set_status_string(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17941 //----- (0046AC59) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17942 std::string *__fastcall crt_intit_global_46AC59(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 size_t v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17946 //std__string_720990.field_0 = BYTE3(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17947 //std::string::dtor(&std__string_720990, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17948 //v1 = strlen("micon1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 //return std::stringoperator_assign__const_char_ptr__(&std__string_720990, "micon1", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 std__string_720990 = "micon1";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 return &std__string_720990;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 //----- (0046BDA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17958 unsigned int __cdecl GetGravityStrength()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 v0 = ~LOBYTE(pGame->uFlags2) & 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17963 LOBYTE(v0) = v0 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17964 return (unsigned int)v0 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17967 //----- (0046BDC0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 if ( dword_6BE364_game_settings_1 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 BLV_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 ODM_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 _438F8F_area_of_effect__damage_evaluate();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17989
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17991 //----- (0046BDF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17992 void __cdecl BLV_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17994 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17995 BLV_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17996 UpdateActors_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17997 BLV_UpdateDoors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17998 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 //----- (0046BE0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 void __cdecl ODM_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18004 bool v0; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18005 int pOut; // [sp+8h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18007 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18008 ODM_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18009 if ( pParty->vPosition.x < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18010 || pParty->vPosition.x > 22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18011 || pParty->vPosition.z < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18012 || pParty->vPosition.z > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18014 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18015 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.z, (char *)&pOut, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18016 if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18018 if ( pParty->vPosition.x < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18019 pParty->vPosition.x = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 if ( pParty->vPosition.x > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 pParty->vPosition.x = 22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18022 if ( pParty->vPosition.z < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18023 pParty->vPosition.z = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18024 if ( pParty->vPosition.z > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 pParty->vPosition.z = 22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18029 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 UI_CreateTravelDialogue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18033 UpdateActors_ODM();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18034 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 //----- (0046BEF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 void LayingItem::_46BEF1_apply_spells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 LayingItem *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18045 __int16 v3; // fps@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 unsigned __int8 v4; // c0@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 unsigned __int8 v5; // c3@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 signed int v6; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18052 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18054 v2 = (char *)&pActors[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18055 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18057 if ( ((Actor *)(v2 - 144))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18059 //UNDEF(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 if ( !(v4 | v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 if ( stru_50C198.GetMagicalResistance((Actor *)(v2 - 144), 0xAu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18064 ((SpellBuff *)&v2[16 * v1->field_48 + 68])->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 v1->field_50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 *(v2 - 106) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18077 while ( v6 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18080
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 //----- (0046BFFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 LayingItem *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 ObjectDesc *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 unsigned __int16 v5; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 unsigned __int16 v6; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 signed int v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 unsigned int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 unsigned int v9; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 signed int v10; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 char *v11; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18094 unsigned __int16 v12; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 unsigned int v14; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 unsigned __int16 v15; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18098 int v16; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18099 unsigned int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 __int16 v18; // di@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 signed int v19; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 unsigned __int8 v20; // sf@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 char *v21; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 unsigned __int16 v22; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 unsigned int v23; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 signed int v24; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 char *v25; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18108 int v26; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 int v27; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 int v28; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 int v29; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 unsigned __int16 v30; // ax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 unsigned int v31; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 int v32; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 unsigned int v33; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 signed int v34; // edx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 char *v35; // ecx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 unsigned __int16 v36; // ax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 int v37; // ST14_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 int v39; // ST10_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 int v40; // ST0C_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 int v41; // edx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18124 int v42; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 int v43; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 unsigned __int8 v44; // zf@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 int v45; // edx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 unsigned __int16 v46; // ax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 int v47; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 int v48; // edx@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 int v49; // edx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 int v50; // edx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18133 unsigned int v51; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 signed int v52; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 char *v53; // edx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 unsigned __int16 v54; // ax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 unsigned int v55; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 signed int v56; // ebx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 char *v57; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18140 unsigned __int16 v58; // ax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18141 unsigned __int16 v59; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18142 unsigned int v60; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 signed int v61; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18144 char *v62; // edx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 unsigned __int16 v63; // ax@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 int v64; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 signed int v65; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 unsigned int v66; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 unsigned __int16 v67; // ax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18150 unsigned int v68; // ecx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18151 signed int v69; // ebx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 char *v70; // edx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 unsigned __int16 v71; // ax@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 unsigned int v72; // ebx@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 int v73; // ST14_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 int v74; // ST10_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 int v75; // ebx@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18158 int v76; // ST0C_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18159 unsigned __int16 v77; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 int v78; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 char v79; // zf@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 unsigned int v80; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 signed int v81; // edx@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 char *v82; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 unsigned __int16 v83; // ax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 unsigned __int16 v84; // ax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18167 unsigned int v85; // ecx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18168 signed int v86; // ebx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18169 char *v87; // edx@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18170 unsigned __int16 v88; // ax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18171 unsigned int v89; // eax@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18172 int v90; // ST34_4@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 int v91; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 unsigned int v92; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175 unsigned int v93; // eax@177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176 char *v94; // ecx@178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177 unsigned __int16 v95; // ax@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 unsigned __int16 v96; // ax@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 int v97; // eax@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 unsigned __int16 v98; // ax@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 unsigned int v99; // ecx@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 char v100; // ST18_1@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 int v101; // ST14_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 int v102; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18185 int v103; // ST10_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18186 int v104; // ST0C_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18187 unsigned __int16 v105; // ax@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18188 signed int v106; // eax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18189 unsigned int v107; // edx@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 signed int v108; // ebx@225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 unsigned int v109; // eax@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 signed int v110; // ebx@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 char *v111; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 unsigned __int16 v112; // ax@238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 unsigned __int16 v113; // si@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 int v114; // eax@242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 int v115; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 signed int v116; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 unsigned __int16 v117; // ax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 unsigned int v118; // ecx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 signed int v119; // ebx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 char *v120; // edx@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18203 unsigned __int16 v121; // ax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18204 unsigned int v122; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 char *v123; // edx@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 int v124; // eax@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18207 int v125; // [sp-20h] [bp-4Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 signed int v126; // [sp-1Ch] [bp-48h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 unsigned int v127; // [sp-18h] [bp-44h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 signed int v128; // [sp-14h] [bp-40h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211 signed int v129; // [sp-10h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212 int v130; // [sp-Ch] [bp-38h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 unsigned int v131; // [sp-8h] [bp-34h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 char v132; // [sp-8h] [bp-34h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 int v133; // [sp-4h] [bp-30h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 char v134; // [sp-4h] [bp-30h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 signed int v135; // [sp-4h] [bp-30h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 int v136; // [sp+Ch] [bp-20h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 int v137; // [sp+10h] [bp-1Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 signed int v138; // [sp+14h] [bp-18h]@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 signed int v139; // [sp+18h] [bp-14h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 char *v140; // [sp+1Ch] [bp-10h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 signed int v141; // [sp+1Ch] [bp-10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 unsigned int v142; // [sp+1Ch] [bp-10h]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 signed int v143; // [sp+1Ch] [bp-10h]@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 char *v144; // [sp+1Ch] [bp-10h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 signed int v145; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 signed int v146; // [sp+20h] [bp-Ch]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 int v147; // [sp+20h] [bp-Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 signed int v148; // [sp+20h] [bp-Ch]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 int v149; // [sp+20h] [bp-Ch]@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233 int v151; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 signed int v152; // [sp+24h] [bp-8h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 unsigned int v153; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 v153 = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 v2 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 v3 = &pObjectList->pObjects[v2->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 v145 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 v151 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 if ( (v2->field_58 & 7) == 3 && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 if ( (a2 & 7) == 4 && (v2->field_58 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 v5 = v2->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 if ( v5 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 v2->uAttributes = v5 & 0xFFFB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 if ( v151 == 6 && (v2->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 v6 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 v7 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 if ( v7 > 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 if ( v7 > 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 if ( v7 > 8090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 if ( v7 == 9010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 if ( v7 != 9040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 if ( v7 != 9080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 LABEL_191:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 v98 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 v99 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 v2->uItemType = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 if ( (signed int)v99 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 v144 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 while ( v98 != *(short *)v144 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 v144 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 if ( v146 >= (signed int)v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 LABEL_195:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 LABEL_172:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 v143 = 17030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 switch ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 case 0x1798u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 v143 = 15040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 case 0xFAAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 v143 = 13010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 case 0x2346u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 v143 = 18030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 v138 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 if ( v6 != 9030 || v2->field_50 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 goto LABEL_246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 if ( !v138 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 v109 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 if ( (signed int)v109 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 LABEL_238:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 v111 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 while ( v2->uItemType != *(short *)v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 ++v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 v111 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 if ( v110 >= (signed int)v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 goto LABEL_238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 v112 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 v2->uObjectDescID = v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 if ( !v112 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 v113 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 if ( v113 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 v114 = (signed __int16)v113 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 v130 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 v115 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 LOBYTE(v115) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 v126 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 v116 = v143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 goto LABEL_269;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 LABEL_246:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 v106 = v145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 v150 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 v139 = v106 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 v137 = v2->field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 v152 = v2->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 v136 = v2->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 if ( v6 == 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 v150 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 if ( v152 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 v150 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 if ( v152 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 v150 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 BYTE2(pActors[v139].uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 if ( v7 == 6040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 v135 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 if ( v7 == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 v135 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 v107 = v136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 LABEL_222:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 if ( v6 != 9030 || v152 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 v108 = v139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 v138 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 if ( v2->uItemType == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 pActors[v108].uAIState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 pActors[v108].UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[v136] + v108 * 836))->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423 v152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 v150,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 v2->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 v2->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 v2->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 v135 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 v107 = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 goto LABEL_222;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 if ( v7 == 8090 || v7 == 7030 || v7 == 7090 || v7 == 8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 if ( v7 == 8010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 if ( v151 == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 v93 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 if ( (signed int)v93 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 v94 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 while ( v2->uItemType != *(short *)v94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 v94 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 if ( v52 >= (signed int)v93 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 v79 = v7 == 8030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 if ( v7 == 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 if ( v7 <= 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 if ( v7 != 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 v48 = v7 - 3090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 v49 = v48 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 v50 = v49 - 908;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 v45 = v50 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 goto LABEL_91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 v54 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 v55 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 v2->uItemType = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 LABEL_102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 v57 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 while ( v54 != *(short *)v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 v57 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 if ( v56 >= (signed int)v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 v58 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 v2->uObjectDescID = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517 if ( !v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 v15 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 if ( v15 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 v16 = (signed __int16)v15 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 v130 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 v92 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 LABEL_267:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 v124 = 8 * v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 LOBYTE(v124) = v124 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 v126 = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 LABEL_268:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 v116 = word_4EE088_sound_ids[v2->field_48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 LABEL_269:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 v125 = v116 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 v59 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 v60 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 v2->uItemType = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 LABEL_111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 v62 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 while ( v59 != *(short *)v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 v62 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 if ( v61 >= (signed int)v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 goto LABEL_111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 v63 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572 v2->uObjectDescID = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 if ( !v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 v44 = v2->field_50 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 v65 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582 v65 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 if ( v65 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 v141 = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 v64 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 v2->Create(v64, 0, 1000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 --v141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 while ( v141 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 LABEL_160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 LayingItem::_42F933(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 v67 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 v68 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 v2->uItemType = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 LABEL_128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 v70 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 while ( v67 != *(short *)v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 v70 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 if ( v69 >= (signed int)v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 v71 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 v2->uObjectDescID = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 v132 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 LABEL_132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 v73 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 v74 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 v75 = 8 * v72 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 v2->vVelocity.z = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 v2->vVelocity.y = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 v76 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 v2->vVelocity.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 v2->uSpriteFrameID = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 stru_50FE08.Add(v75, 512, v76, v74, v73, v132, v134);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 v77 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 if ( v77 == (short)v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 v78 = (signed __int16)v77 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 v133 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 v131 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 v130 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 v129 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 v127 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 v126 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 if ( v7 == 4090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 v84 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 v85 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 v2->uItemType = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 LABEL_155:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 v87 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 while ( v84 != *(short *)v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 v87 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 if ( v86 >= (signed int)v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677 goto LABEL_155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 v88 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 v2->uObjectDescID = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 if ( !v88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 v142 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 v148 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 pRnd->SetRange(-128, 128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 v90 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 pRnd->SetRange(5, 500);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 v91 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 v2->Create(v90 + v142, 0, v91, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 --v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 while ( v148 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701 goto LABEL_160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 if ( v7 == 4092 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 v80 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710 v2->uItemType = 4091;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 LABEL_144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 v82 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 while ( *(short *)v82 != 4091 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722 v82 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723 if ( v81 >= (signed int)v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724 goto LABEL_144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 v83 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728 v2->uObjectDescID = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 v132 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 goto LABEL_132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 if ( v7 == 4100 || v7 == 6010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 v79 = v7 == 6040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18740 if ( !v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18741 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18742 goto LABEL_172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18744 if ( v7 == 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 if ( v7 <= 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 if ( v7 == 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 v23 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 if ( (signed int)v23 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18760 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18762 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 while ( v2->uItemType != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 if ( v24 >= (signed int)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770 v22 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773 v2->uObjectDescID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 if ( v22 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776 v2->vVelocity.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 v2->vVelocity.y = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 v2->vVelocity.x = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 v2->uSpriteFrameID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 switch ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 case 500:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 case 505:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 case 510:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 case 515:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 case 520:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 case 525:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791 case 530:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 case 535:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 case 540:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 v8 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 if ( (signed int)v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 v11 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 case 545:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 case 550:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 if ( v2->stru_24.uItemID != 405 && v2->stru_24.uAdditionalValue != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18808 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18810 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 v17 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 v2->uItemType = 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 v21 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18825 while ( *(short *)v21 != 600 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18827 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 v21 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 if ( v19 >= (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 v22 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 while ( v2->uItemType != *(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 v11 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 if ( v10 >= (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18843 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18845 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850 v2->uObjectDescID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853 v44 = v2->uItemType == 555;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 if ( !v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 if ( v7 > 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 v41 = v7 - 2030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868 v42 = v41 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 if ( v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871 v43 = v42 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874 v45 = v43 - 910;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 LABEL_91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 if ( !v44 && v45 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 v51 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 if ( (signed int)v51 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 v53 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 while ( v2->uItemType != *(short *)v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 v53 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 if ( v52 >= (signed int)v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 v2->uObjectDescID = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 if ( v95 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 v96 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 v2->vVelocity.z = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 v2->vVelocity.y = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 v2->vVelocity.x = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 v2->uSpriteFrameID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 if ( v96 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 v97 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 v97 = (signed __int16)v96 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 v130 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916 v92 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 goto LABEL_267;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919 if ( v7 == 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 v26 = v7 - 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 v33 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 v2->uItemType = 601;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 v35 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 while ( *(short *)v35 != 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 v35 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 if ( v34 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 v36 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 v2->uObjectDescID = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 if ( !v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 v37 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 v38 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 v39 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 LOBYTE(v38) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 v40 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 v147 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 stru_50FE08.Add(v38, 512, v40, v39, v37, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, 0, v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 v126 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 v27 = v26 - 410;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 v28 = v27 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 goto LABEL_191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 v29 = v28 - 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 if ( v29 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 v30 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 v31 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 v2->uItemType = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 if ( (signed int)v31 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 v140 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 while ( v30 != *(short *)v140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 v140 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 if ( v146 >= (signed int)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 v46 = v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 v2->uObjectDescID = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 if ( v46 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 v100 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 v101 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 v2->uSpriteFrameID = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 v102 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 v103 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 LOBYTE(v102) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 v2->vVelocity.x = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 v2->vVelocity.y = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 v104 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 v2->vVelocity.z = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 v149 = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 array_5118E8._440E91(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 v2->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 v2->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 v2->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 v105 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 if ( v105 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 v47 = (signed __int16)v105 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 v133 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 v131 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 v130 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 v129 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 v127 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 v126 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 if ( v151 == 6 || v151 == 5 || (v9 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 if ( v151 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 v122 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 if ( (signed int)v122 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 v123 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 while ( v2->uItemType != *(short *)v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 v123 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 if ( v52 >= (signed int)v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 LABEL_202:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 v95 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 v117 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 v118 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 v2->uItemType = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 v120 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 while ( v117 != *(short *)v120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 v120 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 if ( v119 >= (signed int)v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 v121 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 v2->uObjectDescID = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 if ( !v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 v130 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 v13 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 LOBYTE(v13) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 v125 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114