annotate mm7_2.cpp @ 117:a64b244da76c

some things lod
author Nomad
date Tue, 13 Nov 2012 17:29:38 +0200
parents 430786d916d6
children 05b2d9653abc 6d1f537a1346
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>
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
3 #include <assert.h>
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "GUIButton.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "GUIFont.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 #include "PaletteManager.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 #include "stru287.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 #include "stru157.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 #include "TileFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 #include "PlayerFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 #include "Awards.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #include "Autonotes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 #include "stru160.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 #include "FactionTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 #include "StorylineTextTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 #include "Random.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 #include "stru277.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 #include "stru298.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 #include "stru12.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 #include "stru351.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 #include "Events2D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 #include "stru159.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 //----- (004B4F4F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 char *__cdecl sub_4B4F4F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 const char *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 const char *v1; // ST10_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 unsigned __int16 v2; // ST0C_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 GUIWindow v5; // [sp+8h] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 memcpy(&v5, ptr_507BC0, sizeof(v5));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 v0 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 v1 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 v5.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v5.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 v5.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 return v5.DrawText2(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 //----- (004B68EA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 bool __fastcall sub_4B68EA(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 v2 = &dword_4F0E10[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 v3 = 8 * *((char *)v2 + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v3])) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 if ( v1 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 return 1;
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 //----- (004B7911) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 void __cdecl sub_4B7911()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 int v1; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 int v2; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 GUIFont *v3; // ST20_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 int v4; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 MonsterInfo *v5; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 unsigned int v6; // ST20_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 char *v7; // ST1C_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 unsigned int v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 int v9; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 char *v10; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 signed int v11; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 signed int i; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 GUIWindow *v14; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 __int64 v15; // qax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 signed int v16; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 int v17; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 unsigned __int8 v18; // sf@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 char **v19; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 GUIButton *v20; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 GUIButton *v21; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 unsigned int v23; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 unsigned __int16 v24; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 GUIWindow a1; // [sp+Ch] [bp-110h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 GUIWindow w; // [sp+60h] [bp-BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 GUIWindow _this; // [sp+B4h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 int v28; // [sp+108h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 int v29; // [sp+10Ch] [bp-10h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 int v30; // [sp+110h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 int v31; // [sp+114h] [bp-8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 _this.DrawText2(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 if ( pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 v11 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 for ( i = 0; i < v11; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 pOutString = (GUIFont *)((char *)pOutString + v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 v29 = (100 - (signed int)pOutString) / v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 v16 = v15 - HIDWORD(v15);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
170 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
171 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v17 = (v16 >> 1) - v29 / 2 + 158;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
173 v18 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
174 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v31 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 v19 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v20 = v14->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v20->uY = v29 + v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 v23 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v21->uHeight = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 v17 = v23 + v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 v21->uW = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 v24 = v30;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
190 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 _this.DrawText2(pFontArrus, 0, v23, v24, *v19, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 pOutString = (GUIFont *)((char *)pOutString + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
198 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 if ( dword_F8B19C != 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 if ( dword_F8B19C != 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 if ( ptr_507BC0->field_40 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 sprintfex(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 _this.DrawText2(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 _this.DrawText2(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v3 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 v2 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 if ( v1 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 if ( v1 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 v2 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 if ( v2 > pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 v2 = pParty->uFine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 Party::TakeGold(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 pParty->uFine -= v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 if ( pParty->uFine < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 pParty->uFine = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 if ( ptr_507BC0->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v5 = &pMonsterStats->pInfos[word_F8B1A0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v7 = v5->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 sprintfex(pTmpBuf, &byte_4F0F98, v8, v7, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 ptr_F8B1E8 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 memcpy(&a1, pDialogueWindow, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 w.uFrameWidth = 458;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 w.uFrameZ = 457;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 if ( 352 - v9 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 352 - v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 (pTex ? pTex->uTextureHeight : 26) - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 // F8B1A0: using guessed type __int16 word_F8B1A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 //----- (004B7D7E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 void __cdecl _4B7D7E_bank()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 int v1; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 unsigned int v3; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 GUIFont *v4; // ST10_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 int v6; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 unsigned int v7; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 unsigned __int16 v8; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 unsigned __int16 v9; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 char *v10; // [sp-8h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 char *v11; // [sp-4h] [bp-6Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 __int16 v13[2]; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 __int16 v14[2]; // [sp+64h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 _this.DrawText2(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 if ( dword_F8B19C == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 if ( v6 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 v7 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 pParty->uNumGoldInBank += v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 if ( v1 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 v10 = pGlobalTXT_LocalizationStrings[60];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 if ( dword_F8B19C != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 ptr_507BC0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 if ( v2 > pParty->uNumGoldInBank )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 v3 = pParty->uNumGoldInBank;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 Party::SetGold(pParty->uNumGold + v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 pParty->uNumGoldInBank -= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 v10 = pGlobalTXT_LocalizationStrings[244];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 sprintfex(pTmpBuf, "%s\n%s", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 _this.DrawText2(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 _this.DrawText2(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 v4 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 v8 = v14[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
407 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 v8 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 _this.DrawText2(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 v9 = v14[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
411 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v9 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 _this.DrawText2(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 //----- (004B8285) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 void __cdecl sub_4B8285_prolly_draw_arcomage_result()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 Player *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 signed int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 signed int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 GUIWindow *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 signed int v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 unsigned int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 int v11; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 unsigned int v12; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 int v14; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 GUIButton *v15; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 GUIButton *v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 int v17; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 char *v18; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 int v19; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 unsigned int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 int v21; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 unsigned __int16 v23; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 int v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 int v25; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 char *v26; // esi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 int v27; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 unsigned int v28; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 unsigned int v30; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 signed int v31; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 unsigned int v32; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 GUIWindow *v33; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 int v34; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 int v35; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 int v36; // esi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 char v37; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 GUIButton *v38; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 int v39; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 int v40; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 int v41; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 int v42; // ecx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 unsigned int v43; // edx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 int v44; // edx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 int v45; // ecx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 int v46; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 int v47; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 signed int v48; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 signed int i; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 int v50; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 GUIWindow *v51; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 _QWORD v52; // qax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 signed int v53; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 int v54; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 GUIButton *v55; // esi@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 const char **v56; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 int v57; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 unsigned int v58; // ecx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 Player *v59; // edx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 unsigned __int16 v60; // ax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 int v61; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 int v62; // edi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 char *v63; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 GUIFont *v64; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 GUIFont *v65; // edi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 unsigned int v66; // [sp-10h] [bp-284h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 int v68; // [sp-Ch] [bp-280h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 char *v69; // [sp-8h] [bp-27Ch]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 int v70; // [sp-8h] [bp-27Ch]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 unsigned int v71; // [sp-4h] [bp-278h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 const char *v72; // [sp-4h] [bp-278h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 unsigned int v73; // [sp-4h] [bp-278h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 char Dest; // [sp+Ch] [bp-268h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 char v75; // [sp+70h] [bp-204h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 char a1; // [sp+D4h] [bp-1A0h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 char v77; // [sp+138h] [bp-13Ch]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 GUIWindow v79; // [sp+1F0h] [bp-84h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 char *Str[2]; // [sp+244h] [bp-30h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 unsigned int v81; // [sp+24Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 unsigned __int8 v82; // [sp+253h] [bp-21h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 int v83; // [sp+254h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 __int16 v84[2]; // [sp+258h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 Player *v85; // [sp+25Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 int v86; // [sp+260h] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 int v89; // [sp+268h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 GUIFont *pOutString; // [sp+270h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 memcpy(&v79, ptr_507BC0, sizeof(v79));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 v85 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 v1 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 v79.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 v79.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 v79.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 v81 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 *(int *)v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 //v2 = p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 v2 = p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 *(float *)&v83 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 *(float *)&v89 = v2 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 v3 = (signed __int64)(*(float *)&v89 * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 v4 = v3 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 if ( v4 < v3 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v4 = v3 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 pOutString = (GUIFont *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 pOutString = (GUIFont *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 v7 = v6 * (100 - v85->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 if ( v7 < v6 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 v7 = v6 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 v83 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 if ( dword_F8B19C > 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 if ( dword_F8B19C == 102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 v65 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 pOutString = pFontArrus;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
550 strcpy(pTmpBuf, pNPCTopics[354].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 v62 = v65->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 if ( 352 - v62 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 v62 = pFontCreate->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 352 - v62,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 (pTex ? pTex->uTextureHeight : 26) - v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v63 = FitTextInAWindow(pTmpBuf, pOutString, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 v64 = pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 if ( dword_F8B19C != 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 if ( dword_F8B19C != 104 || pArcomageGame->bGameInProgress == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 if ( pArcomageGame->uGameResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 if ( pArcomageGame->uGameResult == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 strcpy(pTmpBuf, v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 LABEL_97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 v69 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 v67 = v84[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
600 strcpy(pTmpBuf, pNPCTopics[(uint)ptr_507BC0->ptr_1C + 247].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 v62 = v61 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 352 - (v61 + 7),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 (pTex ? pTex->uTextureHeight : 26) - (v61 + 7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 v64 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 ptr_507BC0->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 if ( dword_F8B19C != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 if ( dword_F8B19C == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 if ( pParty->uNumGold >= (unsigned int)pOutString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 Party::TakeGold((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 v27 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 sub_4B1D27();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 pMessageQueue_50CBD0->pMessages[0].param = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 if ( dword_F8B19C != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 v8 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 *(float *)&v89 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 v9 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 if ( (signed int)pOutString < v9 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 pOutString = (GUIFont *)(v9 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
666 v10 = v8->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
667 v11 = v10 + v8->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 if ( (signed int)v10 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 v12 = v8->GetControl(v10)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 if ( byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v12] && !v85->pActiveSkills[v12] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 v13 = pFontArrus->CalcTextHeight(pSkillNames[v12], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 v89 += v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
682 while ( (signed int)v10 < v8->pStartingPosActiveItem + v8->pNumPresenceButton );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 if ( v86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 v79.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 pOutString = (GUIFont *)((149 - v89) / v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 if ( (149 - v89) / v86 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 v14 = (149 - v86 * (signed int)pOutString - v89) / 2 - (signed int)pOutString / 2 + 162;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
691 v89 = v8->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 v83 = v14;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
693 if ( v89 < v89 + v8->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 v86 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 v15 = v8->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 v16 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 v17 = v15->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 if ( !byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v17] || v85->pActiveSkills[v17] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 v16->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 v16->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 v16->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 v18 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 v16->uY = (unsigned int)((char *)pOutString + v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 Str[1] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 v19 = pFontArrus->CalcTextHeight(v18, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 v20 = v16->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 v21 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 v16->uHeight = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 v22 = v19 + v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 v16->uW = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 v83 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 v23 = v84[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
720 if ( pDialogueWindow->pCurrentPosActiveItem != v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 v23 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 v79.DrawText2(pFontArrus, 0, v20, v23, Str[1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
724 v24 = v8->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 ++v89;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
726 v25 = v8->pStartingPosActiveItem + v24;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 while ( v89 < v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 goto LABEL_97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 *(_QWORD *)Str = pParty->uNumFoodRations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 pPlayers[uActiveCharacter]->PlaySound(67, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 if ( pParty->uNumGold >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 v28 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
772 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 v28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 sprintfex(&Dest, format_4E2DC8, v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 strcat(&Dest, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 v90 = pFontArrus->CalcTextHeight(&Dest, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 strcat(&Dest, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 v29 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
780 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 v29 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 sprintfex(&a1, format_4E2DC8, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 sprintfex(pTmpBuf2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 pGlobalTXT_LocalizationStrings[86],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 strcat(&a1, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 strcat(&a1, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 v30 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
792 if ( pDialogueWindow->pCurrentPosActiveItem != 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 v30 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 sprintfex(&v77, format_4E2DC8, v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 strcat(&v77, pGlobalTXT_LocalizationStrings[160]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 strcat(&v77, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v87 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 v31 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 if ( v31 >= 108 && v31 <= 120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 v32 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
804 if ( pDialogueWindow->pCurrentPosActiveItem != 5 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 v32 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 sprintfex(&v75, format_4E2DC8, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 strcat(&v75, pGlobalTXT_LocalizationStrings[611]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 v87 = pFontArrus->CalcTextHeight(&v75, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 v33 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 Str[1] = (char *)pDialogueWindow;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
812 v34 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
813 v35 = v34 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
815 v37 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
816 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 if ( !(v37 ^ __OFSUB__(v34, v35)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 sprintfex(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v69 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 v67 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 v66 = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 LABEL_98:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 v79.DrawText2(pFontArrus, 0, v66, v67, v69, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 v38 = v33->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 if ( v38->uControlParam == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v46 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 v38->uHeight = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v38->uY = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v41 = v46 + 145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 if ( v38->uControlParam == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 v44 = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 v45 = v90 + v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v38->uHeight = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 v38->uY = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 v41 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 if ( v38->uControlParam == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 if ( v38->uControlParam == 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v39 = v90 + 3 * v36 + v87 + v88 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v33 = (GUIWindow *)Str[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 v40 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v38->uHeight = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v38->uY = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 v41 = v39 + v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 v38->uW = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
862 v47 = v33->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 pOutString = (GUIFont *)((char *)pOutString + 1);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
864 if ( (signed int)pOutString >= v33->pNumPresenceButton + v47 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v42 = v90 + v88 + 2 * v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 v43 = v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v38->uY = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 v38->uHeight = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 v41 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 v48 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 if ( pParty->HasItem(0x28Bu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 v48 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 for ( i = 0; i < v48; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 v50 = pFontArrus->CalcTextHeight(pShopOptions[i], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 pOutString = (GUIFont *)((char *)pOutString + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v86 = (174 - (signed int)pOutString) / v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 v52 = 174 - v48 * (174 - (signed int)pOutString) / v48 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 v53 = v52 - HIDWORD(v52);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
894 LODWORD(v52) = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
895 HIDWORD(v52) = v52 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 v54 = (v53 >> 1) - v86 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
897 v37 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
898 v89 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 if ( v37 ^ __OFSUB__((int)v52, HIDWORD(v52)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 v85 = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 pOutString = (GUIFont *)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 v55 = v51->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 v56 = (const char **)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 v55->uY = v86 + v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 v57 = pFontArrus->CalcTextHeight(*v56, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v58 = v55->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 v59 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 v55->uHeight = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 v54 = v57 + v58 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v55->uW = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 v60 = v84[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
915 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v59 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 v60 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 v79.DrawText2(pFontArrus, 0, v58, v60, *(const char **)&pOutString->cFirstChar, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 v85 = (Player *)((char *)v85 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 pOutString = (GUIFont *)((char *)pOutString + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 ++v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
923 while ( v89 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 //----- (004B8E3D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 void *__cdecl GenerateShopItems()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 GUIWindow *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 int v3; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 int v5; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 bool v6; // ebp@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 void *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 signed int v9; // [sp-Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 v2 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 while ( v2 > 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 if ( v2 <= 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 v6 = v1 > 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v7 = v6 + 2 * v2 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v4 = word_4F0498[5 * v7];
102
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
956 __debugbreak();
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
957 //things happen around word_4F0400 actually
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
958 //v5 = *(short *)&aTooManyStation[2 * (5 * (v6 + 2 * v2) + rand() % 4) + 10];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 if ( v2 <= 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 v4 = word_4F0576[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 v9 = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 if ( v2 <= 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 if ( v1 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 v4 = word_4F0578[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 v9 = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v5 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 5] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 _t->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 //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
990 if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v3 = 5 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 v4 = word_4F03FE[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 v5 = word_4F0400[5 * v2 + rand() % 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 result = v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 *(int *)&pParty->field_16154[4 * (int)result] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 //----- (004B910F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 char *__cdecl sub_4B910F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 char *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 signed int v2; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 unsigned int v3; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 ItemGen *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 unsigned __int8 v6; // dl@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 char *v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 int v9; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 int v10; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 signed int v11; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 int v12; // ST08_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 int v14; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 char **v15; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 int v16; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 GUIWindow *v17; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 int v18; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 int v19; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 unsigned __int8 v20; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 GUIButton *v21; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 const char **v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 int v23; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 unsigned int v24; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 unsigned __int16 v26; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 signed int v27; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 int v28; // ST08_4@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 int v29; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 GUIWindow *v30; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 void *v31; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 signed int v32; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 unsigned int v33; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 int v34; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 unsigned int v35; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 int v36; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 __int32 v37; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 GUIButton *v38; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 GUIButton *v39; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 int v40; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 char *v41; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 int v42; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 unsigned int v43; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 const char **v44; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 int v45; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 unsigned __int16 v46; // ax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 int v47; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 const char **v48; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 unsigned int v49; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 Texture *v50; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 int v51; // edi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 int v52; // esi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 Texture *v53; // ST1C_4@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 int v54; // edi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 signed int v55; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 SHORT v56; // di@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 bool v57; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 const char *v58; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 POINT *v59; // esi@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 LONG v60; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 int v61; // eax@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 int v62; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 ItemGen *v63; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 int v64; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 int v65; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 char **v66; // edi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 int v67; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 GUIWindow *v68; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 int v69; // edx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 int v70; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 GUIButton *v71; // esi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 const char **v72; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 int v73; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 unsigned int v74; // ecx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 Player *v75; // edx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 unsigned __int16 v76; // ax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 GUIWindow *v77; // [sp-18h] [bp-110h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 int v78; // [sp-14h] [bp-10Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 ItemGen *v79; // [sp-10h] [bp-108h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 int v80; // [sp-10h] [bp-108h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 void *v81; // [sp-Ch] [bp-104h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 int v83; // [sp-8h] [bp-100h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 char *v84; // [sp-8h] [bp-100h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 __int64 *v85; // [sp-4h] [bp-FCh]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 unsigned int v86; // [sp-4h] [bp-FCh]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 POINT v87; // [sp+Ch] [bp-ECh]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 POINT v88; // [sp+14h] [bp-E4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 POINT v89; // [sp+1Ch] [bp-DCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 POINT v90; // [sp+24h] [bp-D4h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 POINT v91; // [sp+2Ch] [bp-CCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 POINT v92; // [sp+34h] [bp-C4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 POINT v93; // [sp+3Ch] [bp-BCh]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 POINT v94; // [sp+44h] [bp-B4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 POINT v95; // [sp+4Ch] [bp-ACh]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 POINT v96; // [sp+54h] [bp-A4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 POINT v97; // [sp+5Ch] [bp-9Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 POINT a2; // [sp+64h] [bp-94h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 POINT v99; // [sp+6Ch] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 POINT v100; // [sp+74h] [bp-84h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 GUIWindow v101; // [sp+7Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 char *Str; // [sp+D0h] [bp-28h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 __int32 v103; // [sp+D4h] [bp-24h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 int v104; // [sp+D8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 int v105; // [sp+DCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 POINT v106; // [sp+E0h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 Player *_this; // [sp+E8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 int v108; // [sp+ECh] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 const char **v109; // [sp+F0h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 memcpy(&v101, ptr_507BC0, sizeof(v101));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 v101.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v101.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 v101.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 v66 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 ++v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v65 += v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 while ( (signed int)v66 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v109 = (const char **)((174 - v65) / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1150 result = (char *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1151 v69 = (int)&result[pDialogueWindow->pNumPresenceButton];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1153 v20 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1154 v106.y = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 if ( v20 ^ __OFSUB__((int)result, (int)v69) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 v108 = (int)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v71 = v68->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 v72 = (const char **)v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 v71->uY = (unsigned int)((char *)v109 + v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v74 = v71->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v75 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v71->uHeight = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 v70 = v73 + v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v71->uW = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 v76 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1171 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 v76 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 v101.DrawText2(pFontArrus, 0, v74, v76, *(const char **)v108, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 v108 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 ++v106.y;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1178 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 result = (char *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v30 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v31 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 v106.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 v108 = v32 * (100 - _this->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 if ( v108 < v32 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 v108 = v32 / 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1201 v33 = v30->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1202 v34 = v33 + v30->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 if ( (signed int)v33 >= v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 goto LABEL_105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 v35 = v30->GetControl(v33)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v35] && !_this->pActiveSkills[v35] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 v36 = pFontArrus->CalcTextHeight(pSkillNames[v35], &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 v106.y += v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1217 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 LABEL_105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 v7 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 v84 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 v82 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 v101.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 v108 = (149 - v106.y) / (signed int)v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 if ( (149 - v106.y) / (signed int)v109 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 v108 = 32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1238 result = (char *)v30->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 v37 = (149 - (signed int)v109 * v108 - v106.y) / 2 - v108 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 v106.y = (LONG)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 v103 = v37;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1242 if ( (signed int)result < (signed int)&result[v30->pNumPresenceButton] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 v109 = (const char **)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 v38 = v30->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 v40 = v38->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v40] || _this->pActiveSkills[v40] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 v39->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 v39->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 v39->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 v41 = pSkillNames[v40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v39->uY = v108 + v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 Str = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v42 = pFontArrus->CalcTextHeight(v41, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 v43 = v39->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v44 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v39->uHeight = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 v45 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 v39->uW = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 v103 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 v46 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1269 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v44 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 v46 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 v101.DrawText2(pFontArrus, 0, v43, v46, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1273 v47 = v30->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 ++v106.y;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1275 result = (char *)(v30->pNumPresenceButton + v47);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 v27 = pMouse->GetCursorPos(&v99)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 result = (char *)pMouse->GetCursorPos(&v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 result = (char *)pMouse->GetCursorPos(&v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 result = (char *)(9 * (int)result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 if ( _this->field_1F5[4 * (int)result + 15] & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 v83 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 v81 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1313 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 v28 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 v29 = _this->_490EEE(
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1317 (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5],
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 v5 = (char *)pMerchantsRepairPhrases[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 v15 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v14 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v103 = (174 - v14) / 4;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1351 result = (char *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1352 v18 = (int)&result[pDialogueWindow->pNumPresenceButton];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1354 v20 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1355 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 if ( v20 ^ __OFSUB__((int)result, v18) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v108 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 v109 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 v21 = v17->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v22 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v21->uY = v103 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 v24 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 v25 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v21->uHeight = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 v19 = v24 + v23 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 v21->uW = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 v26 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1372 if ( pDialogueWindow->pCurrentPosActiveItem != v25 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 v26 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 v101.DrawText2(pFontArrus, 0, v24, v26, *v109, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 ++v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 _this = (Player *)((char *)_this + 1);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1379 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 while ( (signed int)_this < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 v11 = pMouse->GetCursorPos(&v96)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 result = (char *)pMouse->GetCursorPos(&v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 result = (char *)pMouse->GetCursorPos(&v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 v83 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 v81 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1411 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 v13 = _this->_490EEE(v79, 1, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 v5 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 result = (char *)(dword_F8B19C - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 v2 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 result = (char *)pMouse->GetCursorPos(&v100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 result = (char *)pMouse->GetCursorPos(&v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 v83 = 4;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1448 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1449 if ( !(v4->uAttributes & 1) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 v9 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 v10 = _this->_490EEE(v4, 1, v9, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 v5 = (char *)pMerchantsIdentifyPhrases[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 v6 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 v7 = sub_495461(v5, v6, v79, (char *)v81, v83, v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 v84 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 v80 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 v78 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 return v101.DrawText2(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 v49 = word_F8B158[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 v50 = dword_F8B168[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 v49 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 v48 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 v48 = (const char **)((char *)v48 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 v109 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 while ( (signed int)v48 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)ptr_507BC0->ptr_1C] + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 v52 = word_F8B158[(signed int)v109] + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 v53 = dword_F8B168[(signed int)v109];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 while ( (signed int)v109 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 v56 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 v57 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 Str = (char *)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 if ( v56 && v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v58 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 v58 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 v58 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 sub_4B46A5(v58, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 if ( v106.x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 v59 = pMouse->GetCursorPos(&v91);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v106.x = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 v61 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v62 = 9 * (v60 + 12 * v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v63 = (ItemGen *)&pParty->field_777C[v62];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 if ( !v56 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 v64 = _this->_490EEE(v63, 1, v61, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 v5 = (char *)pMerchantsBuyPhrases[v64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v5 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 result = v101._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 //----- (004B9CC6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 POINT *__cdecl sub_4B9CC6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 POINT *result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 GUIWindow *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 unsigned int v3; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 void *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 signed int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 unsigned int v6; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 unsigned int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 int v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 GUIButton *v11; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 GUIButton *v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 char *v14; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 unsigned int v16; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 int v17; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 int v18; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 unsigned __int16 v19; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 int v20; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 char *v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 int v22; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 char **v23; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 int v24; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 GUIWindow *v25; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 int v26; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 int v27; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 unsigned __int8 v28; // sf@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 GUIButton *v29; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 const char **v30; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 int v31; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 unsigned int v32; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 Player *v33; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 int v34; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 unsigned __int16 v35; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 signed int v36; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 ItemGen *v37; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 char *v38; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 unsigned __int8 v39; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 int v40; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 int v41; // ST08_4@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 signed int v43; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 int v44; // ST08_4@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 int v45; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 Texture *v46; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 unsigned int v47; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 unsigned int v48; // esi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 int v49; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 Texture *v50; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 unsigned int v51; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 unsigned int v52; // esi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 int v53; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 Texture *v54; // ecx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 unsigned int v55; // edi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 unsigned int v56; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 int v57; // edx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 Texture *v58; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 unsigned int v59; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 unsigned int v60; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 int v61; // edx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 signed int v62; // ecx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 SHORT v63; // di@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 bool v64; // eax@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 const char *v65; // ecx@112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 POINT *v66; // esi@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 int v67; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 int v68; // eax@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 int v69; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 ItemGen *v70; // esi@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 int v71; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 int v72; // edi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 char **v73; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 int v74; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 GUIWindow *v75; // ecx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 int v76; // edx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 int v77; // edi@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 GUIButton *v78; // esi@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 const char **v79; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 int v80; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 unsigned int v81; // ecx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 Player *v82; // edx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 unsigned __int16 v83; // ax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 GUIWindow *v84; // [sp-18h] [bp-F0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 int v85; // [sp-14h] [bp-ECh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 int v86; // [sp-10h] [bp-E8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 ItemGen *v87; // [sp-10h] [bp-E8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 void *v89; // [sp-Ch] [bp-E4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 char *v90; // [sp-8h] [bp-E0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 int v91; // [sp-8h] [bp-E0h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 unsigned int v92; // [sp-4h] [bp-DCh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 __int64 *v93; // [sp-4h] [bp-DCh]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 POINT v94; // [sp+Ch] [bp-CCh]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 POINT v95; // [sp+14h] [bp-C4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 POINT v96; // [sp+1Ch] [bp-BCh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 POINT v97; // [sp+24h] [bp-B4h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 POINT v98; // [sp+2Ch] [bp-ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 POINT v99; // [sp+34h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 POINT v100; // [sp+3Ch] [bp-9Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 POINT v101; // [sp+44h] [bp-94h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 POINT v102; // [sp+4Ch] [bp-8Ch]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 POINT a2; // [sp+54h] [bp-84h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 GUIWindow v104; // [sp+5Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 int v105; // [sp+B0h] [bp-28h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 int v106; // [sp+B4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 char *Str; // [sp+B8h] [bp-20h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 int v108; // [sp+BCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 __int32 v109; // [sp+C0h] [bp-18h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 Player *_this; // [sp+C4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 const char **v111; // [sp+C8h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 unsigned int v112; // [sp+CCh] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 int v114; // [sp+D4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 memcpy(&v104, ptr_507BC0, sizeof(v104));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v104.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v104.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 v104.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 v73 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v72 += v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 while ( (signed int)v73 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 Str = (char *)((174 - v72) / 4);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1768 result = (POINT *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1769 v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1771 v28 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1772 v112 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 if ( v28 ^ __OFSUB__((int)result, v76) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 v78 = v75->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 v79 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 v78->uY = (unsigned int)&Str[v77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 v81 = v78->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 v82 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 v78->uHeight = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 v77 = v81 + v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 v78->uW = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 v83 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1789 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 v83 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 v104.DrawText2(pFontArrus, 0, v81, v83, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1796 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 || (v43 = pMouse->GetCursorPos(&v99)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 result = pMouse->GetCursorPos(&v102),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 || (result = pMouse->GetCursorPos(&v100), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 v91 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 v89 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1823 v87 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 v44 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 v45 = _this->_490EEE(v87, 4, v44, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 v38 = (char *)pMerchantsSellPhrases[v45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 result = pMouse->GetCursorPos(&v101),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 || (result = pMouse->GetCursorPos(&v97), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 v91 = 4;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1847 v37 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1848 if ( !(v37->uAttributes & 1) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 v41 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 v42 = _this->_490EEE(v37, 4, v41, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 v38 = (char *)pMerchantsIdentifyPhrases[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 v38 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v39 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 v21 = sub_495461(v38, v39, v87, (char *)v89, v91, v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v90 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v88 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 v86 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 v85 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 v23 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 v24 = pFontArrus->CalcTextHeight(*v23, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v22 += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 while ( (signed int)v23 < (signed int)&pShopOptions[2] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 Str = (char *)((174 - v22) / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v25 = pDialogueWindow;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1891 result = (POINT *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1892 v26 = (int)((char *)result + pDialogueWindow->pNumPresenceButton);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v27 = (2 * (87 - (174 - v22) / 2) - v22) / 2 - (174 - v22) / 2 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1894 v28 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1895 v112 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 if ( v28 ^ __OFSUB__((int)result, v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 v29 = v25->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v30 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v29->uY = (unsigned int)&Str[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 v31 = pFontArrus->CalcTextHeight(*v30, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 v32 = v29->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 v33 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v29->uHeight = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 v34 = v31 + v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 v29->uW = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 v27 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 v35 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1913 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v33 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 v35 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 v104.DrawText2(pFontArrus, 0, v32, v35, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 v25 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1920 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 result = (POINT *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 if ( dword_F8B19C != 96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 v2 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 v4 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 v111 = (const char **)(v5 * (100 - _this->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 if ( (signed int)v111 < v5 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 v111 = (const char **)(v5 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1941 v6 = v2->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1942 v7 = v6 + v2->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 if ( (signed int)v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 v8 = v2->GetControl(v6)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v8] && !_this->pActiveSkills[v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 v9 = pFontArrus->CalcTextHeight(pSkillNames[v8], &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 v112 += v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1957 while ( (signed int)v6 < v2->pNumPresenceButton + v2->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 v104.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 v111 = (const char **)((signed int)(149 - v112) / v114);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 if ( (signed int)(149 - v112) / v114 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 v111 = (const char **)32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1965 result = (POINT *)v2->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 v10 = (signed int)(149 - v114 * (int)v111 - v112) / 2 - (signed int)v111 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 v112 = (unsigned int)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 v105 = v10;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1969 if ( (signed int)result < (signed int)((char *)result + v2->pNumPresenceButton) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 v114 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 v11 = v2->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 v13 = v11->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v13] || _this->pActiveSkills[v13] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 v12->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 v12->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 v12->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v14 = pSkillNames[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v12->uY = (unsigned int)((char *)v111 + v105);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 Str = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 v15 = pFontArrus->CalcTextHeight(v14, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 v16 = v12->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 v17 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 v12->uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 v18 = v16 + v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 v12->uW = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 v105 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v19 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1996 if ( pDialogueWindow->pCurrentPosActiveItem != v17 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 v19 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 v104.DrawText2(pFontArrus, 0, v16, v19, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2000 v20 = v2->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2002 result = (POINT *)(v2->pNumPresenceButton + v20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 v21 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 v90 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 v88 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 return (POINT *)v104.DrawText2(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v46 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 v47 = 152 - v46->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 if ( (signed int)v47 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 v49 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 if ( (signed int)v48 > 457 - v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 v48 = 457 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 if ( (signed int)v48 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 v48 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 pRenderer->DrawTextureTransparent(v48, v47, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 v50 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 v51 = 308 - v50->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 if ( (signed int)v51 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 v53 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 if ( (signed int)v52 > 457 - v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 v52 = 457 - v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 if ( (signed int)v52 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 v52 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 pRenderer->DrawTextureTransparent(v52, v51, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 v54 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 v55 = 152 - v54->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( (signed int)v55 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 v57 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 if ( (signed int)v56 > 457 - v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 v56 = 457 - v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 if ( (signed int)v56 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 v56 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 pRenderer->DrawTextureTransparent(v56, v55, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 v58 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 v59 = 308 - v58->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 if ( (signed int)v59 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 v61 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 if ( (signed int)v60 > 457 - v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 v60 = 457 - v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 if ( (signed int)v60 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 v60 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 pRenderer->DrawTextureTransparent(v60, v59, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 v63 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 v64 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 Str = (char *)v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 if ( v63 && v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 v65 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 v65 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 v65 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 sub_4B46A5(v65, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 return (POINT *)v104._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 v66 = pMouse->GetCursorPos(&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 v109 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 v68 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 v69 = 9 * (v67 + 12 * v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 v70 = (ItemGen *)&pParty->field_777C[v69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 if ( !v63 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 v71 = _this->_490EEE(v70, 4, v68, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v38 = (char *)pMerchantsBuyPhrases[v71];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v38 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 //----- (004BA928) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 void __cdecl sub_4BA928()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 signed int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 unsigned int v2; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 ItemGen *v3; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 unsigned __int8 v4; // dl@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 char *v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 int v7; // ST08_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 signed int v9; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 unsigned int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 char *v11; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 int v12; // ST08_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 unsigned __int8 v14; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 char *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 char **v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 char **v18; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 int v19; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 GUIWindow *v20; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 int v21; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 int v22; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 int v23; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 unsigned __int8 v24; // sf@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 GUIButton *v25; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 GUIButton *v26; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 int v27; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 unsigned int v28; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 Player *v29; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 unsigned __int16 v30; // ax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 signed int v31; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 unsigned int v32; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 int v33; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 int v34; // ST08_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 int v35; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 char *v36; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 GUIWindow *v37; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 signed int v38; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 unsigned int v39; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 int v40; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 unsigned int v41; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 int v43; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 GUIButton *v44; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 GUIButton *v45; // esi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 int v46; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 char *v47; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 int v48; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 unsigned int v49; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 int v50; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 int v51; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 unsigned __int16 v52; // ax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 int v53; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 int v54; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 signed int v55; // ebx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 Texture *v56; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 unsigned int v57; // edi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 Texture *v58; // ST1C_4@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 int v59; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 int v60; // edi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 signed int v61; // ebx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 Texture *v62; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 int v63; // edi@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 Texture *v64; // ST1C_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 unsigned int v65; // ST18_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 int v66; // eax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 int v67; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 signed int v68; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 SHORT v69; // bx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 bool v70; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 const char *v71; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 void *v72; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 POINT *v73; // esi@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 int v74; // ecx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 int v75; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 int v76; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 ItemGen *v77; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 unsigned __int8 v78; // bl@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 char **v79; // edi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 int v80; // ebx@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 char **v81; // esi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 int v82; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 GUIWindow *v83; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 int v84; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 int v85; // edx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 int v86; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 GUIButton *v87; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 GUIButton *v88; // esi@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 int v89; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 unsigned int v90; // ecx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 int v91; // edx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 unsigned __int16 v92; // ax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 signed int v93; // edx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 POINT *v94; // edi@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 __int32 v95; // ecx@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 void *v96; // ST14_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 unsigned __int8 v97; // bl@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 ItemGen *v98; // ST10_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 int v99; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 char *v100; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 const char *v101; // ST18_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 unsigned __int16 v102; // ST14_2@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 int v103; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 signed int v104; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 Texture *v105; // eax@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 int v106; // ebx@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 Texture *v107; // ST1C_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 unsigned int v108; // ST18_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 int v109; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 int v110; // ebx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 unsigned int v112; // [sp-14h] [bp-118h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 int v113; // [sp-14h] [bp-118h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 ItemGen *v114; // [sp-10h] [bp-114h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 unsigned int v115; // [sp-10h] [bp-114h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 ItemGen *v116; // [sp-10h] [bp-114h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 int v117; // [sp-10h] [bp-114h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 void *v118; // [sp-Ch] [bp-110h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 void *v120; // [sp-Ch] [bp-110h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 char *v121; // [sp-8h] [bp-10Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 int v122; // [sp-8h] [bp-10Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 unsigned int v123; // [sp-4h] [bp-108h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 __int64 *v124; // [sp-4h] [bp-108h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 int v125; // [sp-4h] [bp-108h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 int v126; // [sp-4h] [bp-108h]@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 int v127; // [sp-4h] [bp-108h]@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 POINT v128; // [sp+Ch] [bp-F8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 POINT v129; // [sp+14h] [bp-F0h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 char v130; // [sp+1Ch] [bp-E8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 POINT a2; // [sp+24h] [bp-E0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 POINT v132; // [sp+2Ch] [bp-D8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 POINT v133; // [sp+34h] [bp-D0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 char v134; // [sp+3Ch] [bp-C8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 POINT v135; // [sp+44h] [bp-C0h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 POINT v136; // [sp+4Ch] [bp-B8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 POINT v137; // [sp+54h] [bp-B0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 POINT v138; // [sp+5Ch] [bp-A8h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 POINT v139; // [sp+64h] [bp-A0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 POINT v140; // [sp+6Ch] [bp-98h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 POINT v141; // [sp+74h] [bp-90h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 POINT v142; // [sp+7Ch] [bp-88h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 POINT v143; // [sp+84h] [bp-80h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 GUIWindow v144; // [sp+8Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 char *Str; // [sp+E0h] [bp-24h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 int v146; // [sp+E4h] [bp-20h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 int v147; // [sp+E8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 int v148; // [sp+ECh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 __int32 v149; // [sp+F0h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 Player *_this; // [sp+F4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 int v152; // [sp+FCh] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 int v153; // [sp+100h] [bp-4h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 memcpy(&v144, ptr_507BC0, sizeof(v144));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 v144.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 v144.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 v144.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 if ( dword_F8B19C == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 sub_4B46A5(pGlobalTXT_LocalizationStrings[195], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 v149 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 ++v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 while ( v93 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 if ( v149 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 v94 = pMouse->GetCursorPos(&v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 v95 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 if ( v149 && v149 != -65536 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 --v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 v96 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 v97 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 v99 = _this->_490EEE(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 (int)ptr_507BC0->ptr_1C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 v100 = sub_495461((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 v101 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 v102 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v144.DrawText2(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 v104 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 v105 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 if ( v104 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, dword_F8B168[v104]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 v109 = v153 + v110 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v106 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 v107 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v108 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 v109 = v152 + v153 + 640 * v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], dword_F8B168[v104], v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 ++v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 while ( v104 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 v79 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 v81 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v80 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 while ( (signed int)v81 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 v152 = (174 - v80) / 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2492 v84 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2493 v85 = v84 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2495 v24 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2496 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 if ( v24 ^ __OFSUB__(v84, v85) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 v87 = v83->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 v88 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 v87->uY = v152 + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 v90 = v88->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 v91 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 v88->uHeight = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 v86 = v90 + v89 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 v88->uW = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 v92 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2512 if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 v92 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 v144.DrawText2(pFontArrus, 0, v90, v92, *v79, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2520 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 v152 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 v37 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 v38 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 if ( (signed int)_this < v38 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 _this = (Player *)(v38 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2535 v39 = v37->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2536 v40 = v37->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 if ( (signed int)v39 < (signed int)(v39 + v40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 v41 = v37->GetControl(v39)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v41] && !v0->pActiveSkills[v41] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 v152 += v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2551 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 if ( v153 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 v144.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 _this = (Player *)((149 - v152) / v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 if ( (149 - v152) / v153 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 _this = (Player *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2560 v152 = v37->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v146 = v43;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2562 if ( v152 < v152 + v37->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 v44 = v37->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 v45 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 v46 = v44->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v46] || v0->pActiveSkills[v46] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 v45->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 v45->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 v45->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v47 = pSkillNames[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v45->uY = (unsigned int)((char *)_this + v146);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 Str = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 v49 = v45->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v50 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v45->uHeight = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 v51 = v49 + v48 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 v45->uW = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v146 = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 v52 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2589 if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v52 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 v144.DrawText2(pFontArrus, 0, v49, v52, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2593 v53 = v37->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 ++v152;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2595 v54 = v37->pNumPresenceButton + v53;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 while ( v152 < v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v36 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 v121 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 v119 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v113 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 v112 = (unsigned int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 v144.DrawText2(pFontArrus, v112, v115, v119, v121, v123);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v56 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 if ( v55 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 0x7Eu, dword_F8B168[v55]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 v59 = v60 + v153 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 v57 = 98 - v56->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 v58 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 v59 = v153 + v152 + 640 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], dword_F8B168[v55], v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 while ( v55 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 v62 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 if ( v61 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, dword_F8B168[v61]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 v66 = v153 + v67 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 v63 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 v64 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v65 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 v66 = v152 + v153 + 640 * v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], dword_F8B168[v61], v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 while ( v61 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 v149 = (__int32)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 v69 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 v70 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 Str = (char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 if ( v69 == (short)v11 || (char *)v70 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 v71 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 v71 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 v71 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 sub_4B46A5(v71, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 if ( (char *)v149 != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 v73 = pMouse->GetCursorPos(&v136);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 if ( !v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 v149 = v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v75 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 v76 = 9 * (v74 - 1 + 12 * v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 v77 = (ItemGen *)&pParty->field_777C[v76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 v77 = (ItemGen *)&pParty->field_C59C[v76 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 if ( v69 == (short)v11 || Str == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 v78 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 v14 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 v15 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 v14 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 v36 = sub_495461(v15, v14, v116, (char *)v120, v122, v124);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 v121 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 v117 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 v113 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 v144._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 __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
2775 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 || (v31 = pMouse->GetCursorPos(&v135)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 pMouse->GetCursorPos(&v140)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 || pMouse->GetCursorPos(&v138)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 v122 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 v120 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2794 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v34 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 uPlayerID = uActiveCharacter - 1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2797 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 v15 = (char *)pMerchantsRepairPhrases[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 v16 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v18 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 v19 = pFontArrus->CalcTextHeight(*v18, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 v17 += v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 while ( (signed int)v18 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 v146 = (174 - v17) / 4;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2822 v21 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2823 v22 = v21 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2825 v24 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2826 v152 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 if ( v24 ^ __OFSUB__(v21, v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v25 = v20->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v25->uY = v146 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v28 = v26->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v29 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 v26->uHeight = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 v23 = v28 + v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 v26->uW = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 v30 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2842 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 v30 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 v144.DrawText2(pFontArrus, 0, v28, v30, *v16, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 ++v152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2850 while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 || (v9 = pMouse->GetCursorPos(&v139)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 pMouse->GetCursorPos(&v137)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 || pMouse->GetCursorPos(&v129)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 v122 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 v120 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2872 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v10 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 v13 = v0->_490EEE(v116, 2, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 v15 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 if ( pMouse->GetCursorPos(&v141)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 if ( pMouse->GetCursorPos(&v143)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2896 v3 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2897 if ( v3->uAttributes & 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v4 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v7 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 v8 = v0->_490EEE(v3, 2, v7, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v4 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 v5 = (char *)pMerchantsIdentifyPhrases[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v6 = sub_495461(v5, v4, v114, (char *)v118, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v121 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 goto LABEL_14;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 //----- (004BB756) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 signed int __fastcall sub_4BB756(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 unsigned int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 unsigned int v3; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 char *v4; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 int v5; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 int v6; // ST38_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 char *v7; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 int v8; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 int v9; // ST30_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 int v10; // ST44_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 int v11; // ST48_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 int v12; // ST4C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 int v13; // ST50_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 int v14; // ST3C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 int v15; // ST40_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 int v16; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 int v17; // ST38_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 Player *v18; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 int v19; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 SoundID v21; // [sp-20h] [bp-54h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 signed int v22; // [sp-1Ch] [bp-50h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 unsigned int v23; // [sp-18h] [bp-4Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 signed int v24; // [sp-14h] [bp-48h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 signed int v25; // [sp-10h] [bp-44h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 int v26; // [sp-10h] [bp-44h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 int v27; // [sp-Ch] [bp-40h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 unsigned int v28; // [sp-Ch] [bp-40h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 unsigned int v29; // [sp-8h] [bp-3Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 __int16 v30; // [sp-8h] [bp-3Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 int v31; // [sp-4h] [bp-38h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 int v32; // [sp-4h] [bp-38h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 if ( a1 > 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 if ( a1 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 if ( a1 == 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 dword_50C9DC = 195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 ptr_50C9E0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 if ( a1 == 42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 v26 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 if ( a1 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 if ( a1 != 52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 v26 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 _42777D_CastSpell_UseWand_ShootArrow(v26, 0, v28, v30, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 pParty->pPartyBuffs[18].Apply(pParty->uTimePlayed + 46080, 3u, 0, v20, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 pParty->pPartyBuffs[18].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 v21 = (SoundID)12040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 pAudioPlayer->PlaySound(v21, v22, v23, v24, v25, v27, v29, v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 if ( a1 == 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 v21 = (SoundID)203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 pParty->pPartyBuffs[7].Apply(pParty->uTimePlayed + 30720, 3u, 1u, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 pParty->pPartyBuffs[7].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 v21 = (SoundID)11090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 if ( a1 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 v18 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 v18->sHealth = v18->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 while ( (signed int)v18 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 if ( a1 == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 v7 = (char *)&pParty->pPlayers[0].pConditions[15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 v8 = *((int *)v7 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 v9 = *((int *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 v10 = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 v11 = *((int *)v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 v12 = *((int *)v7 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 v13 = *((int *)v7 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 v14 = *((int *)v7 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 v15 = *((int *)v7 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 v16 = *((int *)v7 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 v17 = *((int *)v7 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 memset(v7 - 120, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 *((int *)v7 + 2) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 *((int *)v7 + 3) = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 *(int *)v7 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 *((int *)v7 + 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 *((int *)v7 - 1) = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 *((int *)v7 + 8) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 *((int *)v7 + 9) = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 *((int *)v7 + 4) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 *((int *)v7 - 2) = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 *((int *)v7 + 5) = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 *((int *)v7 + 1585) = ((Player *)(v7 - 120))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 v7 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 while ( (signed int)v7 < (signed int)&pParty->pHirelings[1].evtb );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 if ( a1 == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 v4 = (char *)&pParty->pPlayers[0].pActiveSkills[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 v5 = *((int *)v4 - 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 v6 = *((int *)v4 - 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 memset(v4 - 280, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 *(int *)v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 *((int *)v4 + 1) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 *((int *)v4 + 1545) = ((Player *)(v4 - 280))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 v4 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 while ( (signed int)v4 < (signed int)&pParty->field_777C[22] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 if ( a1 == 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 Party::GiveFood(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 if ( pParty->uNumFoodRations > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 pParty->uNumFoodRations = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 if ( a1 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 // 50C9DC: using guessed type int dword_50C9DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 //----- (004BBA85) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3138 const char *sub_4BBA85_bounties()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 signed __int64 v1; // qax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 int i; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 int v4; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 __int16 v5; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 char v6; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 Player *v7; // ebx@16
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3148 const char *result; // eax@19
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 uDialogueType = 83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3152 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 471u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 pGlobalTXT_LocalizationStrings[34],// "Cancel"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3164 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3166 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3167 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 pDialogueWindow->_41D08F(1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 v0 = (int)((char *)ptr_507BC0->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 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
3172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 pParty->field_75A[v0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 v1 = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 pParty->field_3C.field_0[2 * v0] = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 pParty->field_3C.field_0[2 * v0 + 1] = HIDWORD(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 for ( i = rand(); ; i = rand() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 v3 = i % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 pParty->field_750[v0] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 if ( (unsigned __int16)v3 < 0x73u || (unsigned __int16)v3 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 if ( ((unsigned __int16)v3 < 0xEBu || (unsigned __int16)v3 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 && ((unsigned __int16)v3 < 0x85u || (unsigned __int16)v3 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 && ((unsigned __int16)v3 < 0x97u || (unsigned __int16)v3 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 && ((unsigned __int16)v3 < 0xC4u || (unsigned __int16)v3 > 0xC6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 v4 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 v5 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 v6 = pParty->field_75A[v4] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 word_F8B1A0 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 v6 = v5 == 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3199 result = pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 if ( v6 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3201 result = pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v5].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 v7 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 v7->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 while ( (signed int)v7 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v4]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 pParty->field_750[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 pParty->field_75A[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3219 result = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 dword_F8B1A4 = (char *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 //----- (004BBCDD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 void __cdecl sub_4BBCDD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 signed int v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 __int16 v2; // cx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 int v3; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 Player *v4; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 GUIButton *v5; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 GUIButton *v6; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 size_t v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 if ( pParty->field_7B5_in_arena_quest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 if ( pParty->field_7B5_in_arena_quest == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 uDialogueType = 92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 v1 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 v2 = *(short *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 if ( *(short *)v1 == 5 || v2 == 11 || v2 == 19 || (v3 = *((int *)v1 + 159)) != 0 && (v3 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 v1 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 if ( v0 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 uDialogueType = 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 v4 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 while ( (signed int)v4 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 party_finds_gold(dword_F8B1B4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 pParty->field_7B5_in_arena_quest = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 uDialogueType = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 pParty->vPosition.x = 3849;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3279 pParty->vPosition.y = 5770;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3280 pParty->vPosition.z = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 uDialogueType = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 v5 = pDialogueWindow->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 v6 = v5->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 pAllocator->FreeChunk(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 pDialogueWindow->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 pDialogueWindow->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 pDialogueWindow->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 pGlobalTXT_LocalizationStrings[79],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3319 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x55u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3320 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x56u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3321 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x57u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3322 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x58u, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 pDialogueWindow->_41D08F(4, 1, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 // F8B1B4: using guessed type int dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 //----- (004BBF61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 size_t v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 int monster_id; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 __int16 v6; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 Actor *v7; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 MonsterInfo *v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 MonsterDesc *v10; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 unsigned __int16 *v11; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 int v12; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 int v13; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 __int16 x_; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 __int16 v15; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 __int16 v16; // [sp+10h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 signed int ya; // [sp+1Ch] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 monster_id = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 v15 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 if ( (signed int)uNumActors < 500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 && ((signed int)pAllocator->uBigBufferSizeAligned >> 10) - ((signed int)pAllocator->uNextFreeOffsetInBigBuffer >> 10) >= 2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 v6 = pIndoor->GetSector(x, y, z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 v16 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v7 = &pActors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 v7->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 v8 = monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v9 = &pMonsterStats->pInfos[monster_id];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 v10 = &pMonsterList->pMonsters[v8 - 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 strcpy(v7->pActorName, v9->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v7->sCurrentHP = LOWORD(v9->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 memcpy(&v7->pMonsterInfo, v9, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 v7->word_000086_some_monster_id = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 v7->uActorRadius = v10->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v7->uActorHeight = v10->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 v7->uMovementSpeed = v10->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v7->vInitialPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v7->vPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 BYTE2(v7->uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v7->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v7->pMonsterInfo.uTreasureLevel = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v7->pMonsterInfo.uTreasureDiceSides = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v7->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 v7->pMonsterInfo.uTreasureDropChance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v7->vInitialPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v7->vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v7->vInitialPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v7->vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v7->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v7->uSectorID = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v7->uGroup = 1;
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
3387 v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v7->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v11 = v10->pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 ya = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 pSoundList->_4A9A67((signed __int16)*v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 --ya;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 while ( ya );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 //----- (004BC109) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 void __cdecl ArenaFight()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 char *v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 Player *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 int v3; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 signed int v4; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 signed __int64 v5; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 signed int v6; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 char *v7; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 int v8; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 int v9; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 int v10; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 unsigned __int8 v11; // sf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 unsigned __int8 v12; // of@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 signed int v13; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 int v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 int v15; // edx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 int v16; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 signed int v17; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 int v18; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 int i; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 int monster_y; // ST18_4@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 int v21; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 signed int v22; // [sp-4h] [bp-144h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 __int16 v23[100]; // [sp+Ch] [bp-134h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 GUIWindow window; // [sp+D4h] [bp-6Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 int v26; // [sp+134h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 int v27; // [sp+138h] [bp-8h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 int num_monsters; // [sp+13Ch] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 pParty->field_7B5_in_arena_quest = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 memcpy(&window, pDialogueWindow, sizeof(window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 window.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 window.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
3446 pRenderer->BeginSceneD3D();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 if ( pRenderer->pRenderD3D )
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 49
diff changeset
3456 pRenderer->FillRectFast(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 pViewport->uViewportZ - pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 pViewport->uViewportW - pViewport->uViewportY + 1,
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 49
diff changeset
3461 pRenderer->uTargetGMask | pRenderer->uTargetBMask);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 352 - v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 (pTex ? pTex->uTextureHeight : 26) - v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 pParty->vPosition.x = 3849;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3476 pParty->vPosition.y = 5770;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3477 pParty->vPosition.z = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v2 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 v3 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 if ( v3 > v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 v26 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 while ( (signed int)v2 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 num_monsters = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 v5 = (signed __int64)((double)v26 * 1.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 LODWORD(v5) = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 num_monsters = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 v4 /= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 num_monsters = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 if ( v4 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 if ( v4 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 if ( num_monsters > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 num_monsters = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 if ( v4 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 if ( num_monsters < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 num_monsters = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 v7 = (char *)&pMonsterStats->pInfos[1].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 if ( v7[8] != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 if ( !MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 v8 = (unsigned __int8)*v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 if ( v8 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 if ( v8 <= num_monsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 v23[v6++] = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 v7 += 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 num_monsters = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 if ( v6 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 num_monsters = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 if ( num_monsters > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 v12 = __OFSUB__(v9, num_monsters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 v11 = v9 - num_monsters < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 *((short *)&window.pControlsTail + v9 + 1) = v23[v10 % v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 while ( v11 ^ v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 v17 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 v22 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 v17 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 v22 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 v18 = v16 % v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 v14 = v18 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 v15 = rand() % 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 v13 = 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 v14 = v15 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v13 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 v14 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 v13 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 for ( dword_F8B1B4 = v26 * v13; i < v14; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 monster_y = pMonsterArenaPlacements[i].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 v21 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 _4BBF61_summon_actor((unsigned __int16)monster_ids[v21 % num_monsters], pMonsterArenaPlacements[i].x, monster_y, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 //----- (004BC8D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 Texture *__cdecl sub_4BC8D5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 GUIWindow *v5; // ebp@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 Texture *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 int v7; // [sp+10h] [bp-4h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 v0 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 v1 = (char *)ptr_507BC0->ptr_1C - 139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 if ( v3 < 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 if ( v3 <= 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 v0 = rand() % word_4F0F30[(signed int)v1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 + 345;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 if ( v3 == 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 v4 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 if ( v3 == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 v4 = rand() % 3 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 if ( v3 != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 v4 = rand() % 2 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 if ( v0 == 487 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v0 = 486;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 v5 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 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
3683 _u->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 *(&dword_F8B164 + v2) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 while ( v2 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 //----- (004BCA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 GUIButton *__cdecl sub_4BCA33()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3698 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 pGlobalTXT_LocalizationStrings[74],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3712 return pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 //----- (004BCACC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 void __fastcall sub_4BCACC_bounties(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 signed int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 Player *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 signed int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 GUIWindow *v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 unsigned int v9; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 int v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 int v11; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 int v12; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 __int16 v13; // bp@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 int v14; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 GUIWindow *v15; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 int v16; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 int v17; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 __int16 v20; // ax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 __int16 v21; // ax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 __int16 v22; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 __int16 v23; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 __int16 v24; // ax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 int v25; // esi@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 __int16 v26; // ax@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 char v27; // zf@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 Player *v28; // edi@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 int v29; // eax@204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 void *v30; // esi@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 unsigned __int64 v31; // qax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 signed int v32; // edi@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 int v33; // eax@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 unsigned int v34; // eax@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 Player *v35; // edi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 signed int v36; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 int v37; // ecx@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 int v38; // esi@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 int v39; // edx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 void *v40; // edi@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 unsigned __int64 v41; // qax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 void *v42; // eax@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 signed int v43; // edi@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 int v44; // edx@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 int v45; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 unsigned int v46; // eax@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 void *v47; // eax@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 signed int v48; // edi@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 int v49; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 int v50; // eax@256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 unsigned int v51; // eax@257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 void *v52; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 signed int v53; // edi@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 int v54; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 signed int v55; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 int v56; // [sp+14h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 v55 = a1;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
3778 if ( !pDialogueWindow->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 if ( v2 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 v6 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v7 = v6->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 v4 += v5++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 while ( v5 < v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 && (signed __int64)v6->uExperience < 1000 * v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 && (v1 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 + pParty->uDaysPlayed % 7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 || dword_F8B198 != 23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 || v55 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3814 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 ptr_5076F4 = pDialogueWindow->CreateButton(
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3816 526,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3817 445,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3818 75,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3819 33,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 v1);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3828 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 if ( uActiveCharacter != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 dword_F8B19C = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 if ( v3 < 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 {
102
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
3844 v9 = pIcons_LOD->LoadTexture(off_4F03B8[v3], TEXTURE_16BIT_PALETTE);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 dword_F8B164 = &pIcons_LOD->pTextures[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 if ( v3 > 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 if ( v3 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 if ( v3 != 23 && v3 != 30 )
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 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 if ( v3 != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 if ( v3 <= (signed int)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 if ( v3 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 if ( v3 <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 if ( v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 v34 = pIcons_LOD->LoadTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 pItemsTable->pItems[v33].pIconName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 while ( v32 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 sub_4BC8D5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 v31 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 + (signed __int64)((double)(0xA8C000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 if ( v3 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 if ( v55 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 v10 = (int)((char *)v8->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 v56 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 v11 = 8 * v10 + 11325428;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 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
3913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 pParty->field_75A[v12] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 *(_QWORD *)v11 = (signed __int64)((double)(309657600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v14 = rand() % 258;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 v15 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 pParty->field_750[v12] = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v16 = (int)((char *)v15->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 v18 = v17 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 v20 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 v21 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 v22 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 v23 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 v24 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 v10 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 v25 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 v26 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 v27 = pParty->field_75A[v25] == v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 word_F8B1A0 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 v27 = v26 == v13;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4081 v29 = (int)pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 if ( v27 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4083 v29 = (int)pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 dword_F8B1A4 = (char *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 if ( v26 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 v28 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 v28->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 while ( (signed int)v28 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 pParty->field_750[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 pParty->field_75A[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 v1 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4103 dword_F8B1A4 = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 if ( v55 == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 if ( v55 > 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 switch ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 case 96:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4121 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 sub_4B3703((void *)dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 case 101:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4126 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 dword_F8B19C = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 dword_F8B19C = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 dword_F8B19C = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 if ( v55 != 95 && v55 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 if ( v55 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 dword_F8B19C = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 if ( v55 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 dword_F8B19C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 if ( v55 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 if ( v55 > 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 if ( v55 <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 v35 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 if ( v37 < v36 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 v37 = v36 / 3;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4175
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4176 __debugbreak();
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4177 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4178 // or
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4179 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4180 // or
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4181 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4182
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4183 if (false)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4184 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 v38 = (int)(&v35->uIntelligence + v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 if ( !*(short *)v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 if ( pParty->uNumGold < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 if ( dword_F8B198 == 30 || dword_F8B198 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 v39 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 v39 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 Party::TakeGold(v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 *(short *)v38 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 v35->PlaySound(78, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 if ( v55 == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4212 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 }
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 dword_F8B19C = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 sub_421B2C_PlaceInInventory_or_DropPickedItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 GenerateShopItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 sub_4B8F94();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 v40 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 v41 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 pParty->field_3C.field_50[2 * (int)v40] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 if ( v55 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 //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
4264 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 v49 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 //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
4285 while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 //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
4307 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 v54 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 //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
4328 while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 //----- (004BD8B5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 signed int __cdecl sub_4BD8B5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 int v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 int v1; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 unsigned int v2; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 const char *v3; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 pKeyActionMap->_459ED1(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 if ( array_5913D8[6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 if ( dword_F8B19C != 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 && dword_F8B19C != 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 && dword_F8B19C != 97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 && dword_F8B19C != 5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 && dword_F8B19C != 4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 && dword_F8B164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 dword_F8B164->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 dword_F8B164 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 if ( v0 && v0 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 if ( v0 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 _4B4224_UpdateNPCTopics((int)((char *)array_5913D8[6] - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 if ( v0 != 94 && v0 != 96 && v0 != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 if ( v0 == 3 || v0 == 5 || v0 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 dword_F8B19C = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 if ( v0 != 102 && v0 != 103 && v0 != 104 )
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 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 sub_4B3B42(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 dword_F8B19C = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 if ( uNumDialogueNPCPortraits != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 ptr_5076F4 = ptr_507BC0->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 if ( uNumDialogueNPCPortraits > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 v3 = byte_591180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 *(&_4E5E50_transui_x + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 0x3Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 0x49u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 0x19Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 v2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 v3 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 while ( (signed int)v2 < uNumDialogueNPCPortraits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 //----- (004BDB56) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 void __cdecl sub_4BDB56_buy_skill____()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 Player *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 signed int v1; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 unsigned int v2; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 int v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 float v4; // ST1C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 signed int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 signed int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 char v7; // zf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 const char *v9; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 signed int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 unsigned int v11; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 int v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 void *v13; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 signed int v14; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 unsigned int v15; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 GUIWindow *v16; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 POINT *v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 int v18; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 void *v19; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 ItemGen *v20; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 float v21; // ST1C_4@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 signed int v22; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 int v23; // ebx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 int v24; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 int v26; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 Player *v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 POINT *v28; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 int v29; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 void *v30; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 int v31; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 ItemGen *v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 float v33; // ST1C_4@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 signed int v34; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 int v35; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 bool v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 unsigned int v37; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 int v38; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 int v39; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 int v40; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 int v41; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 int v42; // esi@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 signed int v43; // ebx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 int v44; // ecx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 unsigned __int16 *pSkill; // esi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 signed int v46; // [sp-18h] [bp-CCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 unsigned int v47; // [sp-14h] [bp-C8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 signed int v48; // [sp-10h] [bp-C4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 signed int v49; // [sp-Ch] [bp-C0h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 int v50; // [sp-8h] [bp-BCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 int v51; // [sp-4h] [bp-B8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 unsigned int v52; // [sp-4h] [bp-B8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 int v53; // [sp+0h] [bp-B4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 unsigned int v54; // [sp+0h] [bp-B4h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 int v55; // [sp+0h] [bp-B4h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 int v56; // [sp+0h] [bp-B4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 POINT v57; // [sp+10h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 POINT v58; // [sp+18h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 POINT v59; // [sp+20h] [bp-94h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 POINT v60; // [sp+28h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 POINT v61; // [sp+30h] [bp-84h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 POINT v62; // [sp+38h] [bp-7Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 POINT v63; // [sp+40h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 POINT v64; // [sp+48h] [bp-6Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 POINT v65; // [sp+50h] [bp-64h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 POINT v66; // [sp+58h] [bp-5Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 POINT v67; // [sp+60h] [bp-54h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 POINT a2; // [sp+68h] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 POINT v69; // [sp+70h] [bp-44h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 POINT v70; // [sp+78h] [bp-3Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 POINT v71; // [sp+80h] [bp-34h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 POINT v72; // [sp+88h] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 bool v73; // [sp+90h] [bp-24h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 int v74; // [sp+94h] [bp-20h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 int a6; // [sp+98h] [bp-1Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 int a3; // [sp+9Ch] [bp-18h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 Player *v77; // [sp+A0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 unsigned int v79; // [sp+A8h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 int v80; // [sp+ACh] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 ItemGen *_this; // [sp+B0h] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 v77 = pPlayers[uActiveCharacter];
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
4533 if ( pCurrentScreen == 14 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 if ( dword_F8B19C > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 if ( dword_F8B19C < 36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 if ( dword_F8B19C <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 v42 = dword_F8B19C - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 v44 = v43 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 if ( v44 < v43 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 v44 = v43 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v42] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 pSkill = &v0->pActiveSkills[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 if ( !*pSkill )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 if ( pParty->uNumGold < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 v13 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 v55 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 Party::TakeGold(v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 *pSkill = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 v51 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 if ( dword_F8B19C != 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 sub_421EA6_OnInventoryLeftClick();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 if ( dword_F8B19C == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 v17 = pMouse->GetCursorPos(&v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v19 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 //v21 = p2DEvents_minus1__20[13 * (signed int)v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 _this = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 v22 = v20->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 v23 = v0->_4B8142(v22, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 v80 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 if ( pParty->uNumGold < v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 v9 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 v26 = 1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4622 v20->uAttributes |= 1u;
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4623 memcpy(&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v25 + 5], v20, 0x24u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 v54 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 v9 = pGlobalTXT_LocalizationStrings[563]; // "Pack is Full!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 v28 = pMouse->GetCursorPos(&v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 if ( !v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 v31 = 9 * (v29 - 1 + 12 * (int)v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 v32 = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 _this = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 _this = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 v32 = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 v34 = v32->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v80 = v0->_4B8142(v34, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 LOWORD(v35) = GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 v74 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 v36 = v0->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 uNumSeconds = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 v73 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 v37 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 a3 = pMapStats->pInfos[v37]._steal_perm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 v38 = GetPartyReputation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 if ( v73 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 if ( !uNumSeconds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 if ( pParty->uNumGold < v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 if ( uNumSeconds != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 if ( uNumSeconds != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 v39 = v0->AddItem(0xFFFFFFFFu, v32->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4690 v32->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 v7 = v73 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 v40 = (int)((char *)v0 + 36 * v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 memcpy((void *)(v40 + 496), v32, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 v41 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 if ( uNumSeconds == 1 || uNumSeconds == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 *(char *)(v40 + 517) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 dword_F8B1E4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 viewparams->bRedrawGameUI = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 _this->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 v27 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 v51 = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 v27->PlaySound(v51, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 v14 = pMouse->GetCursorPos(&v71)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 if ( pMouse->GetCursorPos(&v67)->x <= 13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 || pMouse->GetCursorPos(&v65)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 v16 = ptr_507BC0;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4734 if ( sub_4BDAAF((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5], (int)ptr_507BC0->ptr_1C) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 v51 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 v0->PlaySound(79, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 pAudioPlayer->PlaySound(SOUND_27, v46, v47, v48, v49, v50, v52, v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 v10 = pMouse->GetCursorPos(&v62)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 v79 = (v10 >> 5) + 14 * ((pMouse->GetCursorPos(&v66)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 if ( pMouse->GetCursorPos(&v58)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 if ( pMouse->GetCursorPos(&v64)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier);
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4769 v12 = (int)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v11 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 if ( !(*(char *)(v12 + 20) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 *(int *)(v12 + 20) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 v0->PlaySound(73, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 v9 = pGlobalTXT_LocalizationStrings[569];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 v51 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 v79 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v70)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 if ( pMouse->GetCursorPos(&v60)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 if ( pMouse->GetCursorPos(&v72)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4811 v3 = (int)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4815 auto _v = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 v5 = _v->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 v6 = v0->_4B81C3(v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 v7 = (*(char *)(v3 + 20) & 2) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 v80 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 v8 = *(int *)(v3 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 LOBYTE(v8) = v8 & 0xFD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 *(int *)(v3 + 20) = v8 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 v0->PlaySound(74, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 v9 = pGlobalTXT_LocalizationStrings[570];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 ShowStatusBarString(v9, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 HousePlaySomeSound((unsigned int)v13, v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 v51 = 79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 v27 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 goto LABEL_30;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 //----- (004BE386) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 void __fastcall log_error(const char *pMessage)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 FILE *f; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 FILE *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 v1 = pMessage;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 f = fopen("errorlog.txt", "a");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 v3 = f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 if ( f )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 fprintf(f, "%s\n", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 fflush(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 //----- (004BE3BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 FrameTableTxtLine *texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 signed int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 unsigned int v4; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 FrameTableTxtLine *result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 signed int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 static struct FrameTableTxtLine static_stru_F8BA58; // weak
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 static_stru_F8BA58.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 if ( _this && *_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 v2 = (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 v4 = _this - (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 v5 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 if ( v5 != 32 && v5 != 44 && v5 != 9 || v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 if ( v5 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 if ( v2[v4 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 if ( static_stru_F8BA58.field_0 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 while ( (unsigned int)v2 < (unsigned int)&unk_F8BA50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 memcpy(a2, &static_stru_F8BA58, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 // F8BA58: using guessed type FrameTableTxtLine static_stru_F8BA58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 //----- (004BE485) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 FrameTableTxtLine *result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 unsigned int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 stru_F8B5E8.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 if ( pString && *pString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 v2 = (char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 v7 = pString - (const char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 v5 = v2[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 *v2 = v5;
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 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 if ( v5 == ',' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 if ( v5 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 if ( v5 == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 if ( v2[v7 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 if ( stru_F8B5E8.field_0 < 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 if ( (unsigned int)v2 < (unsigned int)&unk_F8B5E0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 memcpy(a2, &stru_F8B5E8, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 // F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 //----- (004BE571) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 int i; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 result = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 if ( a3 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 for ( i = 0; i < a3; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 if ( a1 == a2[i] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 if ( i == a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 a2[a3] = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 result = a3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 //----- (004BF91E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 unsigned int __thiscall GameOverMenu(void *ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 unsigned int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 char *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 char *v4; // ST24_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 int v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 char *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 char *v7; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 char *v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 char *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 unsigned int v10; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 MSG Msg; // [sp+88h] [bp-48h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 void *v15; // [sp+A8h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 char *pInString; // [sp+ACh] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 unsigned int v17; // [sp+B0h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 unsigned int v19; // [sp+B8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 int v20; // [sp+BCh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 int i; // [sp+C0h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 v15 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 //RGBTexture::RGBTexture(&this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 BYTE1(dword_6BE364_game_settings_1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 pRenderer->ClearBlack();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 _449B57_test_bit(pParty->_award_bits, 99);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 _this.Load("winbg.pcx", 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 pRenderer->DrawTextureRGB(0, 0, &_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 free(_this.pPixels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 _this.pPixels = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5124 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 pWindow.uFrameX = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 pWindow.uFrameY = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 pWindow.uFrameWidth = 469;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 pWindow.uFrameHeight = 338;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 pWindow.uFrameZ = 543;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 pWindow.uFrameW = 397;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 pFont = LoadFont("endgame.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 99) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 v1 = pGlobalTXT_LocalizationStrings[675];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 result = _449B57_test_bit(pParty->_award_bits, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 if ( !(short)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 v1 = pGlobalTXT_LocalizationStrings[676];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 pInString = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v23 = pParty->uTimePlayed - 138240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 v17 = v19 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 pWindow.DrawText2(pFont, 1u, 0x23u, 1u, pGlobalTXT_LocalizationStrings[9], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 v3 = pParty->pPlayers[0].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 v23 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 v4 = pClassNames[(unsigned __int8)v3[17]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 v5 = ((Player *)(v3 - 168))->GetBaseLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 pWindow.DrawText2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 pFont,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 v23 += __PAIR__(*(int *)(i - 4), *(int *)(i - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 i += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 if ( i >= (signed int)&pParty->pPickedItem.uNumCharges )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 v23 = (signed __int64)v23 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 pWindow.DrawText2(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 v7 = pGlobalTXT_LocalizationStrings[56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 if ( v17 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 v7 = pGlobalTXT_LocalizationStrings[57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 v8 = pGlobalTXT_LocalizationStrings[146];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 if ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 v8 = pGlobalTXT_LocalizationStrings[148];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 v9 = pGlobalTXT_LocalizationStrings[245];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 if ( v14 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 v9 = pGlobalTXT_LocalizationStrings[132];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 sprintfex(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 pRenderer->pBeforePresentFunction();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 pRenderer->_49F1BC("MM7_Win.Pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 pAllocator->FreeChunk(pFont);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 if ( v15 == (void *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 LODWORD(v23) = GetTickCount() + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 while ( (unsigned int)v23 > GetTickCount() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 v10 = PeekMessageA(&Msg, 0, 0, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 pMessageQueue_50CBD0->uNumMessages = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 pKeyActionMap->uLastKeyPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 while ( !pKeyActionMap->uLastKeyPressed );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
5270
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 //----- (004C0262) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 void Viewport::SetScreen(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 unsigned int x; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 unsigned int z; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 unsigned int w; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 char no_3d; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 if ( (signed int)uX > (signed int)uZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 z = uZ ^ uX ^ uZ; // swap x and z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 x = z ^ uZ ^ uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 if ( (signed int)uY > (signed int)uW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 w = uW ^ uY ^ uW; // swap y and w
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 y = w ^ uW ^ uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 this->uScreenX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 this->uScreenY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 this->uScreenZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 this->uScreenW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 no_3d = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 this->uScreenWidth = z - x + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 this->uScreenCenterX = (signed int)(z + x) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 if ( no_3d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 v10 = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 this->uScreenHeight = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 this->uScreenCenterY = this->uScreenW - ((unsigned __int64)(this->field_30 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 this->uScreenHeight = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 this->uScreenCenterY = (signed int)(w + y) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 SetViewport(this->uScreenX, this->uScreenY, this->uScreenZ, this->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 //----- (004C02F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 void Viewport::_4C02F8(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 unsigned int v2; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 v2 = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 this->field_30 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 SetScreen(this->uScreenX, this->uScreenY, this->uScreenZ, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 //----- (004C0312) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 void Viewport::SetViewport(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 unsigned int x; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 unsigned int z; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 unsigned int w; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 if ( (signed int)uX < (signed int)this->uScreenX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 x = this->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 if ( (signed int)uY < (signed int)this->uScreenY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 y = this->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 if ( (signed int)uZ > (signed int)this->uScreenZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 z = this->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 if ( (signed int)uW > (signed int)this->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 w = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 this->uViewportY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 this->uViewportX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 this->uViewportZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 this->uViewportW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 //----- (004D6FB0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 __int16 v8; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 int v9; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 unsigned __int8 v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 v11 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 v10 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 if ( v10 ^ v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 v7 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 v8 = *(short *)(*(int *)(v1 + 52) + 2 * v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 *(short *)result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 //----- (004D705A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 int /*__usercall*/ sr_sub_4D705A/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 unsigned int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 unsigned int v8; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 __int16 v9; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 unsigned int v10; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 unsigned int v11; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 unsigned __int8 v12; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 unsigned __int8 v13; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 v10 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 v11 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 v11 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 v10 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 if ( (signed int)v11 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 v11 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 if ( (signed int)v10 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 v10 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 + (*(int *)(v1 + 12) & (v11 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 + ((*(int *)(v1 + 8) & v10) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 v13 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 v12 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 if ( v12 ^ v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 v8 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 v8 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 v7 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 if ( (signed int)v8 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 v8 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 if ( (signed int)v7 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 v7 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 v9 = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 + (*(int *)(v1 + 12) & (v8 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 + ((*(int *)(v1 + 8) & v7) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 //----- (004D714C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 int __cdecl sr_sub_4D714C(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 unsigned __int16 v9; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 unsigned int *v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 int v11; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 int v12; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 unsigned __int8 v13; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 unsigned __int8 v14; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 v12 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 *(short *)(result + 2) = v2->field_34_palette[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 v14 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 v13 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 v8 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v9 = v2->field_34_palette[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 v10 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 v11 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 *v10 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 *(v10 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 // 4D714C: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 //----- (004D71F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 int __cdecl sr_sub_4D71F8(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 unsigned int v9; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 unsigned __int16 v10; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 unsigned int *v11; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 int v12; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 int v13; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 unsigned int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 unsigned __int8 v15; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 unsigned __int8 v16; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v13 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 v14 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 v14 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 v13 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 if ( (signed int)v14 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 v14 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 if ( v13 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 v13 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 *(short *)(result + 2) = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 + (v2->field_C & (v14 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 + ((v2->field_8 & (unsigned int)v13) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 v16 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 v15 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 if ( v15 ^ v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 v8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 v9 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 v8 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 if ( (signed int)v9 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v9 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 if ( v8 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 v8 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v10 = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 + (v2->field_C & (v9 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 + ((v2->field_8 & (unsigned int)v8) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 v11 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 v12 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 *(short *)result = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 *(v11 - 1) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 // 4D71F8: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 //----- (004D72EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 int /*__usercall*/ sr_sub_4D72EC/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 unsigned int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 unsigned int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 unsigned int v10; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 unsigned int v11; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 int v12; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 unsigned __int8 v13; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 unsigned __int8 v14; // of@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 v10 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 v11 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 v10 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 v11 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 if ( (signed int)v10 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 v10 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 if ( (signed int)v11 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v11 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 v12 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 + (*(int *)(v1 + 12) & (v10 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 + ((*(int *)(v1 + 8) & v11) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 v14 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v13 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 v7 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 v8 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 v7 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 v8 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 if ( (signed int)v7 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v7 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 if ( (signed int)v8 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 v8 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 + (*(int *)(v1 + 12) & (v7 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 + ((*(int *)(v1 + 8) & v8) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 *(short *)result = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 //----- (004D73DF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 int /*__usercall*/ sr_sub_4D73DF/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 unsigned __int8 v9; // sf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 unsigned __int8 v10; // of@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 v8 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 if ( *(char *)(*(int *)(v1 + 56) + v8 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 v10 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 v9 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 if ( v9 ^ v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 v7 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 if ( *(char *)(*(int *)(v1 + 56) + v7 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 *(short *)result = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 + v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 //----- (004D754B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 void __cdecl sr_sub_4D754B(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 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
5830 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 a1->pColorBuffer = v11 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 a1->pDepthBuffer = v12 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 //----- (004D7630) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 void __cdecl sr_sub_4D7630(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 unsigned __int16 *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 unsigned __int16 v7; // bx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 unsigned __int16 *v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873 unsigned int *v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 int v11; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 int v12; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 int v13; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 int v14; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 v14 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 v3 = *((char *)a1->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 v4 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 v5 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 if ( v5 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 v5 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 if ( a2->field_8 - v5 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 v6 = a2->field_8 - v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v3 += v6 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 v4 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 v7 = v4[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 v8 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 v9 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 *v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 *v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 a1->pColorBuffer = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 a1->pDepthBuffer = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 v11 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 v12 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 v13 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 a1->field_30 = a1->field_4 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 a1->field_2C = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 v2 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916 while ( v14 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 //----- (004D76ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 void __cdecl sr_sub_4D76ED(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 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
5956 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 v7 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 a1->pColorBuffer = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 a1->pDepthBuffer = v12 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 //----- (004D77D2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 void __cdecl sr_sub_4D77D2(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 unsigned __int16 *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994 unsigned __int16 *v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 int v6; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5997 unsigned __int16 v8; // bx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 unsigned int *v10; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000 unsigned int *v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002 int v13; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 int v14; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 int v15; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 v3 = a1->pTextureLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 v4 = *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 v5 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 if ( *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 v6 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 if ( v6 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 v6 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 if ( a2->field_8 - v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 v7 = a2->field_8 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 v4 += v7 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 v5 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 v8 = v5[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 v9 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 *a1->pColorBuffer = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 *v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 v11 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 a1->pDepthBuffer = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 v12 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 v13 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 v14 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 a1->field_30 = a1->field_4 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 a1->field_2C = v14 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 v2 = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 while ( v15 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 //----- (004D789A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 void __cdecl sr_sub_4D789A(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 int v7; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 int v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 unsigned __int16 v9; // bx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 int v10; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 unsigned int *v11; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 unsigned int *v12; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 int v13; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 int v15; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 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
6089 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 v11 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 *a1->pColorBuffer = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 *v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 v12 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 a1->pDepthBuffer = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 //----- (00451007) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6128 int stru350::sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6129 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6130 int a10, int a11)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6131 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6132 int v11; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6133 int result; // eax@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6134 int v13; // edi@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6135 int v14; // ecx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 double v15; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 double v16; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 float v17; // ST3C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 float v18; // ST38_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 unsigned int v19; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 int v21; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 unsigned int v22; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 unsigned int v23; // eax@29
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6145 unsigned __int16 *v24; // ecx@29
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6146 int v25; // edi@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6147 int v26; // ecx@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 double v27; // st7@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 double v28; // st6@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 float v29; // ST34_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 float v30; // ST30_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 unsigned int v31; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 int v32; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 int v33; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 unsigned int v34; // ecx@50
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6156 unsigned __int16 v35; // ax@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6157 unsigned __int16 *v36; // ecx@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6158 int v37; // edi@58
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6159 int v38; // ecx@60
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 double v39; // st7@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 double v40; // st6@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 float v41; // ST34_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 float v42; // ST30_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 unsigned int v43; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 int v44; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 int v45; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 unsigned int v46; // ecx@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 char v47; // al@79
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6169 unsigned __int16 *v48; // ecx@79
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6170 int v49; // edi@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6171 int v50; // ecx@88
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 double v51; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 double v52; // st6@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 float v53; // ST34_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 float v54; // ST30_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 unsigned int v55; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 int v56; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 int v57; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 unsigned int v58; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 unsigned int v59; // eax@107
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6181 unsigned __int16 *v60; // ecx@107
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6182 int v61; // edi@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6183 int v62; // ecx@113
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 double v63; // st7@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 double v64; // st6@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 float v65; // ST34_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 float v66; // ST30_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 unsigned int v67; // esi@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 int v68; // eax@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 int v69; // eax@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 unsigned int v70; // ecx@128
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6192 unsigned __int16 v71; // ax@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6193 unsigned __int16 *v72; // ecx@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6194 int v73; // edi@136
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6195 int v74; // ecx@138
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 double v75; // st7@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 double v76; // st6@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 float v77; // ST34_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 float v78; // ST30_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 unsigned int v79; // esi@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 int v80; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 int v81; // eax@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 unsigned int v82; // ecx@153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 char v83; // al@157
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6205 unsigned __int16 *v84; // ecx@157
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6206 int v85; // edi@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6207 int v86; // ecx@166
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 double v87; // st7@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 double v88; // st6@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 float v89; // ST34_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 float v90; // ST30_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 unsigned int v91; // esi@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 signed int v92; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 int v93; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 int v94; // eax@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 unsigned int v95; // ecx@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 unsigned int v96; // eax@185
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6218 unsigned __int16 *v97; // ecx@185
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6219 int v98; // edi@189
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6220 int v99; // ecx@191
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 double v100; // st7@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 double v101; // st6@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 float v102; // ST34_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 float v103; // ST30_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 unsigned int v104; // esi@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 signed int v105; // eax@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 int v106; // eax@196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 int v107; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 unsigned int v108; // ecx@206
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6230 unsigned __int16 v109; // ax@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6231 unsigned __int16 *v110; // ecx@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6232 int v111; // edi@214
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6233 int v112; // ecx@216
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 double v113; // st7@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 double v114; // st6@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 float v115; // ST34_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 float v116; // ST30_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 unsigned int v117; // esi@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 signed int v118; // eax@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 int v119; // eax@221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 int v120; // eax@223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 unsigned int v121; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 char v122; // al@235
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6244 unsigned __int16 *v123; // ecx@235
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 double v124; // [sp+Ch] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 double v125; // [sp+Ch] [bp-7Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 double v126; // [sp+Ch] [bp-7Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 double v127; // [sp+Ch] [bp-7Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6249 //double v128; // [sp+Ch] [bp-7Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6250 uint _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 double v129; // [sp+Ch] [bp-7Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 double v130; // [sp+Ch] [bp-7Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 double v131; // [sp+Ch] [bp-7Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 double v132; // [sp+Ch] [bp-7Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 double v133; // [sp+14h] [bp-74h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 double v134; // [sp+14h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 double v135; // [sp+14h] [bp-74h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 double v136; // [sp+14h] [bp-74h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6259 //double v137; // [sp+14h] [bp-74h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6260 uint _v137;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 double v138; // [sp+14h] [bp-74h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 double v139; // [sp+14h] [bp-74h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 double v140; // [sp+14h] [bp-74h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 double v141; // [sp+14h] [bp-74h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 double v142; // [sp+1Ch] [bp-6Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 double v143; // [sp+1Ch] [bp-6Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 double v144; // [sp+1Ch] [bp-6Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 double v145; // [sp+1Ch] [bp-6Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6269 //double v146; // [sp+1Ch] [bp-6Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6270 uint _v146;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 double v147; // [sp+1Ch] [bp-6Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 double v148; // [sp+1Ch] [bp-6Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 double v149; // [sp+1Ch] [bp-6Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 double v150; // [sp+1Ch] [bp-6Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 double v151; // [sp+24h] [bp-64h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 double v152; // [sp+24h] [bp-64h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 double v153; // [sp+24h] [bp-64h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 double v154; // [sp+24h] [bp-64h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6279 //double v155; // [sp+24h] [bp-64h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6280 uint _v155;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 double v156; // [sp+24h] [bp-64h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 double v157; // [sp+24h] [bp-64h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 double v158; // [sp+24h] [bp-64h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 double v159; // [sp+24h] [bp-64h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 int v160; // [sp+3Ch] [bp-4Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 int v161; // [sp+40h] [bp-48h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 int v162; // [sp+44h] [bp-44h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 int v163; // [sp+44h] [bp-44h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 int v164; // [sp+44h] [bp-44h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 int v165; // [sp+44h] [bp-44h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 int v166; // [sp+44h] [bp-44h]@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 int v167; // [sp+44h] [bp-44h]@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 int v168; // [sp+44h] [bp-44h]@194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 int v169; // [sp+44h] [bp-44h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 int v170; // [sp+48h] [bp-40h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 int v171; // [sp+48h] [bp-40h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 int v172; // [sp+48h] [bp-40h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 int v173; // [sp+48h] [bp-40h]@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 int v174; // [sp+48h] [bp-40h]@141
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6300 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 int *v176; // [sp+50h] [bp-38h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 int *v177; // [sp+50h] [bp-38h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 int *v178; // [sp+50h] [bp-38h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 int *v179; // [sp+50h] [bp-38h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 int *v180; // [sp+50h] [bp-38h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 int *v181; // [sp+50h] [bp-38h]@143
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6307 char *v182; // [sp+50h] [bp-38h]@169
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6308 char *v183; // [sp+50h] [bp-38h]@194
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6309 char *v184; // [sp+50h] [bp-38h]@219
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6310 unsigned __int16 *v185; // [sp+54h] [bp-34h]@38
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6311 unsigned __int16 *v186; // [sp+54h] [bp-34h]@63
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6312 unsigned __int16 *v187; // [sp+54h] [bp-34h]@91
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6313 unsigned __int16 *v188; // [sp+54h] [bp-34h]@116
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6314 unsigned __int16 *v189; // [sp+54h] [bp-34h]@141
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 signed int v190; // [sp+54h] [bp-34h]@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 signed int v191; // [sp+54h] [bp-34h]@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 signed int v192; // [sp+54h] [bp-34h]@220
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6318 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6319 unsigned __int16 *v194; // [sp+5Ch] [bp-2Ch]@32
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6320 unsigned __int16 *v195; // [sp+5Ch] [bp-2Ch]@57
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6321 unsigned __int16 *v196; // [sp+5Ch] [bp-2Ch]@85
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6322 unsigned __int16 *v197; // [sp+5Ch] [bp-2Ch]@110
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6323 unsigned __int16 *v198; // [sp+5Ch] [bp-2Ch]@135
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6324 unsigned __int16 *v199; // [sp+5Ch] [bp-2Ch]@163
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6325 unsigned __int16 *v200; // [sp+5Ch] [bp-2Ch]@188
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6326 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6327 //stru350 *v202; // [sp+60h] [bp-28h]@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6328 int v203; // [sp+64h] [bp-24h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6329 int v204; // [sp+64h] [bp-24h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6330 int v205; // [sp+64h] [bp-24h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6331 int v206; // [sp+64h] [bp-24h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6332 int v207; // [sp+64h] [bp-24h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6333 int v208; // [sp+64h] [bp-24h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6334 int v209; // [sp+64h] [bp-24h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6335 int v210; // [sp+64h] [bp-24h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6336 int v211; // [sp+64h] [bp-24h]@218
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 float v212; // [sp+6Ch] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 float v213; // [sp+6Ch] [bp-1Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 float v214; // [sp+6Ch] [bp-1Ch]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 float v215; // [sp+6Ch] [bp-1Ch]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 float v216; // [sp+6Ch] [bp-1Ch]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 float v217; // [sp+6Ch] [bp-1Ch]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 float v218; // [sp+6Ch] [bp-1Ch]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 float v219; // [sp+6Ch] [bp-1Ch]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 float v220; // [sp+6Ch] [bp-1Ch]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 float v221; // [sp+70h] [bp-18h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 float v222; // [sp+70h] [bp-18h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 float v223; // [sp+70h] [bp-18h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 float v224; // [sp+70h] [bp-18h]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 float v225; // [sp+70h] [bp-18h]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 float v226; // [sp+70h] [bp-18h]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 float v227; // [sp+70h] [bp-18h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 float v228; // [sp+70h] [bp-18h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 float v229; // [sp+70h] [bp-18h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 signed int v230; // [sp+74h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 signed int v231; // [sp+78h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 signed int v232; // [sp+78h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 signed int v233; // [sp+78h] [bp-10h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 signed int v234; // [sp+78h] [bp-10h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 signed int v235; // [sp+78h] [bp-10h]@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 signed int v236; // [sp+78h] [bp-10h]@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 signed int v237; // [sp+78h] [bp-10h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 signed int v238; // [sp+78h] [bp-10h]@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 signed int v239; // [sp+78h] [bp-10h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 __int64 v240; // [sp+7Ch] [bp-Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 __int64 v241; // [sp+7Ch] [bp-Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 __int64 v242; // [sp+7Ch] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 __int64 v243; // [sp+7Ch] [bp-Ch]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 __int64 v244; // [sp+7Ch] [bp-Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 __int64 v245; // [sp+7Ch] [bp-Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 unsigned int v246; // [sp+7Ch] [bp-Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 unsigned int v247; // [sp+7Ch] [bp-Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 unsigned int v248; // [sp+7Ch] [bp-Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 unsigned int v249; // [sp+80h] [bp-8h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 unsigned int v250; // [sp+80h] [bp-8h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 unsigned int v251; // [sp+80h] [bp-8h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 unsigned int v252; // [sp+84h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 unsigned int v253; // [sp+84h] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 unsigned int v254; // [sp+84h] [bp-4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 unsigned int v255; // [sp+84h] [bp-4h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 unsigned int v256; // [sp+84h] [bp-4h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 unsigned int v257; // [sp+84h] [bp-4h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 unsigned int v258; // [sp+84h] [bp-4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 unsigned int v259; // [sp+84h] [bp-4h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 unsigned int v260; // [sp+84h] [bp-4h]@218
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6386 signed int a6a; // [sp+A0h] [bp+18h]@10
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6387 float a6s; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6388 float a6t; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6389 unsigned int a6b; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6390 signed int a6c; // [sp+A0h] [bp+18h]@35
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6391 float a6u; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6392 float a6v; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6393 unsigned int a6d; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6394 signed int a6e; // [sp+A0h] [bp+18h]@60
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6395 float a6w; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6396 float a6x; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6397 unsigned int a6f; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6398 signed int a6g; // [sp+A0h] [bp+18h]@88
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6399 float a6y; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6400 float a6z; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6401 unsigned int a6h; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6402 signed int a6i; // [sp+A0h] [bp+18h]@113
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6403 float a6ba; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6404 float a6bb; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6405 unsigned int a6j; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6406 signed int a6k; // [sp+A0h] [bp+18h]@138
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6407 float a6bc; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6408 float a6bd; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6409 unsigned int a6l; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6410 signed int a6m; // [sp+A0h] [bp+18h]@166
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6411 float a6be; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6412 float a6bf; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6413 unsigned int a6n; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6414 signed int a6o; // [sp+A0h] [bp+18h]@191
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6415 float a6bg; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6416 float a6bh; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6417 unsigned int a6p; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6418 signed int a6q; // [sp+A0h] [bp+18h]@216
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6419 float a6bi; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6420 float a6bj; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6421 unsigned int a6r; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6422 int a9a; // [sp+ACh] [bp+24h]@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6423 int a9b; // [sp+ACh] [bp+24h]@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6424 int a9c; // [sp+ACh] [bp+24h]@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6425 int a9d; // [sp+ACh] [bp+24h]@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6426 int a9e; // [sp+ACh] [bp+24h]@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6427 int a9f; // [sp+ACh] [bp+24h]@189
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 v11 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6430 result = this->field_0.field_C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6431 //v202 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 if ( result != 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6439 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6444 if ( result != 32 || (result = (int)pDst, v193 = pDst, v231 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6446 v13 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6447 a9a = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 v14 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6451 a6a = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6452 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 LABEL_30:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6455 v193 = (unsigned __int16 *)((char *)v193 + a9a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 ++v231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 result = v231;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6458 if ( v231 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6462 v221 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6463 v212 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6464 v15 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6465 v16 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6468 a6s = (double)a6a / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6469 v151 = floorf(a6s + 0.5f);//a6s + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 v203 = v14 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6471 a6t = (double)(v14 + 1) / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6472 v142 = floorf(a6t + 0.5f);//a6t + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 v17 = (double)v231 / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6474 v133 = floorf(v17 + 0.5f);//v17 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 v18 = (double)(v231 + 1) / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6476 v124 = floorf(v18 + 0.5f);//v18 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 v252 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6479 a6b = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 v240 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 if ( SLODWORD(v133) < SLODWORD(v124) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 v22 = (unsigned int)v240 / ((LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6487 a6b /= v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 v252 /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 HIDWORD(v240) /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 if ( v22 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 v22 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6493 v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 v24 = v193;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6495 v193 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6496 *(_DWORD *)v24 = v23;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 v14 = v203;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6498 a6a = v203;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6499 if ( v203 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 v160 = LODWORD(v124) - LODWORD(v133);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6503 v175 = &pSrc[2 * (LODWORD(v151) + srcPitch * LODWORD(v133))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 while ( SLODWORD(v151) >= SLODWORD(v142) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 LABEL_24:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6507 v175 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 --v160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 if ( !v160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 v176 = (int *)v175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 v161 = LODWORD(v142) - LODWORD(v151);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 v20 = *v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 v13 = v20 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6522 v21 = _450FB1(v20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 LODWORD(v240) = v13 + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 ++v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 --v161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 if ( !v161 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 LODWORD(v240) = ((unsigned int)v21 >> 24) + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 LABEL_22:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6538 a6b += BYTE2(v21);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 v252 += BYTE1(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 HIDWORD(v240) += (unsigned __int8)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6543 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6544 v194 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 v232 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6546 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6548 v25 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6549 a9b = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 v26 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6553 a6c = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6554 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 LABEL_55:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6557 v194 = (unsigned __int16 *)((char *)v194 + a9b);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 ++v232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 result = v232;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6560 if ( v232 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6564 v222 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6565 v213 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6566 v27 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6567 v28 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6570 a6u = (double)a6c / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6571 v125 = a6u + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 v204 = v26 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6573 a6v = (double)(v26 + 1) / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6574 v134 = a6v + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 v29 = (double)v232 / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 v143 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 v30 = (double)(v232 + 1) / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 v152 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 v31 = (LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 v253 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6581 a6d = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 v241 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 if ( SLODWORD(v143) < SLODWORD(v152) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 v34 = (unsigned int)v241 / ((LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 if ( v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6589 a6d /= v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 v253 /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 HIDWORD(v241) /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 if ( v34 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 v34 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6595 v35 = _450F55(HIDWORD(v241) | ((v253 | ((a6d | (v34 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 v36 = v194;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6597 ++v194;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6598 *v36 = v35;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 v26 = v204;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6600 a6c = v204;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6601 if ( v204 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 v170 = LODWORD(v152) - LODWORD(v143);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6605 v185 = &pSrc[2 * (LODWORD(v125) + srcPitch * LODWORD(v143))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 while ( SLODWORD(v125) >= SLODWORD(v134) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 LABEL_49:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6609 v185 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 --v170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 if ( !v170 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 v177 = (int *)v185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 v162 = LODWORD(v134) - LODWORD(v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 v32 = *v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 v25 = v32 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6624 v33 = _450FB1(v32);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 LODWORD(v241) = v25 + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 ++v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 --v162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 if ( !v162 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 LODWORD(v241) = ((unsigned int)v33 >> 24) + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 LABEL_47:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6640 a6d += BYTE2(v33);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 v253 += BYTE1(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 HIDWORD(v241) += (unsigned __int8)v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6645 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6646 v195 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 v233 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6648 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6650 v37 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 v38 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6654 a6e = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6655 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 LABEL_80:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6658 v195 = (unsigned __int16 *)((char *)v195 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 ++v233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 result = v233;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6661 if ( v233 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6665 v223 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6666 v214 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6667 v39 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6668 v40 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6671 a6w = (double)a6e / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6672 v126 = a6w + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 v205 = v38 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6674 a6x = (double)(v38 + 1) / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6675 v135 = a6x + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 v41 = (double)v233 / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 v144 = v41 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 v42 = (double)(v233 + 1) / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 v153 = v42 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 v43 = (LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 v254 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6682 a6f = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 v242 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 if ( SLODWORD(v144) < SLODWORD(v153) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 v46 = (unsigned int)v242 / ((LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6690 a6f /= v43;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 v254 /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 HIDWORD(v242) /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 if ( v46 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 v46 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6696 v47 = _450F55(HIDWORD(v242) | ((v254 | ((a6f | (v46 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6697 v48 = v195;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6698 v195 = (unsigned __int16 *)((char *)v195 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6699 *(_BYTE *)v48 = v47;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 v38 = v205;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6701 a6e = v205;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6702 if ( v205 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 v171 = LODWORD(v153) - LODWORD(v144);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6706 v186 = &pSrc[2 * (LODWORD(v126) + srcPitch * LODWORD(v144))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 while ( SLODWORD(v126) >= SLODWORD(v135) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 LABEL_74:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6710 v186 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 --v171;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 if ( !v171 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 v178 = (int *)v186;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 v163 = LODWORD(v135) - LODWORD(v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 v44 = *v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 v37 = v44 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6725 v45 = _450FB1(v44);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 LODWORD(v242) = v37 + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 --v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 ++v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 --v163;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 if ( !v163 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 LODWORD(v242) = ((unsigned int)v45 >> 24) + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 LABEL_72:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6741 a6f += BYTE2(v45);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 v254 += BYTE1(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 HIDWORD(v242) += (unsigned __int8)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6746 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6751 if ( result != 32 || (result = (int)pDst, v196 = pDst, v234 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6753 v49 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6754 a9c = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 v50 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6758 a6g = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6759 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 LABEL_108:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6762 v196 = (unsigned __int16 *)((char *)v196 + a9c);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 ++v234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 result = v234;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6765 if ( v234 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6769 v224 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6770 v215 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6771 v51 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6772 v52 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6775 a6y = (double)a6g / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6776 v127 = a6y + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 v206 = v50 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6778 a6z = (double)(v50 + 1) / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6779 v136 = a6z + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 v53 = (double)v234 / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 v145 = v53 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 v54 = (double)(v234 + 1) / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 v154 = v54 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v55 = (LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v255 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6786 a6h = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v243 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 if ( SLODWORD(v145) < SLODWORD(v154) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 v58 = (unsigned int)v243 / ((LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6794 a6h /= v55;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 v255 /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 HIDWORD(v243) /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 if ( v58 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 v58 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6800 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 v60 = v196;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6802 v196 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6803 *(_DWORD *)v60 = v59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 v50 = v206;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6805 a6g = v206;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6806 if ( v206 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 v172 = LODWORD(v154) - LODWORD(v145);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6810 v187 = &pSrc[LODWORD(v127) + srcPitch * LODWORD(v145)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 while ( SLODWORD(v127) >= SLODWORD(v136) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 LABEL_102:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6814 v187 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 --v172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 if ( !v172 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 v179 = (int *)v187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 v164 = LODWORD(v136) - LODWORD(v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6823 v56 = *(_WORD *)v179;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 v49 = v56 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6829 v57 = _450FB1(v56);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 LODWORD(v243) = v49 + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 --v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 v179 = (int *)((char *)v179 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 --v164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 if ( !v164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 LODWORD(v243) = ((unsigned int)v57 >> 24) + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 LABEL_100:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6845 a6h += BYTE2(v57);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 v255 += BYTE1(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 HIDWORD(v243) += (unsigned __int8)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6850 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6851 v197 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 v235 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6853 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6855 v61 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6856 a9d = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 v62 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6860 a6i = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6861 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 LABEL_133:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6864 v197 = (unsigned __int16 *)((char *)v197 + a9d);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 ++v235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 result = v235;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6867 if ( v235 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6871 v225 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6872 v216 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6873 v63 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6874 v64 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6877 a6ba = (double)a6i / v225 * v216;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6878 _v128 = floorf(a6ba + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6879 //v128 = a6ba + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 v207 = v62 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6881 a6bb = (double)(v62 + 1) / v225 * v216;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6882 //v137 = a6bb + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6883 _v137 = floorf(a6bb + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v65 = (double)v235 / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6885 //v146 = v65 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6886 _v146 = floorf(v65 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 v66 = (double)(v235 + 1) / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6888 //v155 = v66 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6889 _v155 = floorf(v66 + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6890 //v67 = (LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6891 v67 = (_v155 - _v146) * (_v137 - _v128);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 v256 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6893 a6j = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 v244 = 0i64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6895 //if ( SLODWORD(v146) < SLODWORD(v155) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6896 if (_v146 < _v155)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 LABEL_128:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6899 //v70 = (unsigned int)v244 / ((LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128)));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6900 v70 = (unsigned int)v244 / ((_v155 - _v146) * (_v137 - _v128));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 if ( v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6903 a6j /= v67;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 v256 /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 HIDWORD(v244) /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 if ( v70 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 v70 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6909 v71 = _450F55(HIDWORD(v244) | ((v256 | ((a6j | (v70 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 v72 = v197;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6911 ++v197;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6912 *v72 = v71;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 v62 = v207;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6914 a6i = v207;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6915 if ( v207 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 goto LABEL_133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6918 //v173 = LODWORD(v155) - LODWORD(v146);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6919 v173 = _v155 - _v146;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6920 //v188 = &pSrc[LODWORD(v128) + srcPitch * LODWORD(v146)];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6921 v188 = &pSrc[_v128 + srcPitch * _v146];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6922 //while ( SLODWORD(v128) >= SLODWORD(v137) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6923 while (_v128 >= _v137)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 LABEL_127:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6926 v188 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 --v173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 if ( !v173 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 v180 = (int *)v188;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6932 //v165 = LODWORD(v137) - LODWORD(v128);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6933 v165 = _v137 - _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6936 v68 = *(_WORD *)v180;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v61 = v68 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6942 v69 = _450FB1(v68);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 LODWORD(v244) = v61 + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 if ( v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 v180 = (int *)((char *)v180 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 --v165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 if ( !v165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 goto LABEL_127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 LODWORD(v244) = ((unsigned int)v69 >> 24) + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 LABEL_125:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6958 a6j += BYTE2(v69);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 v256 += BYTE1(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 HIDWORD(v244) += (unsigned __int8)v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6963 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6964 v198 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 v236 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6966 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6968 v73 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 v74 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6972 a6k = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6973 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 LABEL_158:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6976 v198 = (unsigned __int16 *)((char *)v198 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 ++v236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 result = v236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6979 if ( v236 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6983 v226 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6984 v217 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6985 v75 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6986 v76 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6989 a6bc = (double)a6k / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6990 v129 = a6bc + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 v208 = v74 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6992 a6bd = (double)(v74 + 1) / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6993 v138 = a6bd + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v77 = (double)v236 / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 v147 = v77 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 v78 = (double)(v236 + 1) / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 v156 = v78 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v257 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 v79 = (LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7000 a6l = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 v245 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 if ( SLODWORD(v147) < SLODWORD(v156) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 LABEL_153:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 v82 = (unsigned int)v245 / ((LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 if ( v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7008 a6l /= v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 v257 /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 HIDWORD(v245) /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 if ( v82 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 v82 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7014 v83 = _450F55(HIDWORD(v245) | ((v257 | ((a6l | (v82 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7015 v84 = v198;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7016 v198 = (unsigned __int16 *)((char *)v198 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7017 *(_BYTE *)v84 = v83;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 v74 = v208;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7019 a6k = v208;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7020 if ( v208 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 goto LABEL_158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 v174 = LODWORD(v156) - LODWORD(v147);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7024 v189 = &pSrc[LODWORD(v129) + srcPitch * LODWORD(v147)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 while ( SLODWORD(v129) >= SLODWORD(v138) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 LABEL_152:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7028 v189 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 --v174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 if ( !v174 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 goto LABEL_153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 v166 = LODWORD(v138) - LODWORD(v129);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 v181 = (int *)v189;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7037 v80 = *(_WORD *)v181;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 v73 = v80 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7043 v81 = _450FB1(v80);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 LODWORD(v245) = v73 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 --v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 v181 = (int *)((char *)v181 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 --v166;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 if ( !v166 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 LODWORD(v245) = ((unsigned int)v81 >> 24) + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 LABEL_150:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7059 a6l += BYTE2(v81);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 v257 += BYTE1(v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 HIDWORD(v245) += (unsigned __int8)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7064 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 if ( result == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7067 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7068 v201 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 v239 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7070 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7072 v111 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 v112 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7076 a6q = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7077 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 goto LABEL_236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7079 v229 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7080 v220 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7081 v113 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7082 v114 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7085 a6bi = (double)a6q / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7086 v132 = a6bi + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 v211 = v112 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7088 a6bj = (double)(v112 + 1) / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7089 v141 = a6bj + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 v115 = (double)v239 / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 v150 = v115 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 v116 = (double)(v239 + 1) / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 v159 = v116 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 v251 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 v260 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7097 a6r = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 v248 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 if ( SLODWORD(v150) >= SLODWORD(v159) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 goto LABEL_231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 v169 = LODWORD(v159) - LODWORD(v150);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7102 v184 = (char *)pSrc + srcPitch * LODWORD(v150);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 v118 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 v192 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 while ( v118 < SLODWORD(v141) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7109 v119 = (unsigned __int8)v184[v192];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 v111 = v119 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7115 v120 = _450FB1(v119);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 v248 += v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 if ( !v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 --v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 goto LABEL_228;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 v248 += (unsigned int)v120 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7130 a6r += BYTE2(v120);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 v260 += BYTE1(v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 v251 += (unsigned __int8)v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 LABEL_228:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 ++v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 v118 = v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7137 v184 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 --v169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 while ( v169 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 LABEL_231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 if ( v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7145 a6r /= v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 v260 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 v251 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 if ( v121 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 v121 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7151 v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7152 v123 = v201;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7153 v201 = (unsigned __int16 *)((char *)v201 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7154 *(_BYTE *)v123 = v122;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 v112 = v211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7156 a6q = v211;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7157 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7158 while ( v211 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 LABEL_236:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7160 v201 = (unsigned __int16 *)((char *)v201 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 ++v239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 result = v239;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7163 if ( v239 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 if ( result == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7170 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7171 v200 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 v238 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7173 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7175 v98 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7176 a9f = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 v99 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7180 a6o = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7181 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 goto LABEL_211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7183 v228 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7184 v219 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7185 v100 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7186 v101 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7189 a6bg = (double)a6o / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7190 v131 = a6bg + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v210 = v99 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7192 a6bh = (double)(v99 + 1) / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7193 v140 = a6bh + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v102 = (double)v238 / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 v149 = v102 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 v103 = (double)(v238 + 1) / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v158 = v103 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v250 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 v259 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7201 a6p = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 v247 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 if ( SLODWORD(v149) >= SLODWORD(v158) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 goto LABEL_206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 v168 = LODWORD(v158) - LODWORD(v149);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7206 v183 = (char *)pSrc + srcPitch * LODWORD(v149);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 v105 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v191 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 while ( v105 < SLODWORD(v140) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7213 v106 = (unsigned __int8)v183[v191];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 v98 = v106 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7219 v107 = _450FB1(v106);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v247 += v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 if ( !v98 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 --v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 goto LABEL_203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 v247 += (unsigned int)v107 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7234 a6p += BYTE2(v107);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v259 += BYTE1(v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 v250 += (unsigned __int8)v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 LABEL_203:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 ++v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v105 = v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7241 v183 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 --v168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 while ( v168 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 LABEL_206:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 if ( v104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7249 a6p /= v104;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 v259 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 v250 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 if ( v108 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 v108 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7255 v109 = _450F55(v250 | ((v259 | ((a6p | (v108 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 v110 = v200;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7257 ++v200;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7258 *v110 = v109;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 v99 = v210;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7260 a6o = v210;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7261 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7262 while ( v210 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 LABEL_211:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7264 v200 = (unsigned __int16 *)((char *)v200 + a9f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 ++v238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 result = v238;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7267 if ( v238 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7272 if ( result != 32 || (result = (int)pDst, v199 = pDst, v237 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7274 v85 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7275 a9e = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 v86 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7279 a6m = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7280 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 goto LABEL_186;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7282 v227 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7283 v218 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7284 v87 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7285 v88 = (double)srcHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7286 do
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7287 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7288 a6be = (double)a6m / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7289 v130 = a6be + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v209 = v86 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7291 a6bf = (double)(v86 + 1) / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7292 v139 = a6bf + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 v89 = (double)v237 / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 v148 = v89 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 v90 = (double)(v237 + 1) / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 v157 = v90 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 v249 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 v258 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7300 a6n = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 v246 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 if ( SLODWORD(v148) >= SLODWORD(v157) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 v167 = LODWORD(v157) - LODWORD(v148);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7305 v182 = (char *)pSrc + srcPitch * LODWORD(v148);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 v92 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 v190 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 while ( v92 < SLODWORD(v139) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7312 v93 = (unsigned __int8)v182[v190];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 v85 = v93 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7318 v94 = _450FB1(v93);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 v246 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 if ( !v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 --v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 goto LABEL_178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 v246 += (unsigned int)v94 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7333 a6n += BYTE2(v94);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 v258 += BYTE1(v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 v249 += (unsigned __int8)v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 LABEL_178:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 ++v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v92 = v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7340 v182 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 --v167;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 while ( v167 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 if ( v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7348 a6n /= v91;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 v258 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 v249 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 if ( v95 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 v95 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7354 v96 = _450F55(v249 | ((v258 | ((a6n | (v95 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 v97 = v199;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7356 v199 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7357 *(_DWORD *)v97 = v96;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 v86 = v209;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7359 a6m = v209;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7360 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7361 while ( v209 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 LABEL_186:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7363 v199 = (unsigned __int16 *)((char *)v199 + a9e);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 ++v237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 result = v237;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7366 if ( v237 < dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7379
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7380
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 //----- (0044E1EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 int TextureFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 TextureFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 const void *v5; // ST0C_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 void *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 FILE *v7; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 signed int v9; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 int v11; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 int v12; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 signed int j; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 TextureFrame *v15; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 int v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 int k; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 FrameTableTxtLine v20; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 int v21; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 char *Str1; // [sp+280h] [bp-84h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 char *Str; // [sp+284h] [bp-80h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 int v24; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 int v25; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 int Argsa; // [sp+30Ch] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 Abortf("CTextureFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 v25 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 if ( v21 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 Abortf("CTextureFrameTable::load, too few arguments, %s line %i.", Args, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 v4 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 v5 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 v2->uNumTextures = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v2->pTextures = (TextureFrame *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 Abortf("CTextureFrameTable::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 v2->uNumTextures = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 fseek(v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 strcpy(v2->pTextures[v2->uNumTextures].pTextureName, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 v2->pTextures[v2->uNumTextures].uAnimTime = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 for ( v2->pTextures[v2->uNumTextures].uFlags = 0; v9 < v21; ++v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 if ( !_strcmpi((&Str1)[4 * v9], "New") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 v10 = (int)&v2->pTextures[v2->uNumTextures].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 *(char *)v10 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 ++v2->uNumTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 if ( (signed int)(v2->uNumTextures - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 v13 = (int)&v2->pTextures[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 if ( !(*(char *)(v13 + 38) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 *(char *)(v13 + 18) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 while ( v11 < (signed int)(v2->uNumTextures - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 for ( j = 0; j < (signed int)v2->uNumTextures; *(short *)(Argsa + 16) = v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 v15 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 Argsa = (int)&v15[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 v16 = *(short *)(Argsa + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 if ( *(char *)(Argsa + 18) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 for ( k = (int)&v15[j]; *(char *)(k + 18) & 1; k += 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 v16 += *(short *)(k + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 LOWORD(v16) = v15[j].uAnimTime + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 //----- (0044F57C) --------------------------------------------------------
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7507 void SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *spawn, int a3, int a4, int a5)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7508 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7509 //MapInfo *v5; // esi@1
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7510 //SpawnPointMM7 *v6; // ebx@1
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7511 int v7; // eax@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 char v8; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v9; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 int v11; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int v12; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 int v13; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 int v14; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 int v15; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 int v16; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 int v17; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 int v18; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 int v19; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 int v20; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 Actor *v22; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 int v23; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 signed int v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 int v25; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 unsigned __int16 v26; // ax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 MonsterDesc *v27; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 signed int v28; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 __int16 v29; // cx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 __int16 v30; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 __int16 v31; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 int v32; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 int v33; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 int v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 int v36; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 int v37; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 int v38; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 int v39; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 std::string v40; // [sp-18h] [bp-100h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 void *v41; // [sp-14h] [bp-FCh]@50
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7546 //void *v42; // [sp-10h] [bp-F8h]@50
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7547 //size_t v43; // [sp-Ch] [bp-F4h]@50
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 const char *v44; // [sp-8h] [bp-F0h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 char *v45; // [sp-4h] [bp-ECh]@9
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7550 char Str[32]; // [sp+Ch] [bp-DCh]@60
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7551 char Str2[120]; // [sp+2Ch] [bp-BCh]@29
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7552 unsigned int uFaceID; // [sp+A4h] [bp-44h]@52
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7553 MonsterInfo *Src; // [sp+A8h] [bp-40h]@50
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 int v50; // [sp+ACh] [bp-3Ch]@47
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7555 char Source[32]; // [sp+B0h] [bp-38h]@20
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 int v52; // [sp+D0h] [bp-18h]@34
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7557 int v53; // [sp+D4h] [bp-14h]@34
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 int v54; // [sp+D8h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 int v55; // [sp+DCh] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 int v56; // [sp+E0h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 int v57; // [sp+E4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7563 //auto a2 = spawn;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7564
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 v57 = 0;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7566 //v5 = pMapInfo;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7567 //v6 = spawn;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7569 v7 = pOutdoor->ddm.field_C_alert;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7570 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7571 v7 = pIndoor->dlv.field_C_alert;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7572 else
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7573 v7 = 0;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7574
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7575 if (v7)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7576 v8 = (spawn->uAttributes & 1) == 0;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7577 else
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7578 v8 = (spawn->uAttributes & 1) == 1;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7579
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7580 if (v8)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7581 return;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7582
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7583 //result = (void *)(spawn->uIndex - 1);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7584 v56 = 1;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7585 switch (spawn->uIndex - 1)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7586 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7587 case 0u:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 v9 = pMapInfo->uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v10 = rand();
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7590 v11 = pMapInfo->uEncounterMonster1AtMost;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v45 = pMapInfo->pEncounterMonster1Texture;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7592 v12 = v10 % (v11 - v9 + 1);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7593 v13 = pMapInfo->field_34;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7594 goto LABEL_20;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7595
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7596 case 3u:
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7597 v45 = pMapInfo->pEncounterMonster1Texture;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 goto LABEL_25;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7600
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7601 case 4u:
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7602 v45 = pMapInfo->pEncounterMonster2Texture;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7603 v44 = "%s A";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7604 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7605
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7606 case 5u:
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7607 v45 = pMapInfo->pEncounterMonster3Texture;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7608 v44 = "%s A";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7609 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7610
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7611 case 1u:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 v9 = pMapInfo->uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v14 = rand();
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7614 v15 = pMapInfo->uEncounterMonster2AtMost;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7615 v45 = pMapInfo->pEncounterMonster2Texture;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 v12 = v14 % (v15 - v9 + 1);
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7617 v13 = pMapInfo->field_37;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 goto LABEL_20;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7619
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7620 case 6u:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 goto LABEL_25;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7624
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7625 case 7u:
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7626 v45 = pMapInfo->pEncounterMonster2Texture;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7627 v44 = "%s B";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7628 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7629
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7630 case 8u:
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7631 v45 = pMapInfo->pEncounterMonster3Texture;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7632 v44 = "%s B";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7633 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7634
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7635 case 2u:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 v9 = pMapInfo->uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 v16 = rand();
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7638 v17 = pMapInfo->uEncounterMonster3AtMost;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7639 v45 = pMapInfo->pEncounterMonster3Texture;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 v12 = v16 % (v17 - v9 + 1);
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7641 v13 = pMapInfo->field_3A;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 v57 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v56 = v9 + v12;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7645 strcpy(Source, v45);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 goto LABEL_26;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7647
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7648 case 9u:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 v45 = pMapInfo->pEncounterMonster1Texture;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7650 v44 = "%s C";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7651 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7652
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7653 case 0xAu:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 v45 = pMapInfo->pEncounterMonster2Texture;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7655 v44 = "%s C";
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7656 goto LABEL_25;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7657
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7658 case 0xBu:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 LABEL_25:
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7662 sprintf(Source, v44, v45);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 LABEL_26:
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7664 if (Source[0] == '0')
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7665 return;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7666
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 v57 += a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 if ( v57 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 v57 = 4;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7670 strcpy(Str2, Source);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 v56 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 v18 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 if ( (signed int)(v56 + uNumActors) >= 500 )
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7675 return;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7676 v19 = spawn->vPosition.x;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7677 v20 = spawn->vPosition.y;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7678 v21 = spawn->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 v55 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 a4 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 a3 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 v54 = pIndoor->GetSector(v19, v20, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 v52 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 if ( v18 <= 0 )
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7688 return;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 default:
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7691 return;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7692 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7693
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7694 for (uint i = v53; i < v56; ++i)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7695 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 v22 = &pActors[uNumActors];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 pActors[uNumActors].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 v23 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 v24 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v25 = (unsigned __int16)word_4E8152[3 * v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 if ( v23 >= v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 if ( v23 < v25 + (unsigned __int16)word_4E8152[3 * v57 + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 if ( v24 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 {
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7714 v45 = Source;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 if ( v24 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 {
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7721 v45 = Source;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 if ( v24 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 goto LABEL_58;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7728 v45 = Source;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 }
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7732 sprintf(Str2, v44, v45);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7733 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7734 v26 = pMonsterList->GetMonsterByName(Str2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 v50 = (signed __int16)v26;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7736 v45 = Str2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 if ( (signed __int16)v26 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 {
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7739 sprintfex(Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7740 MessageBoxA(nullptr, Str, nullptr, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 v27 = &pMonsterList->pMonsters[(signed __int16)v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 v28 = pMonsterStats->_4563FF(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 v28 = 1;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7747 Src = &pMonsterStats->pInfos[v28];
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7748 strcpy(v22->pActorName, Src->pName);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7749 //v43 = 88;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7750 //v42 = Src;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7751 v29 = Src->uHP;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 v41 = &v22->pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 v22->sCurrentHP = v29;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7754 assert(sizeof(MonsterInfo) == 88);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7755 memcpy(v41, Src, sizeof(MonsterInfo));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v22->word_000086_some_monster_id = v50 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 v22->uActorRadius = v27->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 v22->uActorHeight = v27->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 v22->uMovementSpeed = v27->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 v30 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 v22->vInitialPosition.x = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 v22->vPosition.x = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 v31 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 v22->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 v22->vInitialPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 v22->vPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 v22->vInitialPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 v22->vPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 v22->uSectorID = v54;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7771 v22->uGroup = spawn->uGroup;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 v22->PrepareSprites((char)v45);
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
7773 v22->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 v32 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 v33 = v32 % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 v34 = stru_5C6E00->SinCos(v32 % 2048);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 a4 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 a3 = (unsigned __int64)(v34 * (signed __int64)v52) >> 16;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7779 v55 = a3 + spawn->vPosition.x;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v35 = stru_5C6E00->SinCos(v33 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 a4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 a3 = (unsigned __int64)(v35 * (signed __int64)v52) >> 16;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7783 a4 = a3 + spawn->vPosition.y;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7784 v36 = spawn->vPosition.z;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7785 a3 = spawn->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 v37 = pIndoor->GetSector(v55, a4, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 if ( v37 == v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7791 v38 = _46CEC3_get_floor_level(v55, a4, a3, v37, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 if ( v38 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 if ( abs(v38 - a3) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 a3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v22->uAttributes |= 0x080000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 LABEL_58:
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7807 ;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7808 //v53 = (char *)v53 + 1;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7809 //result = v53;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7810 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7811 //while ( (signed int)v53 < v56 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 //----- (0044FA4C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 signed int v3; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 char *v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 signed int result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 Actor *v6; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 char *v7; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 MonsterDesc *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 unsigned __int16 v9; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 int v10; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 int v11; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 int v12; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 const char *v15; // [sp-4h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 unsigned __int16 v16; // [sp+0h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 int v17; // [sp+4h] [bp-1Ch]@1
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7835 unsigned int uFaceID; // [sp+8h] [bp-18h]@16
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 int v19; // [sp+Ch] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 size_t v20; // [sp+10h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 int v21; // [sp+14h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 int v22; // [sp+18h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 unsigned int v23; // [sp+1Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 v16 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 v17 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 if ( a2 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v15 = "Elemental Light C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 if ( a2 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 v15 = "Elemental Light B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v15 = "Elemental Light A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 v20 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 while ( *(short *)v4 != Removed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 if ( v3 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 v20 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 v21 = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7874 v22 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7876 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 v6 = &pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 v7 = (char *)&pMonsterStats->pInfos[v23 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 v6->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v8 = &pMonsterList->pMonsters[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 strcpy(v6->pActorName, *(const char **)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 v6->sCurrentHP = *((short *)v7 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 memcpy(&v6->pMonsterInfo, v7, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 v6->word_000086_some_monster_id = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 v6->uActorRadius = v8->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 v6->uActorHeight = v8->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 v9 = v8->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 v6->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 v6->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 v6->pMonsterInfo.uExp = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 v6->uMovementSpeed = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 v10 = rand() % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(v10) * (signed __int64)v19) >> 16) + pParty->vPosition.x;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7895 uFaceID = stru_5C6E00->SinCos(v10 - stru_5C6E00->uIntegerHalfPi);
8453114181af intermediate
Nomad
parents: 68
diff changeset
7896 v23 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7897 v12 = pParty->vPosition.y;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7898 v13 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 v6->vInitialPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 v14 = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 LOWORD(v12) = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 v6->vInitialPosition.z = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 v6->vPosition.z = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 LOWORD(v12) = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 v6->vPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 v6->vInitialPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 v6->vPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 v6->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 v6->uSectorID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 v6->PrepareSprites(0);
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
7911 v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 v6->uAlly = 9999;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 v6->uGroup = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 v6->uCurrentActionTime = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
7915 v6->uAIState = Summoned;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 v6->uCurrentActionLength = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 v6->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7919 || (v22 = pParty->vPosition.z,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7920 result = pIndoor->GetSector(v11, v14, pParty->vPosition.z),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 result == v21)
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7922 && (result = _46CEC3_get_floor_level(v11, v14, v22, result, &uFaceID), result != -30000)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 && (result = abs(result - v22), result <= 1024) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 if ( v20 == uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 v6->uSummonerID = 8 * v17 | 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 result = v6->pActorBuffs[2].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 pParty->uTimePlayed + (signed __int64)((double)(a3 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 //----- (0044FFD8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 MapInfo *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 SpawnPointMM7 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 signed int v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 signed __int64 v12; // qtt@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 signed int v15; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 unsigned __int16 v16; // dx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 char *v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 unsigned __int16 v18; // ax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 int v19; // ST0C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 int v20; // ST08_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 int v21; // ST04_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 int v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 signed int v23; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 unsigned __int16 v24; // dx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 char *v25; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 unsigned __int16 v26; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 int v27; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 int v28; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 int v29; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 __int16 v30; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 int v32; // [sp+7Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 int v33; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 int v34; // [sp+84h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7977 __debugbreak();
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
7978
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 v4 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 v5 = v4 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 v6 = 2 * (v2->field_2F + 7 * v3->uIndex) - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 v7 = (unsigned __int8)byte_4E8168[v6 + 16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 v8 = (unsigned __int8)byte_4E8168[v6 + 17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v32 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 v9 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 v10 = v8 - v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 v12 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 result = v9 / v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 v13 = v33 + (unsigned __int64)(v12 % v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 if ( v13 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 if ( v32 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 if ( v32 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 v19 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 v20 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 v21 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 v22 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 if ( v3->uIndex == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 v14 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 if ( v3->uIndex != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 if ( v3->uIndex == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v14 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 if ( v3->uIndex != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 if ( v3->uIndex == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 v14 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 if ( v3->uIndex != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 v16 = 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_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 v18 = 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 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 while ( v16 != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 if ( v15 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 v18 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
8053 a1a.stru_24.uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 a1a.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 a1a.stru_24.uAdditionalValue = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 v14 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 a1a.stru_24.uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 v14 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 a1a.stru_24.uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 v14 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 a1a.stru_24.uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 result = a1a.stru_24.GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 while ( v24 != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 if ( v23 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 v26 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 a1a.uObjectDescID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 a1a.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 v27 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 v28 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 v29 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 a1a.vPosition.y = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 a1a.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 a1a.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 a1a.uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 a1a.vPosition.z = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 a1a.vPosition.x = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 a1a.field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 a1a.field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 a1a.field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 v30 = pIndoor->GetSector(v28, v27, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 a1a.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 a1a.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 a1a.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 a1a.uSectorID = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 return a1a.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 //----- (00450218) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 void __cdecl sub_450218_prolly_generate_chests_loot()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 Chest *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 MapInfo *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 ItemGen *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 signed int v8; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 int v10; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 int v11; // ebp@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 signed int v13; // ebp@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 ItemGen *v14; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 signed int v15; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 signed __int64 v16; // qtt@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 int v17; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 signed int v18; // [sp+10h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 int v19; // [sp+14h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 MapInfo *v20; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 Chest *v21; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 int v22; // [sp+20h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 signed int v23; // [sp+24h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 v18 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 v0 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 v1 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 v2 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 v21 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 v20 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 v3 = v1->mm7__vector_pItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 v23 = 140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 if ( (v3->uItemID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 v4 = rand() % 5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 v5 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 v6 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 v7 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 v8 = v6 - v5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 v9 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 v19 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 if ( v9 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 if ( v18 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 if ( v18 < 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v10 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 if ( v19 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 v10 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 if ( v19 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 v10 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 v3->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 v10 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 LABEL_23:
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
8212 v3->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v3->uAdditionalValue = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v11 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 if ( v11 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 v22 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 if ( v12 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 v14 = &v21->mm7__vector_pItems[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 while ( v14->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 if ( v13 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v15 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v18 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 if ( v15 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 if ( v15 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 pItemsTable->GenerateItem(v19, 0, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 v14->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 v17 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 if ( v19 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 v17 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 v14->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 v17 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 if ( v19 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 v17 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v14->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 v17 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 v14->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 v14->uAdditionalValue = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 v12 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 --v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 v17 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 v10 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 v3->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 v10 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 v3->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 pItemsTable->GenerateItem(v9, 0, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v3->GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 v2 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 --v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 while ( v23 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 v1 = v21 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 while ( (signed int)v21 < (signed int)&uNumChests );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 //----- (00450521) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 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
8320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 signed int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 unsigned __int16 v9; // cx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 char *v10; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 unsigned __int16 v11; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 LayingItem a1; // [sp+8h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 v6 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 v10 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 while ( v9 != *(short *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 v10 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 if ( v8 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 a1.uObjectDescID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 a1.vPosition.y = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 a1.vPosition.x = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 a1.vPosition.z = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 a1.uFacing = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 a1.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 a1.uSectorID = pIndoor->GetSector(a3, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 return a1.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 //----- (0045063B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 int __fastcall sub_45063B(MapInfo *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 Actor *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 signed __int64 v4; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 int v6; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 int v9; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 int v12; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 int v14; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 int v16; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 int v17; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 int v20; // [sp+24h] [bp-20h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 MapInfo *v21; // [sp+28h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 int v22; // [sp+2Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 int v23; // [sp+30h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 int v24; // [sp+34h] [bp-10h]@1
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8392 unsigned int uFaceID; // [sp+38h] [bp-Ch]@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 int v26; // [sp+3Ch] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 int v27; // [sp+40h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v24 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 v3 = pActors;
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 v22 = v3->pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v4 = (signed __int64)((double)v22 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 if ( (int)v4 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 if ( v2 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 v22 = 0;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8419 uFaceID = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8422 ++uFaceID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 v6 = rand() % 1024 + 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 v20 = stru_5C6E00->SinCos(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 v20 = stru_5C6E00->SinCos(v7 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 v19.uIndex = v24;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8432 v19.vPosition.y = v23 + pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8433 v19.vPosition.z = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 v19.vPosition.z = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 v19.vPosition.x,
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8438 v23 + pParty->vPosition.y,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8439 pParty->vPosition.z,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 &v26,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 &v27,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 v9 = abs(v19.vPosition.y - pOutdoor->pBModels[v8].vBoundingCenter.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 v10 = abs(v19.vPosition.x - pOutdoor->pBModels[v8].vBoundingCenter.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 if ( sub_4621DA(v10, v9, 0) < pOutdoor->pBModels[v8].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 if ( v23 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 LABEL_16:
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8461 v11 = uFaceID == 100;
8453114181af intermediate
Nomad
parents: 68
diff changeset
8462 if ( uFaceID >= 100 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8466 v11 = uFaceID == 100;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 v26 = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8474 v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 v12 = rand() % 512 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 v13 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 v15 = stru_5C6E00->SinCos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 v20 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 v23 = (unsigned __int64)(v15 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 v16 = stru_5C6E00->SinCos(v14 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 v20 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 v23 = (unsigned __int64)(v16 * (signed __int64)v12) >> 16;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8488 v19.vPosition.y = v23 + pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8489 v19.vPosition.z = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 v19.uIndex = v24;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8491 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 if ( v17 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8494 v18 = _46CEC3_get_floor_level(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 v19.vPosition.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 if ( v18 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8498 if ( abs(v18 - pParty->vPosition.z) <= 1024 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 while ( v26 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 v11 = v26 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 SpawnEncounter(v21, &v19, 0, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 result = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 //----- (00450929) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 int LevelDecoration::GetGlobalEvent()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 LevelDecoration *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 signed int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 int v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 int v9; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 int v12; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 int v13; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 v2 = v1->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 if ( v2 > 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 switch ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 case 209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 result = rand() % 7 + 183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 case 210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 result = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 case 211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 result = 151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 case 212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 result = 152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 case 213:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 result = 153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 case 214:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 result = 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 case 215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 result = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 case 216:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 result = 156;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 case 217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 result = 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 case 218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 result = 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 case 219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 result = 159;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 result = 160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 case 221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 result = 161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 if ( v2 == 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 result = rand() % 7 + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 if ( v2 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 v9 = v2 - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 return rand() % 6 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 v10 = v9 - 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 return 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 v11 = v10 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 if ( !v11 || (v12 = v11 - 3) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 return 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 v13 = v12 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 return rand() % 7 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 if ( v13 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 return rand() % 7 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 if ( v2 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 return 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 v3 = v2 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 return 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 v4 = v3 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 return 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 return rand() % 4 + 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 v6 = v5 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 return 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 v7 = v6 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 return 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 if ( v7 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 return 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 //----- (00450AAA) --------------------------------------------------------
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8643 void RespawnGlobalDecorations()
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8644 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8645 memset(stru_5E4C90._decor_events, 0, 125);
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8646
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8647 uint decorEventIdx = 0;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8648 for (uint i = 0; i < uNumLevelDecorations; ++i)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8649 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8650 auto decor = pLevelDecorations + i;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8651
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8652 if (!decor->field_16_event_id)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8653 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8654 if (decor->IsInteractive())
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8655 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8656 if (decorEventIdx < 124)
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8657 {
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8658 decor->_idx_in_stru123 = decorEventIdx + 75;
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8659 stru_5E4C90._decor_events[decorEventIdx++] = decor->GetGlobalEvent();
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8660 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8661 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8662 }
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
8663 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 //----- (00450B0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 bool __fastcall SpawnActor(unsigned int uMonsterID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 MonsterDesc *v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 MonsterInfo *v4; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 Vec3_int_ v5; // ST08_12@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 unsigned int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 Actor *v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 Actor actor; // [sp+4h] [bp-350h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 v1 = uMonsterID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 if ( uNumActors == 499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 v3 = &pMonsterList->pMonsters[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 v4 = &pMonsterStats->pInfos[v1 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 memset(&actor, 0, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 strcpy(actor.pActorName, v4->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 actor.sCurrentHP = LOWORD(v4->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 actor.word_000086_some_monster_id = v1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 actor.uActorRadius = v3->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 actor.uActorHeight = v3->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 actor.uMovementSpeed = v3->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 v5 = pParty->vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 actor.vInitialPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 actor.vPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 actor.uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 actor.vInitialPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 actor.vPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 actor.vInitialPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 actor.vPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 pSprites_LOD->DeleteSomeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 pPaletteManager->ResetNonTestLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 v6 = uNumActors - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 if ( dword_5C6DF8 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 dword_5C6DF8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 v6 = uNumActors++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 v7 = &pActors[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 memcpy(v7, &actor, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 v7->PrepareSprites(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 //----- (00450DA3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 int __cdecl GetAlertStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 result = pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 //----- (00450DDE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 stru350 *stru350::_450DDE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8742 _450DF1(&stru_4E82A4, &stru_4E82A4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 return this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8746
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 //----- (00450DF1) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8748 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8749 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8750 //stru350 *v3; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8751 //void *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 unsigned int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 int v6; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 unsigned int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 int v9; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 int v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 int v11; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 int v12; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 unsigned int v13; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 int v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 unsigned int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 int v18; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 char v19; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 unsigned int v20; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 int v21; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 unsigned int v23; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 int v24; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 int v26; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 int v27; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 unsigned int v28; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 int v29; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 int v30; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 int v31; // ecx@35
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8779 int v32; // edi@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 int v33; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 unsigned int i; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 int v35; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 unsigned int v36; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 int v37; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 int v38; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8787 //v3 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8788 memcpy(&field_0, p1, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8789 memcpy(&field_20, p2, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8790 //result = memcpy(&v3->field_20, p2, 0x20u);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8791 //LOBYTE(result) = 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8792 if (field_0.field_4 & 1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8793 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8794 v5 = field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 while ( !(v5 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 while ( v5 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8808 field_40 = 32 - v7 - v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8809 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8810 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8811 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8812 field_40 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8813 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8814 v8 = field_0.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 while ( !(v8 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 while ( v8 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 v11 = 24 - v10 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8830 field_48 = v11;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8831 v13 = field_0.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 while ( !(v13 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 while ( v13 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 v15 = 16 - v14;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8845 v16 = field_0.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8846 field_50 = v15 - v12;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 while ( !(v16 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 while ( v16 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8860 v19 = (field_20.field_4 & 1) == 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8861 field_58 = v17 - v18 + 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8864 field_44 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8865 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8866 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8867 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8868 v20 = field_20.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 while ( !(v20 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 while ( v20 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8882 field_44 = 32 - v22 - v21;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8883 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8884 v23 = field_20.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 while ( !(v23 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 while ( v23 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 v26 = 24 - v25 - v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8900 field_4C = v26;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8901 v28 = field_20.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 while ( !(v28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 while ( v28 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 v31 = 16 - v29 - v27;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8916 v32 = field_20.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8917 field_54 = v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 for ( i = v32; !(i & 1); i >>= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 i >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 while ( i & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 v35 = 32 - v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 v36 = v32;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8929 field_5C = v35 - v30;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 while ( !(v36 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 while ( v36 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8943 field_5C = v37 - v38 + 8;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8944 return true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8945 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8946
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 //----- (00450F55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 unsigned int stru350::_450F55(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8953 int v2 = a2 & stru_4E82A4.field_1C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8954 if (field_20.field_4 & 1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 v2 = (unsigned int)v2 >> this->field_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8956 return v2 & field_20.field_1C |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8957 field_20.field_10 & ((a2 & (unsigned int)stru_4E82A4.field_10) >> field_4C) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8958 field_20.field_14 & ((a2 & (unsigned int)stru_4E82A4.field_14) >> field_54) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8959 field_20.field_18 & ((a2 & (unsigned int)stru_4E82A4.field_18) >> field_5C);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8960 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 //----- (00450FB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 int stru350::_450FB1(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8965 int v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8966 int v4 = field_0.field_4 & 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8968 v2 = a2 & field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8970 v2 <<= field_40;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8971 return v2 | ((a2 & field_0.field_10) << field_48) | ((a2 & field_0.field_14) << field_50) | ((a2 & field_0.field_18) << field_58);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 //----- (00452442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 int v4; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 __int16 v5; // ST14_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 __int16 v6; // dx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 __int16 v8; // ST10_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 unsigned __int16 v10; // dh@1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 int v12; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 __int16 a3a; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 v5 = a2 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 v6 = (unsigned __int16)a4 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 v8 = a1 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 a3a = (unsigned __int16)a3 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 LOWORD(v7) = a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 LOWORD(v7) = a3a & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 LOWORD(v9) = v9 & 0x1C00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 v11 = v7 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 LOWORD(v7) = v5 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 v12 = v7 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 LOWORD(v7) = v8 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 return ((v8 & 7) + (v5 & 7) + (a3a & 7) + (v6 & 7)) | (v7 + v12) | ((v8 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 + (v5 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 + v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 //----- (0045281E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 // Calculates atan2(y/x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 // return value: angle in integer format (multiplier of Pi/1024)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 unsigned int stru193_math::Atan2(int x, int y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9015 signed int quadrant;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9016 __int64 dividend;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9017 int quotient;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9018 int lowIdx;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9019 int highIdx;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9020 int angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9021
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9022 auto X = x;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9023 auto Y = y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9024
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9025 if ( abs(X) < 65536 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9026 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9027 if ( (abs(Y) >> 15) >= abs(X) )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9028 X = 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9029 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9030
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9031 if ( !X )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9032 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9033 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9034 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9035 return uIntegerHalfPi; //Pi/2
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9036 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9037 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9038 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9039 return uIntegerHalfPi + uIntegerPi; //3*(Pi/2)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9040 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9041 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9042
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9043 if ( Y )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9044 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9045 if ( X < 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9046 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9047 X = -X;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9048 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9049 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9050 quadrant = 4;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9051 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9052 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9053 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9054 quadrant = 3;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9055 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9059 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9060 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9061 quadrant = 1;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9062 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9063 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9064 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9065 quadrant = 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9066 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9067 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9068
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9069 if ( Y < 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9070 Y = -Y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9071
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9072 LODWORD(dividend) = Y << 16;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9073 HIDWORD(dividend) = Y >> 16;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9074 quotient = dividend / X;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9075
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9076 //looks like binary search
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9077 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9078 int i;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9079 highIdx = uIntegerHalfPi;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9080 lowIdx = 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9081
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9082 for (i = 0; i < 6; ++i)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9083 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9084 if (quotient <= pTanTable[(lowIdx + highIdx) / 2])
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9085 highIdx = (lowIdx + highIdx) / 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9086 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9087 lowIdx = (lowIdx + highIdx) / 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9088 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9089 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9090
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9091 angle = lowIdx + 1;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9092 while ( angle < (highIdx - 1) && quotient >= pTanTable[angle] )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9093 ++angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9094
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9095 switch (quadrant)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9096 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9097 case 1: //X > 0, Y > 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9098 return angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9099
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9100 case 2: //X > 0, Y < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9101 return uIntegerDoublePi - angle; //2*Pi - angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9102
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9103 case 3: //X > 0, Y < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9104 return uIntegerPi + angle; //Pi + angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9105
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9106 case 4: //X < 0, Y > 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9107 return uIntegerPi - angle; //Pi - angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9108 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9109
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9110 //should newer get here
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9111 return 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9112 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9113
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9114 if ( X < 0 ) //Y == 0, X < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9115 return uIntegerPi;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9116
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9117 return 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 //----- (00452969) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 stru193_math::stru193_math()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 stru193_math *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 double v3; // ST18_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 signed int v7; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 this->uIntegerDoublePi = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 this->uIntegerPi = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 this->uIntegerHalfPi = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 this->uDoublePiMask = 2047;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 this->uPiMask = 1023;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 this->uHalfPiMask = 511;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 this->pTanTable[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 this->pCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 this->pInvCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 v2 = (char *)&this->pInvCosTable[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 v3 = (double)v7 * 3.141592653589793 * 0.0009765625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 *((int *)v2 - 1040) = (signed __int64)(tan(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 *((int *)v2 - 520) = (signed __int64)(cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 *(int *)v2 = (signed __int64)(1.0 / cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 while ( v7 < (signed int)v1->uIntegerHalfPi );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 v4 = v1->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 if ( v4 < 520 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 v5 = (int)&v1->pCosTable[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 v6 = 520 - v4;
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 *(int *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 *(int *)(v5 + 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 *(int *)(v5 - 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 v5 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 //----- (00452A9E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 signed int __fastcall sub_452A9E(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 int v2; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 if ( a1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 v4 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 result *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 v2 = ((unsigned int)v3 >> 30) | 4 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 v5 = 2 * result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 v3 *= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 if ( v2 >= (unsigned int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 v2 -= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 if ( a1 - result * result >= (unsigned int)(result - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 //----- (00452AE2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 int __fastcall MakeColorMaskFromBitDepth(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 signed __int64 v1; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 v1 = 4294967296i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 if ( a1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 LODWORD(v1) = HIDWORD(v1) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 HIDWORD(v1) *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 --a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 while ( a1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 //----- (00452AF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 void *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 unsigned __int16 *v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 unsigned int i; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 v4 = a1 | (a1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 *pPixels = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 v3 = pPixels + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 --uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 for ( i = uNumPixels & 1; i; --i ) // leftover pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 *v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 //----- (00452B2E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 unsigned int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 v2 = uDiceSides;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 if ( uDiceSides )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 if ( (signed int)uNumDice > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 v5 = uNumDice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 v3 += rand() % v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 //----- (00452B95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 void __cdecl SetSomeItemsNames()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 memset(&stru_5E4C50, 0, sizeof(stru_5E4C50));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 //----- (00452C30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 char *RemoveQuotes(char *Str)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 if ( *Str == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 Str[strlen(Str) - 1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 v1 = Str + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 //----- (00452C49) --------------------------------------------------------
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
9323 void InitializeGameText()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 //char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 char *v1; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 int v2; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 //char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 //v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 if (pGlobalTXT_Raw)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 pAllocator->FreeChunk(pGlobalTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 pGlobalTXT_Raw = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 pGlobalTXT_Raw = (char *)pEvents_LOD->LoadRaw("global.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 strtok(pGlobalTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 strtok(nullptr, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 for (uint i = 0; i < 677; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 char *p = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 while (*++p != '\t' && *p);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 pGlobalTXT_LocalizationStrings[i] = RemoveQuotes(p + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 aMonthNames[2] = pGlobalTXT_LocalizationStrings[417];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 aMonthNames[3] = pGlobalTXT_LocalizationStrings[418];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 aMonthNames[4] = pGlobalTXT_LocalizationStrings[419];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 aMonthNames[5] = pGlobalTXT_LocalizationStrings[420];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 aMonthNames[6] = pGlobalTXT_LocalizationStrings[421];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 aCharacterConditionNames[0] = pGlobalTXT_LocalizationStrings[52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 aMonthNames[7] = pGlobalTXT_LocalizationStrings[422];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 aCharacterConditionNames[1] = pGlobalTXT_LocalizationStrings[241];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 aMonthNames[8] = pGlobalTXT_LocalizationStrings[423];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 aCharacterConditionNames[2] = pGlobalTXT_LocalizationStrings[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 aMonthNames[9] = pGlobalTXT_LocalizationStrings[424];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 aCharacterConditionNames[3] = pGlobalTXT_LocalizationStrings[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 aMonthNames[10] = pGlobalTXT_LocalizationStrings[425];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 aCharacterConditionNames[4] = pGlobalTXT_LocalizationStrings[69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 aMonthNames[11] = pGlobalTXT_LocalizationStrings[426];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 aCharacterConditionNames[5] = pGlobalTXT_LocalizationStrings[117];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 aCharacterConditionNames[6] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 aCharacterConditionNames[8] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 aCharacterConditionNames[10] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 aCharacterConditionNames[12] = pGlobalTXT_LocalizationStrings[162];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 aCharacterConditionNames[13] = pGlobalTXT_LocalizationStrings[231];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 aCharacterConditionNames[14] = pGlobalTXT_LocalizationStrings[58];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 aCharacterConditionNames[15] = pGlobalTXT_LocalizationStrings[220];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 aCharacterConditionNames[7] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 aCharacterConditionNames[9] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 aCharacterConditionNames[11] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 aCharacterConditionNames[16] = pGlobalTXT_LocalizationStrings[76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 pClassNames[9] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 pClassNames[10] = pGlobalTXT_LocalizationStrings[432];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 pClassNames[11] = pGlobalTXT_LocalizationStrings[27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 pClassNames[12] = pGlobalTXT_LocalizationStrings[262];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 pClassNames[13] = pGlobalTXT_LocalizationStrings[263];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 pClassNames[14] = pGlobalTXT_LocalizationStrings[264];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 pClassNames[15] = pGlobalTXT_LocalizationStrings[28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 pClassNames[16] = pGlobalTXT_LocalizationStrings[265];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 pClassNames[17] = pGlobalTXT_LocalizationStrings[267];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 pClassNames[18] = pGlobalTXT_LocalizationStrings[119];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 pClassNames[19] = pGlobalTXT_LocalizationStrings[124];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 pClassNames[20] = pGlobalTXT_LocalizationStrings[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 pClassNames[21] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 pClassNames[22] = pGlobalTXT_LocalizationStrings[33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 aCharacterConditionNames[17] = pGlobalTXT_LocalizationStrings[601];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 pClassNames[23] = pGlobalTXT_LocalizationStrings[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 aCharacterConditionNames[18] = pGlobalTXT_LocalizationStrings[98];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 pClassNames[24] = pGlobalTXT_LocalizationStrings[256];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 pClassNames[0] = pGlobalTXT_LocalizationStrings[253];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 pClassNames[25] = pGlobalTXT_LocalizationStrings[257];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 pClassNames[1] = pGlobalTXT_LocalizationStrings[254];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 pClassNames[26] = pGlobalTXT_LocalizationStrings[44];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 pClassNames[2] = pGlobalTXT_LocalizationStrings[255];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 pClassNames[27] = pGlobalTXT_LocalizationStrings[46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 pClassNames[3] = pGlobalTXT_LocalizationStrings[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 pClassNames[28] = pGlobalTXT_LocalizationStrings[268];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 pClassNames[4] = pGlobalTXT_LocalizationStrings[307];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 pClassNames[29] = pGlobalTXT_LocalizationStrings[269];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 pClassNames[5] = pGlobalTXT_LocalizationStrings[114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 pClassNames[30] = pGlobalTXT_LocalizationStrings[270];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 pClassNames[6] = pGlobalTXT_LocalizationStrings[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 pClassNames[31] = pGlobalTXT_LocalizationStrings[48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 pClassNames[7] = pGlobalTXT_LocalizationStrings[13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 pClassNames[32] = pGlobalTXT_LocalizationStrings[259];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 pClassNames[8] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 pClassNames[33] = pGlobalTXT_LocalizationStrings[260];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 pClassNames[34] = pGlobalTXT_LocalizationStrings[261];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 pClassNames[35] = pGlobalTXT_LocalizationStrings[49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 pSkillNames[0] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 pSkillNames[1] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 pSkillNames[2] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 pSkillNames[3] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 pSkillNames[4] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 pSkillNames[5] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 pSkillNames[6] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 pSkillNames[7] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 pSkillNames[23] = pGlobalTXT_LocalizationStrings[294];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 pSkillNames[9] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 pSkillNames[24] = pGlobalTXT_LocalizationStrings[295];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 pSkillNames[10] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 pSkillNames[25] = pGlobalTXT_LocalizationStrings[296];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 pSkillNames[11] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 pSkillNames[26] = pGlobalTXT_LocalizationStrings[297];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 pSkillNames[12] = pGlobalTXT_LocalizationStrings[283];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 pSkillNames[27] = pGlobalTXT_LocalizationStrings[298];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 pSkillNames[13] = pGlobalTXT_LocalizationStrings[284];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 pSkillNames[28] = pGlobalTXT_LocalizationStrings[299];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 pSkillNames[14] = pGlobalTXT_LocalizationStrings[285];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 pSkillNames[29] = pGlobalTXT_LocalizationStrings[300];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 pSkillNames[15] = pGlobalTXT_LocalizationStrings[286];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 pSkillNames[30] = pGlobalTXT_LocalizationStrings[50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 pSkillNames[16] = pGlobalTXT_LocalizationStrings[289];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 pSkillNames[31] = pGlobalTXT_LocalizationStrings[77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 aDayNames[0] = pGlobalTXT_LocalizationStrings[145];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 pSkillNames[17] = pGlobalTXT_LocalizationStrings[290];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 pSkillNames[32] = pGlobalTXT_LocalizationStrings[88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 aDayNames[1] = pGlobalTXT_LocalizationStrings[230];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 pSkillNames[18] = pGlobalTXT_LocalizationStrings[291];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 pSkillNames[33] = pGlobalTXT_LocalizationStrings[89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 aDayNames[2] = pGlobalTXT_LocalizationStrings[243];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 pSkillNames[19] = pGlobalTXT_LocalizationStrings[287];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 pSkillNames[34] = pGlobalTXT_LocalizationStrings[90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 aDayNames[3] = pGlobalTXT_LocalizationStrings[227];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 pSkillNames[20] = pGlobalTXT_LocalizationStrings[288];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 pSkillNames[35] = pGlobalTXT_LocalizationStrings[95];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 aDayNames[4] = pGlobalTXT_LocalizationStrings[91];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 pSkillNames[21] = pGlobalTXT_LocalizationStrings[292];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 pSkillNames[36] = pGlobalTXT_LocalizationStrings[301];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 aDayNames[5] = pGlobalTXT_LocalizationStrings[188];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 pSkillNames[8] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 pSkillNames[22] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 pSkillNames[37] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 aDayNames[6] = pGlobalTXT_LocalizationStrings[222];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 aNPCProfessionNames[0] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 aNPCProfessionNames[1] = pGlobalTXT_LocalizationStrings[308];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 aNPCProfessionNames[2] = pGlobalTXT_LocalizationStrings[309];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 aNPCProfessionNames[3] = pGlobalTXT_LocalizationStrings[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 aNPCProfessionNames[4] = pGlobalTXT_LocalizationStrings[306];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 aNPCProfessionNames[5] = pGlobalTXT_LocalizationStrings[310];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 aNPCProfessionNames[6] = pGlobalTXT_LocalizationStrings[311];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 aNPCProfessionNames[7] = pGlobalTXT_LocalizationStrings[312];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 aSpellSchoolNames[0] = pGlobalTXT_LocalizationStrings[87];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 aNPCProfessionNames[8] = pGlobalTXT_LocalizationStrings[313];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 aSpellSchoolNames[1] = pGlobalTXT_LocalizationStrings[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 aNPCProfessionNames[9] = pGlobalTXT_LocalizationStrings[314];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 aNPCProfessionNames[21] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 aNPCProfessionNames[10] = pGlobalTXT_LocalizationStrings[105];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 aSpellSchoolNames[2] = pGlobalTXT_LocalizationStrings[240];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 aNPCProfessionNames[11] = pGlobalTXT_LocalizationStrings[315];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 aNPCProfessionNames[22] = pGlobalTXT_LocalizationStrings[324];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 aNPCProfessionNames[12] = pGlobalTXT_LocalizationStrings[316];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 aSpellSchoolNames[3] = pGlobalTXT_LocalizationStrings[70];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 aNPCProfessionNames[13] = pGlobalTXT_LocalizationStrings[317];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 aNPCProfessionNames[23] = pGlobalTXT_LocalizationStrings[498];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 aSpellSchoolNames[4] = pGlobalTXT_LocalizationStrings[214];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 aNPCProfessionNames[14] = pGlobalTXT_LocalizationStrings[115];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 aNPCProfessionNames[24] = pGlobalTXT_LocalizationStrings[525];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 aSpellSchoolNames[5] = pGlobalTXT_LocalizationStrings[142];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 aNPCProfessionNames[15] = pGlobalTXT_LocalizationStrings[318];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 aNPCProfessionNames[25] = pGlobalTXT_LocalizationStrings[327];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 aSpellSchoolNames[6] = pGlobalTXT_LocalizationStrings[29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 aNPCProfessionNames[16] = pGlobalTXT_LocalizationStrings[319];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 aNPCProfessionNames[26] = pGlobalTXT_LocalizationStrings[328];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 aSpellSchoolNames[7] = pGlobalTXT_LocalizationStrings[133];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 aNPCProfessionNames[17] = pGlobalTXT_LocalizationStrings[320];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 aNPCProfessionNames[27] = pGlobalTXT_LocalizationStrings[329];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 aSpellSchoolNames[8] = pGlobalTXT_LocalizationStrings[54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 aNPCProfessionNames[18] = pGlobalTXT_LocalizationStrings[321];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 aNPCProfessionNames[28] = pGlobalTXT_LocalizationStrings[330];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 aAMPMNames[0] = pGlobalTXT_LocalizationStrings[472];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 aNPCProfessionNames[19] = pGlobalTXT_LocalizationStrings[322];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 aNPCProfessionNames[29] = pGlobalTXT_LocalizationStrings[331];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 aAMPMNames[1] = pGlobalTXT_LocalizationStrings[473];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 aNPCProfessionNames[20] = pGlobalTXT_LocalizationStrings[323];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 aNPCProfessionNames[30] = pGlobalTXT_LocalizationStrings[332];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 aNPCProfessionNames[31] = pGlobalTXT_LocalizationStrings[333];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 aNPCProfessionNames[32] = pGlobalTXT_LocalizationStrings[334];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 aNPCProfessionNames[33] = pGlobalTXT_LocalizationStrings[335];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 aNPCProfessionNames[34] = pGlobalTXT_LocalizationStrings[336];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 aNPCProfessionNames[35] = pGlobalTXT_LocalizationStrings[337];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 aNPCProfessionNames[36] = pGlobalTXT_LocalizationStrings[338];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 aNPCProfessionNames[37] = pGlobalTXT_LocalizationStrings[339];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 aNPCProfessionNames[38] = pGlobalTXT_LocalizationStrings[340];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 aNPCProfessionNames[39] = pGlobalTXT_LocalizationStrings[341];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 aNPCProfessionNames[40] = pGlobalTXT_LocalizationStrings[342];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 aNPCProfessionNames[56] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 aNPCProfessionNames[41] = pGlobalTXT_LocalizationStrings[343];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 aNPCProfessionNames[57] = pGlobalTXT_LocalizationStrings[600];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 aNPCProfessionNames[42] = pGlobalTXT_LocalizationStrings[596];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 aNPCProfessionNames[58] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 aNPCProfessionNames[43] = pGlobalTXT_LocalizationStrings[345];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 aMoonPhaseNames[0] = pGlobalTXT_LocalizationStrings[150];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 aNPCProfessionNames[44] = pGlobalTXT_LocalizationStrings[346];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 aMoonPhaseNames[1] = pGlobalTXT_LocalizationStrings[171];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 aNPCProfessionNames[45] = pGlobalTXT_LocalizationStrings[347];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 aNPCProfessionNames[46] = pGlobalTXT_LocalizationStrings[348];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 aNPCProfessionNames[47] = pGlobalTXT_LocalizationStrings[349];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 aNPCProfessionNames[48] = pGlobalTXT_LocalizationStrings[350];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 aAttributeNames[0] = pGlobalTXT_LocalizationStrings[144];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 aNPCProfessionNames[49] = pGlobalTXT_LocalizationStrings[597];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 aAttributeNames[1] = pGlobalTXT_LocalizationStrings[116];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 aNPCProfessionNames[50] = pGlobalTXT_LocalizationStrings[352];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 aAttributeNames[2] = pGlobalTXT_LocalizationStrings[163];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 aNPCProfessionNames[51] = pGlobalTXT_LocalizationStrings[353];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 aAttributeNames[3] = pGlobalTXT_LocalizationStrings[75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 aNPCProfessionNames[52] = pGlobalTXT_LocalizationStrings[598];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 aAttributeNames[4] = pGlobalTXT_LocalizationStrings[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 aNPCProfessionNames[53] = pGlobalTXT_LocalizationStrings[344];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 aAttributeNames[5] = pGlobalTXT_LocalizationStrings[211];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 aNPCProfessionNames[54] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 aAttributeNames[6] = pGlobalTXT_LocalizationStrings[136];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 aNPCProfessionNames[55] = pGlobalTXT_LocalizationStrings[599];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 aSpellNames[14] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 aSpellNames[33] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 aSpellNames[9] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 aSpellNames[34] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 aSpellNames[0] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 aSpellNames[10] = pGlobalTXT_LocalizationStrings[218];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 aSpellNames[20] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 aSpellNames[35] = pGlobalTXT_LocalizationStrings[235];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 aSpellNames[11] = pGlobalTXT_LocalizationStrings[217];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 aSpellNames[21] = pGlobalTXT_LocalizationStrings[443];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 aSpellNames[36] = pGlobalTXT_LocalizationStrings[246];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 aSpellNames[12] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 aSpellNames[24] = pGlobalTXT_LocalizationStrings[221];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 aSpellNames[37] = pGlobalTXT_LocalizationStrings[247];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 aSpellNames[13] = pGlobalTXT_LocalizationStrings[462];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 aSpellNames[26] = pGlobalTXT_LocalizationStrings[228];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 aSpellNames[38] = pGlobalTXT_LocalizationStrings[248];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 aSpellNames[15] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 aSpellNames[28] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 aSpellNames[39] = pGlobalTXT_LocalizationStrings[674];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 aSpellNames[16] = pGlobalTXT_LocalizationStrings[452];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 aSpellNames[29] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 aSpellNames[40] = pGlobalTXT_LocalizationStrings[249];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 aSpellNames[2] = pGlobalTXT_LocalizationStrings[219];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 aSpellNames[17] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 aSpellNames[30] = pGlobalTXT_LocalizationStrings[229];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 aSpellNames[41] = pGlobalTXT_LocalizationStrings[258];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 aSpellNames[5] = pGlobalTXT_LocalizationStrings[454];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 aSpellNames[3] = pGlobalTXT_LocalizationStrings[215];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 aSpellNames[7] = pGlobalTXT_LocalizationStrings[455];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 aSpellNames[18] = pGlobalTXT_LocalizationStrings[456];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 aSpellNames[31] = pGlobalTXT_LocalizationStrings[233];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 aSpellNames[42] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 aSpellNames[6] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 aSpellNames[25] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 aSpellNames[1] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 aSpellNames[4] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 aSpellNames[8] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 aSpellNames[19] = pGlobalTXT_LocalizationStrings[453];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 aSpellNames[22] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 aSpellNames[23] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 aSpellNames[27] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 aSpellNames[32] = pGlobalTXT_LocalizationStrings[234];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 aSpellNames[43] = pGlobalTXT_LocalizationStrings[657];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 //----- (00453E6D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 void StorylineText::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 StorylineText *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 char *v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 char v4; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 char *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 int v6; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 int v7; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 int v8; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 char *v9; // [sp+14h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 int Str; // [sp+18h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 if ( pHistoryTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 pAllocator->FreeChunk(pHistoryTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 pHistoryTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 strtok(pHistoryTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 Str = (int)&v2->field_4[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 v9 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 v8 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 v3 = strtok(v1, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 if ( *v3 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 v4 = v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 while ( v4 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 v6 = (int)&v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 if ( v3[(int)v5] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 *(char *)v6 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 if ( v5 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 if ( v9 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 *(char **)(Str - 8) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 if ( v9 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 *(char *)Str = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 if ( v9 - 2 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 *(char * *)(Str - 4) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 v3 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 while ( (signed int)(v9 - 1) <= 3 && (char *)v8 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 Str += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 //----- (00453F62) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 void MapStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 MapStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 unsigned int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 char *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 char v5; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 size_t v7; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 size_t v8; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 size_t v9; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 size_t v10; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 size_t v11; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 size_t v12; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 char Str[32]; // [sp+Ch] [bp-34h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 char *v14; // [sp+2Ch] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 int v15; // [sp+30h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 int v16; // [sp+34h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 unsigned int v17; // [sp+38h] [bp-8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 MapStats *v18; // [sp+3Ch] [bp-4h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 if ( pMapStatsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 pAllocator->FreeChunk(pMapStatsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 pMapStatsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 strtok(pMapStatsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 v1->uNumMaps = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 v3 = strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v14 = &v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 switch ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v1->pInfos[v2].pName = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 v1->pInfos[v2].pFilename = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v1->pInfos[v2].uNumResets = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 v1->pInfos[v2].uFirstVisitedAt = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v1->pInfos[v2]._per = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v1->pInfos[v2].uRespawnIntervalDays = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v1->pInfos[v2]._alert_days = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v1->pInfos[v2]._steal_perm = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v1->pInfos[v2].field_2D = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v1->pInfos[v2].field_2E = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 v1->pInfos[v2].field_2F = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v1->pInfos[v2].field_30 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v1->pInfos[v2].field_31 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v1->pInfos[v2].field_32 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 v1->pInfos[v2].field_33 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v1->pInfos[v2].pEncounterMonster1Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 v1->pInfos[v2].field_34 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 v18->pInfos[0].uEncounterMonster1AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 v7 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 if ( v17 >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 v18->pInfos[0].uEncounterMonster1AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 v8 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 if ( v17 == v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 v18->pInfos[0].uEncounterMonster1AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 v18->pInfos[0].uEncounterMonster1AtMost = v18->pInfos[0].uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 v1->pInfos[v2].pEncounterMonster2Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 v1->pInfos[v2].field_37 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 v18->pInfos[0].uEncounterMonster2AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 v9 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 if ( v17 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 v18->pInfos[0].uEncounterMonster2AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 if ( v17 == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 v18->pInfos[0].uEncounterMonster2AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 v18->pInfos[0].uEncounterMonster2AtMost = v18->pInfos[0].uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v1->pInfos[v2].pEncounterMonster3Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 v1->pInfos[v2].field_3A = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 v18->pInfos[0].uEncounterMonster3AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 v11 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 if ( v17 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 v18->pInfos[0].uEncounterMonster3AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 v12 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 if ( v17 == v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 v18->pInfos[0].uEncounterMonster3AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 v18->pInfos[0].uEncounterMonster3AtMost = v18->pInfos[0].uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 v1->pInfos[v2].uRedbookTrackID = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 if ( strcmp(v4, "GENERIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 if ( strcmp(v4, "PADDEDCELL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 if ( strcmp(v4, "ROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 if ( strcmp(v4, "BATHROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 if ( strcmp(v4, "LIVINGROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 if ( strcmp(v4, "STONEROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 if ( strcmp(v4, "AUDITORIUM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 if ( strcmp(v4, "CONCERTHALL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 if ( strcmp(v4, "CAVE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 if ( strcmp(v4, "ARENA") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 if ( strcmp(v4, "HANGAR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 if ( strcmp(v4, "CARPETEDHALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 if ( strcmp(v4, "HALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 if ( strcmp(v4, "STONECORRIDOR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 if ( strcmp(v4, "ALLEY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 if ( strcmp(v4, "FOREST") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 if ( strcmp(v4, "CITY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 if ( strcmp(v4, "MOUNTAINS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 if ( strcmp(v4, "QUARRY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 if ( strcmp(v4, "PLAIN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 if ( strcmp(v4, "PARKINGLOT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 if ( strcmp(v4, "SEWERPIPE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 if ( strcmp(v4, "UNDERWATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 if ( strcmp(v4, "DRUGGED") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 if ( strcmp(v4, "DIZZY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 if ( strcmp(v4, "PSYCHOTIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 v1->pInfos[v2].uEAXEnv = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v1->pInfos[v2].uEAXEnv = 25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 v1->pInfos[v2].uEAXEnv = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 v1->pInfos[v2].uEAXEnv = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 v1->pInfos[v2].uEAXEnv = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v1->pInfos[v2].uEAXEnv = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 v1->pInfos[v2].uEAXEnv = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 v1->pInfos[v2].uEAXEnv = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 v1->pInfos[v2].uEAXEnv = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 v1->pInfos[v2].uEAXEnv = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 v1->pInfos[v2].uEAXEnv = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 v1->pInfos[v2].uEAXEnv = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 v1->pInfos[v2].uEAXEnv = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 v1->pInfos[v2].uEAXEnv = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 v1->pInfos[v2].uEAXEnv = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 v1->pInfos[v2].uEAXEnv = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 v1->pInfos[v2].uEAXEnv = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 v1->pInfos[v2].uEAXEnv = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 v1->pInfos[v2].uEAXEnv = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 v1->pInfos[v2].uEAXEnv = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 v1->pInfos[v2].uEAXEnv = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 v1->pInfos[v2].uEAXEnv = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 v1->pInfos[v2].uEAXEnv = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 v1->pInfos[v2].uEAXEnv = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 v1->pInfos[v2].uEAXEnv = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 v1->pInfos[v2].uEAXEnv = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 v1->pInfos[v2].uEAXEnv = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 v4 = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 while ( v16 - 1 <= 29 && !v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 while ( (signed int)v2 < 77 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 v1->uNumMaps = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 // 453F62: using guessed type char Str[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 //----- (004547A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 unsigned int MapStats::GetMapInfo(const char *Str2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 MapStats *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 unsigned int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 if ( (signed int)this->uNumMaps <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 v4 = (const char **)&this->pInfos[1].pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 while ( !*v4 || _strcmpi(*v4, Str2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 v4 += 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 if ( (signed int)v3 >= (signed int)v2->uNumMaps )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 //----- (004547E4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 void FactionTable::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 signed int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 int v7; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 signed int v8; // [sp+4h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 signed int v9; // [sp+8h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 FactionTable *v10; // [sp+Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v10 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 if ( pHostileTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 pHostileTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 strtok(pHostileTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 v2 = strtok(v1, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 v9 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 v4 = (int)((char *)&v10[-7] + v8 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 v5 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 v5 = v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 v7 = (int)&v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 if ( v2[(int)v6] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 *(char *)v7 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 if ( v6 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 if ( v3 >= 1 && v3 <= 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 *(char *)v4 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v4 += 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 v2 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 while ( v3 - 1 <= 90 && (char *)v9 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 while ( v8 < 89 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 if ( pHostileTXT_Raw != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 pHostileTXT_Raw = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 //----- (004548E2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 std::string v5; // [sp-18h] [bp-28h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 const char *v6; // [sp-8h] [bp-18h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 signed int v7; // [sp-4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 std::string *v8; // [sp+8h] [bp-8h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 int a3; // [sp+Fh] [bp-1h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 v2 = (int)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 result = (int)a1->pProperties[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 if ( !_strcmpi((const char *)result, "Dispel") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 v7 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 ++*(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 v7 = 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 v7 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 v7 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 v7 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 v7 = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 v7 = 95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 v7 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 v7 = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 v7 = 2;
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), "Rock") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 v7 = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 v7 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 }
102
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
10300 if ( !_strcmpi(*(const char **)(v2 + 4), "Ice") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 v7 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 v7 = 97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 v7 = 82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 v7 = 57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 v7 = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 sprintfex(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 v7 = 73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 v7 = 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 v7 = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 v7 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 v7 = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 v7 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v7 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v7 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 v7 = 81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 v7 = 93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 v7 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 v7 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 v7 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 v7 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 v7 = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 v7 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 v7 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 *(int *)v3 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 //----- (00454CB4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 int __thiscall ParseAttackType(unsigned __int8 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 unsigned __int8 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 int v3; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 int v4; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 if ( tolower(*a1) == 'f' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 if ( tolower(*v1) == 'a' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 if ( tolower(*v1) == 'w' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 if ( tolower(*v1) == 'e' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 tolower(v1[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 return 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 if ( tolower(*v1) == 's' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 return 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 if ( tolower(*v1) == 'm' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 v3 = -(tolower(v1[1]) != 'i');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 LOBYTE(v3) = v3 & 0xFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 result = v3 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 if ( tolower(*v1) == 'l' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 return 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 v4 = -(tolower(*v1) != 'd');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 LOBYTE(v4) = v4 & 0xFA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 result = v4 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 //----- (00454D7D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 signed int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 int *v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 size_t v10; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 int v11; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 signed int v12; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 v5 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 *(char *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 *(char *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 if ( (signed int)v10 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 LOBYTE(v8) = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 if ( (unsigned __int8)*v5 >= 0x30u && (unsigned __int8)v8 <= 0x39u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 *(char *)v4 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 LOBYTE(v8) = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 v7 = (int *)&v5[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 if ( tolower((unsigned __int8)v5[v6]) == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 *(char *)v11 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 *(char *)a3 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 *(char *)v7 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 v8 = tolower(*(char *)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 if ( v8 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 *(char *)a4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 while ( v6 < (signed int)v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 v4 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 //----- (00454E3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 int __fastcall ParseMissleAttackType(const char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 const char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 int v4; // [sp-4h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 v1 = Str1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 if ( _strcmpi(Str1, "ARROW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 if ( _strcmpi(v1, "ARROWF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 if ( _strcmpi(v1, "FIRE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 {
102
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
10553 if ( _strcmpi(v1, "AIR") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 if ( _strcmpi(v1, "WATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 if ( _strcmpi(v1, "EARTH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 if ( _strcmpi(v1, "SPIRIT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 if ( _strcmpi(v1, "MIND") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 if ( _strcmpi(v1, "BODY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 if ( _strcmpi(v1, "LIGHT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 if ( _strcmpi(v1, "DARK") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 if ( _strcmpi(v1, "ENER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 v4 = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 v4 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 v4 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 v4 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 v4 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 v4 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 v4 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v4 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 v4 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 v4 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 //----- (00458244) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 unsigned int __fastcall SkillToMastery(unsigned __int16 a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 result = 1; // Normal
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 if ( HIBYTE(a1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 result = 4; // Grandmaster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 if ( (a1 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 if ( a1 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 result = 2; // Expert
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 result = 3; // Master
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 //----- (0045828B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 unsigned int __fastcall GetSpellColor(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 unsigned __int16 v1; // dx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 unsigned __int16 v2; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 unsigned __int16 v4; // [sp-4h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 if ( a1 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 if ( a1 < 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 goto LABEL_31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 v4 = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 if ( a1 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 v4 = 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 v2 = 192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 LABEL_31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 v1 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 v2 = 235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 v2 = 225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 v4 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 v1 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 v1 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 if ( a1 >= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 v1 = 212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 v2 = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 //----- (004583B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 LevelDecoration::LevelDecoration()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 this->field_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 this->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 this->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 this->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 this->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 this->uDecorationDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 this->field_16_event_id = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 this->uCog = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 //----- (00458600) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 void DecorationList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 DecorationList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 v2 = fopen("data\\ddeclist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 Abortf("Unable to save ddeclist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 fwrite(v1->pDecorations, 0x54u, v1->uNumDecorations, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 //----- (0045864C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 void DecorationList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 uNumDecorations = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 pDecorations = (DecorationDesc *)pAllocator->AllocNamedChunk(pDecorations,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 84 * uNumDecorations, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 memcpy(pDecorations, (char *)pSerialized + 4, 84 * uNumDecorations);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 //----- (00458693) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 void DecorationList::InitializeDecorationSprite(unsigned int uDecID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 pSpriteFrameTable->InitializeSprite(this->pDecorations[uDecID].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 //----- (004586B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 bool DecorationList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 DecorationList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 unsigned int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 FILE *v6; // ST18_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 unsigned __int16 v8; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 const char *v9; // ST20_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 const char *v10; // ST18_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 __int16 v11; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 const char *v12; // ST14_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 unsigned __int16 v13; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 const char *v14; // ST10_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 __int16 v15; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 const char *v16; // ST0C_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 unsigned __int8 v17; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 const char *v18; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 unsigned __int8 v19; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 const char *v20; // ST04_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 unsigned __int8 v21; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 const char *v22; // ST00_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 unsigned __int8 v23; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 char v24; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 unsigned __int8 v25; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 int j; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 const char *v27; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 int v28; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 int v30; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 int v31; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 int v32; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 int v33; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 int v34; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 int v35; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 FrameTableTxtLine v37; // [sp+Ch] [bp-460h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 FrameTableTxtLine v38; // [sp+88h] [bp-3E4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 char Dest; // [sp+104h] [bp-368h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 char Buf; // [sp+17Ch] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 FrameTableTxtLine v41; // [sp+370h] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 FrameTableTxtLine v42; // [sp+3ECh] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 FILE *File; // [sp+468h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 unsigned int Argsa; // [sp+474h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 Abortf("DecorationDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 memcpy(&v42, frame_table_txt_parser(&Buf, &v41), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v4 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v2->uNumDecorations = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v5 = pAllocator->AllocNamedChunk(v2->pDecorations, 84 * v4, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v2->pDecorations = (DecorationDesc *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 Abortf("DecorationDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v2->uNumDecorations = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 memcpy(&v42, frame_table_txt_parser(&Buf, &v38), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 strcpy(v2->pDecorations[v2->uNumDecorations].pName, v42.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v8 = pSpriteFrameTable->FastFindSprite(v2->pDecorations[v2->uNumDecorations].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v9 = v42.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v2->pDecorations[v2->uNumDecorations].uSpriteID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 strcpy(v2->pDecorations[v2->uNumDecorations].field_20, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 v10 = v42.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 v2->pDecorations[v2->uNumDecorations].uType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 v12 = v42.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v2->pDecorations[v2->uNumDecorations].uRadius = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v14 = v42.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v2->pDecorations[v2->uNumDecorations].uDecorationHeight = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 v16 = v42.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 v2->pDecorations[v2->uNumDecorations].uLightRadius = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 v18 = v42.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 v2->pDecorations[v2->uNumDecorations].uColoredLightRed = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 v20 = v42.pProperties[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 v2->pDecorations[v2->uNumDecorations].uColoredLightGreen = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 v21 = atoi(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 v22 = v42.pProperties[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 v2->pDecorations[v2->uNumDecorations].uColoredLightBlue = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 v2->pDecorations[v2->uNumDecorations].uSoundID = atoi(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 v25 = __OFSUB__(v42.field_0, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 v23 = v42.field_0 == 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 v24 = v42.field_0 - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 v2->pDecorations[v2->uNumDecorations].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 if ( !((unsigned __int8)(v24 ^ v25) | v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 strcpy(&Dest, v42.pProperties[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 memcpy(&v41, frame_table_txt_parser(&Dest, &v37), sizeof(v41));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 for ( j = 0; j < v41.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 v27 = v41.pProperties[j];
102
3b5267621a5b trash globals
Nomad
parents: 101
diff changeset
10945 if ( _strcmpi(v41.pProperties[j], "NBM") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 if ( _strcmpi(v27, "Invisible") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 if ( _strcmpi(v27, "FS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 if ( _strcmpi(v27, "FM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 if ( _strcmpi(v27, "FF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 if ( _strcmpi(v27, "Marker") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 if ( _strcmpi(v27, "LoopSlow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 if ( _strcmpi(v27, "EmitFire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 if ( _strcmpi(v27, "Dawn") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 if ( !_strcmpi(v27, "Dusk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 v35 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 *(char *)v35 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 v34 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 *(char *)v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 v33 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 *(char *)v33 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 v32 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 *(char *)v32 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 v31 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 *(char *)v31 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 v30 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 *(char *)v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 v29 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 *(char *)v29 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 v28 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 *(char *)v28 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 ++v2->uNumDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 //----- (00459064) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 void ObjectList::InitializeSprites()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 for (uint i = 0; i < uNumObjects; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 pSpriteFrameTable->InitializeSprite(pObjects[i].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 //----- (00459090) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 void ObjectList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 ObjectList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 v2 = fopen("data\\dobjlist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 Abortf("Unable to save dobjlist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 fwrite(v1->pObjects, 0x38u, v1->uNumObjects, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 //----- (004590DC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 void ObjectList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 uNumObjects = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 pObjects = (ObjectDesc *)pAllocator->AllocNamedChunk(pObjects, 56 * uNumObjects, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 memcpy(pObjects, (char *)pSerialized + 4, 56 * uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 //----- (00459123) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 bool ObjectList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 ObjectList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 __int32 v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 void *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 FILE *v7; // ST0C_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 char *i; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 unsigned __int16 v9; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 const char *v10; // ST20_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 __int16 v11; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 const char *v12; // ST1C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 __int16 v13; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 const char *v14; // ST18_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 __int16 v15; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 const char *v16; // ST14_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 __int16 v17; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 const char *v18; // ST10_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 __int16 v19; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 const char *v20; // ST0C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 int v21; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 const char *v22; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 int v23; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 int v24; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 int v26; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 int v27; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 int v28; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 int v29; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 int v30; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 int v31; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 const char *v32; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 const char *v33; // ST20_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 int v34; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 char v35; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 const char *v36; // ST1C_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 char v37; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 const char *v38; // ST18_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 FrameTableTxtLine v40; // [sp+8h] [bp-460h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 FrameTableTxtLine v41; // [sp+84h] [bp-3E4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 char Dest; // [sp+100h] [bp-368h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 char Buf; // [sp+178h] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 FrameTableTxtLine v44; // [sp+36Ch] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 FrameTableTxtLine v45; // [sp+3E8h] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 FILE *File; // [sp+464h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 unsigned int Argsa; // [sp+470h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 int Argsb; // [sp+470h] [bp+8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 pAllocator->FreeChunk(this->pObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v2->pObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v2->uNumObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 v4 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 File = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 Abortf("ObjectDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 if ( fgets(&Buf, 490, v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 if ( v45.field_0 && *v45.pProperties[0] != '/' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v5 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v2->uNumObjects = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v6 = pAllocator->AllocNamedChunk(v2->pObjects, 56 * v5, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v2->pObjects = (ObjectDesc *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 if ( v6 == (void *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 Abortf("ObjectDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 memset(v6, v3, 56 * v2->uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v2->uNumObjects = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 fseek(v7, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 if ( v45.field_0 && *v45.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 v10 = v45.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 v2->pObjects[v2->uNumObjects].uSpriteID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 v12 = v45.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 v2->pObjects[v2->uNumObjects].uObjectID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 v14 = v45.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 v2->pObjects[v2->uNumObjects].uRadius = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 v16 = v45.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 v2->pObjects[v2->uNumObjects].uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 v18 = v45.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 v2->pObjects[v2->uNumObjects].uLifetime = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 v20 = v45.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 v2->pObjects[v2->uNumObjects].uSpeed = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 strcpy(&Dest, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 if ( v45.field_0 > 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 for ( Argsb = 0; Argsb < v44.field_0; ++Argsb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 v21 = Argsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 v22 = v44.pProperties[Argsb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 if ( !_strcmpi(v44.pProperties[Argsb], "NoDraw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 v23 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 *(char *)v23 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 if ( !_strcmpi(v22, "Lifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 v24 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 *(char *)v24 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 if ( !_strcmpi(v22, "FTLifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 v25 = (int)&v2->pObjects[v2->uNumObjects];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 *(short *)(v25 + 42) = 8 * pSpriteFrameTable->pSpriteSFrames[*(short *)(v25 + 40)].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 v26 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 *(char *)v26 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 v27 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 *(char *)v27 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 if ( !_strcmpi(v22, "NoPickup") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 v28 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 *(char *)v28 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 if ( !_strcmpi(v22, "NoGravity") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 v29 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 *(char *)v29 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 if ( !_strcmpi(v22, "FlagOnIntercept") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 v30 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 *(char *)v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 if ( !_strcmpi(v22, "Bounce") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 v31 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 *(char *)v31 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 v32 = v45.pProperties[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 if ( !_strcmpi(v45.pProperties[v21], "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 if ( !_strcmpi(v32, "Lines") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 if ( !_strcmpi(v44.pProperties[v21], "bits") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 v33 = v44.pProperties[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 v34 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 *(char *)(v34 + 1) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 v35 = atoi(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 v36 = v44.pProperties[v21 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 v2->pObjects[v2->uNumObjects].uParticleTrailColorR = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 v37 = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 v38 = v44.pProperties[v21 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 v2->pObjects[v2->uNumObjects].uParticleTrailColorG = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 v2->pObjects[v2->uNumObjects].uParticleTrailColorB = atoi(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 ++v2->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 //----- (0045E03A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 unsigned __int16 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 int v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 unsigned __int8 v5; // cf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 unsigned int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 unsigned __int16 *v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 int j; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 unsigned __int16 *v9; // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 LONG v11; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 signed __int64 v12; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 unsigned int v13; // ST10_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 HRESULT v14; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 int v15; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 signed __int64 v16; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 signed int v17; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 unsigned __int16 *v18; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 int k; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 DDSURFACEDESC2 Dst; // [sp+4h] [bp-A0h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 unsigned __int16 *pPixels; // [sp+80h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 float v23; // [sp+84h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 unsigned __int16 *_this; // [sp+88h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 float v25; // [sp+8Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 unsigned int v26; // [sp+90h] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 int v27; // [sp+94h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 int v28; // [sp+98h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 int i; // [sp+9Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 int v30; // [sp+A0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v30 = width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v2 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 v27 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v23 = 452.0 / (double)width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 v25 = 336.0 / (double)height;
117
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11283 pPixels = (unsigned __int16 *)malloc(2 * height * width);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 {
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
11287 pRenderer->BeginSceneD3D();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 v9 = (unsigned __int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 v11 = Dst.lPitch >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 for ( i = 0; i < v27; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v28 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 if ( v30 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 v26 = v11 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 v12 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 *v3 = v9[v26 + (int)v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 v13 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v5 = v30 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 v6 = (unsigned int)v30 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 v7 = &v3[2 * v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 for ( j = v5; j; --j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 _this = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 v26 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 if ( pRenderer->pTargetSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v15 = v26 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 v16 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 *v3 = _this[v15 + (int)v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 while ( i < v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 v18 = &v3[2 * ((unsigned int)v30 >> 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 for ( k = v30 & 1; k; --k )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 --v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 while ( v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 return pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 //----- (0045E26C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 void __thiscall SaveScreenshot(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 unsigned __int16 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 v1 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 v2 = MakeScreenshot(92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 pRenderer->SavePCXImage(v1, (char *)v2, 92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11429
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11430
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 //----- (004601B7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11432 void GameUI_MainMenu_DoDrawLoad(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 unsigned __int16 v1; // bx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 unsigned int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 unsigned int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 unsigned int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 unsigned int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 unsigned int v7; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 signed __int64 v8; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 unsigned int v9; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 unsigned __int64 v10; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 __int64 v11; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 char v12; // di@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 unsigned __int64 v13; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 unsigned int v14; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 __int64 v15; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 int v16; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 signed int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 const char *v18; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 int v19; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 const char *v20; // ST18_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 const char *v22; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 int v23; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 const char *v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 int v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 GUIWindow Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 /*unsigned int Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 unsigned int v27; // [sp+10h] [bp-74h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 int v28; // [sp+14h] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 int v29; // [sp+18h] [bp-6Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 unsigned int v30; // [sp+1Ch] [bp-68h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 unsigned int v31; // [sp+20h] [bp-64h]@8*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 __int64 v32; // [sp+60h] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 int v33; // [sp+68h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 unsigned int v34; // [sp+70h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 __int64 v35; // [sp+74h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 int v36; // [sp+7Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 int a4; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 a4 = a1;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11475 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11476 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 8u,
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11483 uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 v2 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 v3 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v2 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 v3 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 }
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11494 pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0));
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11495 pRenderer->DrawTextureIndexed(18, 139, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0));
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11496 pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 memset(&Dst, 0, 0x54u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 Dst.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11503 v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 Dst.uFrameWidth = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 v4 += 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 Dst.uFrameY = v4;
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11507 v5 = pFontSmallnum->uFontHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 Dst.uFrameZ = Dst.uFrameX + 219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 Dst.uFrameHeight = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 Dst.uFrameW = v5 + v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 v6 = uLoadGameUI_SelectedSlot;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11512 if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 pRenderer->DrawTextureRGB(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 pGUIWindow_CurrentMenu->uFrameX + 276,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 pGUIWindow_CurrentMenu->uFrameY + 171,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 pSavegameThumbnails + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 v6 = uLoadGameUI_SelectedSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11520 v7 = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[v7].pName, 3u);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11522 v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11523 HIDWORD(v32) = (unsigned __int64)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 v8 /= 60i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 v10 = (unsigned int)v8 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 v34 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 v11 = (unsigned int)(v10 / 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 LODWORD(v13) = (unsigned int)v11 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 HIDWORD(v13) = HIDWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 v33 = v13 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 v36 = v13 / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 v15 = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 v14 = (unsigned __int64)(v35 % 24) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 LODWORD(v35) = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 HIDWORD(v15) = v34 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 v36 += 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 v16 = v12 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 Dst.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 HIDWORD(v35) = (v14 & 0x80000000u) == 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 && ((signed int)v14 > 0 || (unsigned int)v15 >= 0xC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 && (signed int)v14 <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 0x18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 0xC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 if ( !(v14 | (unsigned int)v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 v17 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 LODWORD(v15) = v15 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 LABEL_23:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11564 auto _d = aDayNames[HIDWORD(v15) % 7];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11565 auto _a = aAMPMNames[HIDWORD(v35)];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11566 auto _m = aMonthNames[v33];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11567 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, v36);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11568 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d",
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11569 _d,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 v17,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11571 (int)v32,
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11572 _a,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 7 * v16 + HIDWORD(v15) % 7 + 1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11574 _m,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11596 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 v18 = pGlobalTXT_LocalizationStrings[135];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 v19 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[135]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, v18, 0, 0, 0);
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11601 v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 v21 = pFontSmallnum->AlignText_Center(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 0xBAu,
94
6c42178c226e minor things
Nomad
parents: 82
diff changeset
11604 (const char *)pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106u, 0, v20, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 v22 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 v23 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, v22, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 v34 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 v34 = uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 a4 = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 v36 = dword_6A0C9C;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11618 v24 = (const char *)(&pSavegameHeader[dword_6A0C9C]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 if ( v36 >= (signed int)v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11623 short clr;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11624 HIDWORD(v35) = clr = (v36 == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11627 0x64) : 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 if ( pGUIWindow_CurrentMenu->field_40 != 1 || v36 != uLoadGameUI_SelectedSlot )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11630 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1Bu, a4, clr, v24, 185, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 0x1Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 a4,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11638 clr,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 (const char *)pKeyActionMap->pPressedKeysBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 175,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 a4 += 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 v24 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 while ( a4 < 346 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 // 6A0C9C: using guessed type int dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 //----- (004606F7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11655 void __cdecl GameUI_MainMenu_DrawLoad()
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11656 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11657 GameUI_MainMenu_DoDrawLoad(0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 //----- (004606FE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 void __cdecl sub_4606FE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11663 GameUI_MainMenu_DoDrawLoad(1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 //----- (00460706) --------------------------------------------------------
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11667 void TryLoadLevelFromLOD()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 FILE *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 FILE *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 __int32 v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 char Ext[256]; // [sp+4h] [bp-40Ch]@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11673 char Dir[256]; // [sp+104h] [bp-30Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 char Filename[256]; // [sp+204h] [bp-20Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 char a1[260]; // [sp+304h] [bp-10Ch]@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11676 char Drive[4]; // [sp+408h] [bp-8h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 int DstBuf; // [sp+40Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 strcpy(a1, pCurrentMapName);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11680 _splitpath(a1, Drive, Dir, Filename, Ext);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11681 sprintf(a1, "levels\\%s%s", Filename, ".lod");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 v0 = fopen(a1, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 fseek(v0, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v2 = ftell(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 rewind(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 ptr_6A0D08 = pAllocator->AllocNamedChunk(ptr_6A0D08, v2, "LevelLod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 fread(ptr_6A0D08, v2, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 fseek(v1, v2 - 6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 DstBuf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 fread(&DstBuf, 4u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 fread(&_6A0D10_txt_lod_loading__unused, 2u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 _6A0D0C_txt_lod_loading = (int)((char *)ptr_6A0D08 + DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 fclose(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 //----- (0046080D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 void __cdecl sub_46080D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 //----- (0046082C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 bool Initialize_GamesLOD_NewLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11711 pGames_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11712 pGames_LOD->AllocSubIndicesAndIO(300, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 if (pGames_LOD->LoadFile("data\\games.lod", 1))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11715 pNew_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11716 pNew_LOD->AllocSubIndicesAndIO(300, 0x186A0u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 //----- (0046086A) --------------------------------------------------------
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11727 bool Autosave()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 {
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11729 int flag; // esi@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 FILE *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 void *pSave; // [sp+170h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 pVideoPlayer->Unload();
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11739 flag = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11740 pSave = pAllocator->AllocNamedChunk(0, 0xF4240, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 remove("data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 this_.Reset();
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11744 strcpy(this_.LodVersion, "MMVII");
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11745 strcpy(this_.LodDescription, "newmaps for MMVII");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 this_.dword_0000A4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 this_.dword_0000A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 a3.dword_000018 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 a3.word_00001E = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11750 strcpy(a3.pFilename, "current");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 pNew_LOD->_461492(&this_, &a3, "data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 if ( pNew_LOD->LoadFile("data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 pNew_LOD->CreateTempFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 pNew_LOD->uNumSubIndices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 pDir.Reset();
117
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11757
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11758 for (int i = pGames_LOD->uNumSubIndices / 2; i < pGames_LOD->uNumSubIndices; ++i)
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11759 {
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11760 memcpy(&pDir, &pGames_LOD->pSubIndices[i], sizeof(pDir));
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11761 v3 = pGames_LOD->FindContainer(pGames_LOD->pSubIndices[i].pFilename, 1);
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11762 fread(pSave, pGames_LOD->pSubIndices[i].uDataSize, 1, v3);
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11763 pNew_LOD->AppendDirectory(&pDir, pSave);
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11764 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 v7.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 strcpy(pSavegameHeader->pLocationName, "out01.odm");
117
a64b244da76c some things lod
Nomad
parents: 110
diff changeset
11767 strcpy(v7.pFilename, "header.bin");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 v7.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 pNew_LOD->AppendDirectory(&v7, &pSavegameHeader);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 pNew_LOD->Save();
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11771 pParty->vPrevPosition.y = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 pParty->vPrevPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 pParty->vPosition.x = 12552;
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11774 pParty->vPosition.z = 0;
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11775 pParty->uFallStartY = 0;
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11776 pParty->sPrevRotationX = 0;
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11777 pParty->sRotationX = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 pParty->vPrevPosition.z = 1816;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
11779 pParty->vPosition.y = 1816;
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11780 flag = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 pParty->sPrevRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 SaveGame(1, (__int16 *)1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 pAllocator->FreeChunk(pSave);
110
430786d916d6 6.11.12 SaveLoad
Ritor1
parents: 109
diff changeset
11786 return flag;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 //----- (004610AA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 OutdoorCamera *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 v2 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 pGameLoadingUI_ProgressBar->Reset(0x1Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 ODM_LoadAndInitialize(pCurrentMapName, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 //----- (00461103) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 void __cdecl sub_461103()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11812 //GUIProgressBar *v0; // ebx@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11813 //signed int v1; // ebp@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11814 //char *v2; // esi@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 __int16 v3; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 int v4; // edx@8
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11817 //size_t v5; // edi@14
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 signed int v6; // esi@14
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11819 //char *v7; // edx@15
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 signed int v8; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 int v9; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 MonsterInfo *v10; // ebx@23
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11823 //int *v11; // esi@23
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 int v13; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 __int16 v14; // ax@41
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11827 //signed int v15; // [sp+10h] [bp-4Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11828 //signed int v16; // [sp+10h] [bp-4Ch]@14
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 signed int v17; // [sp+14h] [bp-48h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 signed int v18; // [sp+14h] [bp-48h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 int v19; // [sp+18h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 signed int v20; // [sp+18h] [bp-44h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 int v21[16]; // [sp+1Ch] [bp-40h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 sub_450218_prolly_generate_chests_loot();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11836 //v0 = pGameLoadingUI_ProgressBar;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 pParty->field_7B5_in_arena_quest = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11840 //v1 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 dword_5C6DF8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 pNPCStats->field_17FC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 v19 = pMapStats->GetMapInfo(pCurrentMapName);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11844
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11845 //v15 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11846 for (uint i = 0; i < uNumActors; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11847 //if ( (signed int)uNumActors > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11848 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11849 auto pActor = pActors + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11850 //v2 = (char *)&pActors[0].uNPC_ID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11851 //do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11852 //{
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11853 v3 = pActor->pMonsterInfo.uID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11854 v17 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 if ( v3 >= 115 && v3 <= 186 || v3 >= 232 && v3 <= 249 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 v17 = 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11857 //v1 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 v4 = (v3 - 1) % 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 if ( 2 == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11861 if ( pActor->uNPC_ID && pActor->uNPC_ID < 5000 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11862 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11868 if ( v4 != 0 || pActor->uNPC_ID )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11869 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11873 if ( pActor->uNPC_ID > 0 && pActor->uNPC_ID < 5000 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11874 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->array_13EF4[pNPCStats->field_17FC0], v3, 0, v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 v14 = LOWORD(pNPCStats->field_17FC0) + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 ++pNPCStats->field_17FC0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11880 pActor->uNPC_ID = v14;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11881 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 LABEL_12:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11884 pActor->uNPC_ID = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11885 //LABEL_13:
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11886 //++v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11887 //v2 += 836;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11888 //}
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11889 //while ( v15 < (signed int)uNumActors );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11890 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11891
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 pGameLoadingUI_ProgressBar->Progress();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11893
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11894 //v5 = uNumActors;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11897 //v16 = v1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11898
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11899 for (uint i = 0; i < uNumActors; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11900 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11901 auto pActor = pActors + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11902 //v7 = (char *)&pActors[0].pMonsterInfo;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11903 //do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11904 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 v8 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11906 if ( v6 > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11910 if ( v21[v8] == pActor->pMonsterInfo.uID - 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 while ( v8 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11916
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 if ( v8 == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11919 v21[v6++] = pActor->pMonsterInfo.uID - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 v20 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 if ( v6 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11924 //++v16;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11925 //v7 += 836;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11926 //}
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11927 //while ( v16 < (signed int)v5 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11928 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11929
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 pGameLoadingUI_ProgressBar->Progress();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11931
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11932 if ( v6 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11933 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11934 int _v0 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11937 v9 = v21[_v0];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 v18 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 v10 = &pMonsterStats->pInfos[v9 + 1];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11940 //v11 = (int *)pMonsterList->pMonsters[v9].pSoundSampleIDs;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11941 auto v11 = &pMonsterList->pMonsters[v9];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11944 pSoundList->_4A9A67(v11->pSoundSampleIDs[4 - v18], 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11945 //v11 = (int *)((char *)v11 + 2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 do
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11951 v13 = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v10->uSpell1ID], 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 while ( v13 );
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11953 ++_v0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11954 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11955 while ( _v0 < v6 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11956 //v0 = pGameLoadingUI_ProgressBar;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11957 //v1 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11958 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11959
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11960 pGameLoadingUI_ProgressBar->Progress();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11961
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 if ( dword_6BE368_debug_settings_2 & 4 )
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11963 uNumActors = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 if ( dword_6BE368_debug_settings_2 & 8 )
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11965 uNumLevelDecorations = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 sub_4613C4();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11967
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11968 pGameLoadingUI_ProgressBar->Progress();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11969
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11970 pIndoorCamera->pos.y = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11971 pIndoorCamera->pos.x = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 pIndoorCamera->pos.z = 100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11973 pIndoorCamera->sRotationY = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11974 pIndoorCamera->sRotationX = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 viewparams->bRedrawGameUI = 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11976 uLevel_StartingPointType = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 pSprites_LOD->_461397();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 pPaletteManager->LockTestAll();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11979 if ( pParty->pPickedItem.uItemID != 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11982
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 //----- (004613C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 int __cdecl sub_4613C4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 unsigned __int16 v0; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 size_t v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 LevelDecoration *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 _6836C8_num_decorations_6807E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 v0 = pDecorationList->GetDecorIdByName("Event Trigger");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 v1 = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 v2 = (signed __int16)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 v4 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 if ( v4->uDecorationDescID == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 v5 = _6836C8_num_decorations_6807E8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 _6807E8_level_decorations_ids[v5] = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 while ( result < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 //----- (004621DA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 int __fastcall sub_4621DA(signed int a1, signed int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 signed int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 signed int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 signed int v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 if ( a1 < a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 a1 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 a2 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 v4 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 if ( a1 < a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 a1 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 if ( a2 < v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 v4 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 return (11 * a2 >> 5) + a1 + (v4 >> 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12061
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12062
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12063
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 //----- (0046271C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 void __cdecl crt_init_globals_46271C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 ofn.lStructSize = 0x4Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 ofn.hwndOwner = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 ofn.hInstance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 ofn.lpstrFilter = "Indoor BLV Files (*.blv)";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 ofn.lpstrCustomFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 ofn.nMaxCustFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 ofn.nFilterIndex = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 ofn.lpstrFile = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 ofn.nMaxFile = 260;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 ofn.nMaxFileTitle = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 ofn.lpstrInitialDir = "levels";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 ofn.lpstrTitle = "Might and Magic® VII - Load Which Level?";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 ofn.Flags = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 ofn.nFileOffset = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 ofn.nFileExtension = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 ofn.lpstrDefExt = "blv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 ofn.lCustData = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 ofn.lpfnHook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 ofn.lpTemplateName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 ofn.lpstrFileTitle = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 //----- (004627B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 void __cdecl MainMenu_Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 GUIButton *v8; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 unsigned int v9; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 int v10; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 int v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 unsigned int v12; // [sp-18h] [bp-54h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 Texture *v13; // [sp-14h] [bp-50h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 GUIButton *v14; // [sp+0h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 GUIWindow *v15; // [sp+4h] [bp-38h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12104 pCurrentScreen = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12105 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12115 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12116
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12117 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12118 //v0 = pIcons_LOD->LoadTexture("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12119 //v1 = (Texture *)(v0 != -1 ? &pIcons_LOD->pTextures[v0] : 0);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12120 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12121 pNew->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12122 pNew->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12123 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12124 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12125 UIMSG_MainMenu_ShowPartyCreationWnd,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12126 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12127 78,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12128 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12129 pNew,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12130 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12131 //v2 = pIcons_LOD->LoadTexture("title_load", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12132 //v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12133 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12134 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12135 pLoad->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12136 pLoad->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12137 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12138 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12139 UIMSG_MainMenu_ShowLoadWindow,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12140 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12141 76,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12142 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12143 pLoad,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12144 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12145 //v4 = pIcons_LOD->LoadTexture("title_cred", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12146 //v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12147 auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12148 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12149 pCredits->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12150 pCredits->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12151 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12152 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12153 UIMSG_ShowCredits,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12154 2,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12155 67,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12156 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12157 pCredits,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12158 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12159 //v6 = pIcons_LOD->LoadTexture("title_exit", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12160 //v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12161 auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12162 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12163 pExit->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12164 pExit->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12165 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12166 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12167 UIMSG_ExitToWindows,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12168 3,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12169 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12170 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12171 pExit,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12172 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12173
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12174 pTexture_PCX.Release();
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12175 pTexture_PCX.Load("title.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12176 SetCurrentMenuID(MENU_MAIN);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 SetForegroundWindow(hWnd);
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
12178 SendMessageW(hWnd, WM_ACTIVATEAPP, 1, 0);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12179 while (GetCurrentMenuID() == MENU_MAIN ||
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12180 GetCurrentMenuID() == MENU_SAVELOAD)
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12181 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12182 POINT pt;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12183 pMouse->GetCursorPos(&pt);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12184 //uMouseX = pMouse->GetCursorPos(&v18)->x;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12185 //uMouseY = pMouse->GetCursorPos(&v19)->y;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12186 v15 = pWindow_MainMenu;
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12187 if ( GetCurrentMenuID() == MENU_SAVELOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12189 if ( pCurrentScreen != 12 )
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12190 {
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12191 pTexture_PCX.Release();
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12192 pTexture_PCX.Load("lsave640.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12193 pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12194 pCurrentScreen = 12;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 GameUI_DrawLoadMenu(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 v15 = pGUIWindow_CurrentMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12199
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12200 MSG msg;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12201 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12202 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12203 if (msg.message == WM_QUIT)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 Game_DeinitializeAndTerminate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12205 TranslateMessage(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12206 DispatchMessageA(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12207 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12208 if (dword_6BE364_game_settings_1 & 0x0100)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 pRenderer->BeginScene();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12215 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12216 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 GUI_UpdateWindows();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12220 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 pAsyncMouse->_46B736_consume_click_lists(1);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12222 if (GetCurrentMenuID() != MENU_MAIN)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 LABEL_45:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12225 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 pGUIWindow_CurrentMenu = 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12230 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 if ( !ptr_507BDC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 v8 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 v14 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12244 if ( pt.x >= (signed int)v8->uX
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12245 && pt.x <= (signed int)v8->uZ
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12246 && pt.y >= (signed int)v8->uY
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12247 && pt.y <= (signed int)v8->uW
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12248 && v15 == pWindow_MainMenu )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 v9 = v8->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 v10 = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 v11 = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 if ( v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 goto LABEL_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12261 v13 = pExit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v12 = 337;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12266 v13 = pCredits;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 v12 = 282;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12272 v13 = pLoad;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 v12 = 227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12278 v13 = pNew;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 v12 = 172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 pRenderer->DrawTextureIndexed(495u, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 v8 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 v14 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 v8 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 pRenderer->Present();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12302 pTexture_PCX.Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 if ( pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12308 pWindow_MainMenu->Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 //----- (004637EB) --------------------------------------------------------
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12316 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 unsigned int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 Render *v5; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 HANDLE v6; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 Keyboard *v7; // eax@33
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12322 //HDC v9; // edi@41
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 HDC v10; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 int v11; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 char v12; // zf@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 signed int v13; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 int v14; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 int v15; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 int v16; // eax@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 int v17; // eax@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 int v18; // eax@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 int v19; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 int v20; // eax@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 int v21; // eax@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 int v22; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 int v23; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 int v24; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 int v25; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 int v26; // eax@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 char v27; // al@174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 bool v28; // ebx@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 char v29; // dl@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 char v30; // cl@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 bool v31; // ebx@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 void *v32; // ebx@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 float v33; // ST04_4@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 float v34; // ST04_4@254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 HWND v35; // [sp+8h] [bp-64h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 UINT v36; // [sp+Ch] [bp-60h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 WPARAM v37; // [sp+10h] [bp-5Ch]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 LPARAM v38; // [sp+14h] [bp-58h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 int pXY[2]; // [sp+64h] [bp-8h]@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 int a2; // [sp+7Ch] [bp+10h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12356 switch (Msg)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12357 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12358 case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12359 };
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 if ( Msg > WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 switch ( Msg )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 case WM_DEVICECHANGE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 if ( wParam == 0x8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 case WM_SIZING:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 case WM_LBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12378 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 LABEL_210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 goto LABEL_263;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12390 if (GetCurrentMenuID() != MENU_CREATEPARTY)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 goto LABEL_229;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 case WM_RBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 goto LABEL_240;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12397 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 case WM_LBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 goto LABEL_218;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12406 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 pArcomageGame->stru1.field_0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 case WM_RBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 if ( pAsyncMouse != v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 back_to_game();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12421 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 pArcomageGame->stru1.field_0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 case WM_LBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12430 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 if ( uCurrentMenuID != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 LABEL_229:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 sub_41CD4F(0x29u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 LABEL_230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 if ( pGame != (Game *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 if ( pAsyncMouse != (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, v28, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 UI_OnMouseLeftClick(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 case WM_RBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 pVideoPlayer->bStopBeforeSchedule = 1;
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12468 if (!pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12470 if (pGame)
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12471 {
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12472 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 v33 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &stru_F93E30, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 }
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12477 if (!pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12484 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 case WM_MBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 if ( pGame && !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 v34 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &a3, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 if ( !pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 sub_417871(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 case WM_MOUSEMOVE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12506 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 pXY[0] = (unsigned __int16)lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 pXY[1] = lParam >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 ArcomageGame::OnMouseMove((POINT *)pXY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 ArcomageGame::OnMouseClick(0, wParam & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 v29 = (wParam >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 LABEL_262:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 v30 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 LABEL_263:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 ArcomageGame::OnMouseClick(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12520 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 if ( Msg == WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 if ( wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 if ( Msg > WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 if ( Msg == WM_WINDOWPOSCHANGED )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12537 if (pVideoPlayer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12538 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12539 if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12540 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12541 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12542 return DefWindowProcA(hWnd, Msg, wParam, v4);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12543 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 if ( Msg != WM_KEYFIRST )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 if ( Msg == WM_KEYUP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 if ( wParam == VK_CONTROL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 dword_507B98_ctrl_pressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 if ( Msg == WM_CHAR )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 if ( !pKeyActionMap->_459F10(wParam) && !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 GUI_HandleHotkey(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 if ( Msg != WM_COMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 if ( wParam != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 if ( wParam == 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 pRenderer->SavePCXScreenshot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 if ( wParam == 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 pArcomageGame->field_F6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 if ( wParam != 40001 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 v36 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v35 = ::hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 LABEL_104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 SendMessageA(v35, v36, v37, v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 if ( dword_506E68 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 pKeyActionMap->_459F10(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 if ( wParam != 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 if ( wParam == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 dword_507B98_ctrl_pressed = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 v12 = ptr_507BC0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 if ( wParam <= 0x24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 if ( wParam > 0x28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 if ( wParam != 115 || pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 v37 = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 v36 = 273;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 v35 = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 goto LABEL_104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12635 if ( pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12636 && pCurrentScreen != 21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 if ( !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 sub_41CD4F(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 pArcomageGame->stru1.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 if ( (signed int)(unsigned __int16)v13 > 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 if ( v13 > 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 v24 = v13 - 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 LOBYTE(pArcomageGame->stru1.field_8) = 123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 if ( !v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 LOBYTE(pArcomageGame->stru1.field_8) = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 LOBYTE(pArcomageGame->stru1.field_8) = 125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 if ( v26 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 LOBYTE(pArcomageGame->stru1.field_8) = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 if ( v13 == 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 LOBYTE(pArcomageGame->stru1.field_8) = 43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 v21 = v13 - 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 LOBYTE(pArcomageGame->stru1.field_8) = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 LOBYTE(pArcomageGame->stru1.field_8) = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 v23 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 LOBYTE(pArcomageGame->stru1.field_8) = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 if ( v23 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 LOBYTE(pArcomageGame->stru1.field_8) = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 if ( (unsigned __int16)v13 == 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 LOBYTE(pArcomageGame->stru1.field_8) = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 if ( v13 > 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 v18 = v13 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 LOBYTE(pArcomageGame->stru1.field_8) = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 LOBYTE(pArcomageGame->stru1.field_8) = 35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 LOBYTE(pArcomageGame->stru1.field_8) = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 LOBYTE(pArcomageGame->stru1.field_8) = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 if ( v13 == 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 LOBYTE(pArcomageGame->stru1.field_8) = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 v14 = v13 - 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 LOBYTE(pArcomageGame->stru1.field_8) = 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 v15 = v14 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 LOBYTE(pArcomageGame->stru1.field_8) = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 v16 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 LOBYTE(pArcomageGame->stru1.field_8) = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 LOBYTE(pArcomageGame->stru1.field_8) = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 LOBYTE(pArcomageGame->stru1.field_8) = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 pArcomageGame->field_F5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 pArcomageGame->field_F4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 pArcomageGame->uGameResult = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 pArcomageGame->field_B0 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 if ( wParam != 114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 SendMessageA(hWnd, 0x111u, 0x68u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 v37 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 LOBYTE(pArcomageGame->stru1.field_8) = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 if ( Msg == WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 if ( wParam && (GetForegroundWindow() == hWnd || GetForegroundWindow() == hInsertCDWindow) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 dword_4E98BC_bApplicationActive = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 v10 = GetDC(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 a2 = GetDeviceCaps(v10, BITSPIXEL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 v11 = GetDeviceCaps(v10, PLANES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 ReleaseDC(0, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 if ( a2 != 16 || v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 Abortf(pGlobalTXT_LocalizationStrings[62]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12821 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 if ( BYTE1(dword_6BE364_game_settings_1) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 BYTE1(dword_6BE364_game_settings_1) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 if ( BYTE1(dword_6BE364_game_settings_1) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 if ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 pRenderer->RestoreFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 pRenderer->_4A184C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 if ( !(dword_6BE364_game_settings_1 & 0x100) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 pVideoPlayer->bStopBeforeSchedule = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12858 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 dword_6BE364_game_settings_1 |= 0x100u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 if ( pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 BYTE1(dword_6BE364_game_settings_1) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 if ( pMiscTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 BYTE1(dword_6BE364_game_settings_1) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 if ( pGame && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 }
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12881 if (Msg == WM_CREATE)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12882 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12883 auto hDC = GetDC(hWnd);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12884 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12885 if (GetDeviceCaps(hDC, BITSPIXEL) < 8)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12886 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12887 ReleaseDC(hWnd, hDC);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12888 Log::Warning(L"You must be running in 256 color mode or higher.");
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12889 Abortf("You must be running in 256 color mode or higher. You can change the screen depth with the control panel display icon.");
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12890 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12891 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12892 ReleaseDC(hWnd, hDC);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 if ( Msg == WM_DESTROY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 v6 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 SetPriorityClass(v6, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 if ( pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 v7 = pGame->pKeyboardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 if ( LOBYTE(v7->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 pAsyncKeyboard->_45B3A4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12908 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 pAsyncMouse->_46B1DD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 PostQuitMessage(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 if ( Msg == WM_SETFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 if ( ::hWnd == (HWND)wParam )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 ClipCursor(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12921 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 _def_wnd_proc:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 if ( Msg != WM_KILLFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 if ( Msg == WM_PAINT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 if ( !GetUpdateRect(hWnd, 0, 0) || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 BeginPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 EndPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 //----- (00464479) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 int v0; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12970 if (pMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 pMouse->SetCursorBitmap("MICON1");
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12972
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 pPaletteManager->ResetNonLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 pBitmaps_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 pSprites_LOD->DeleteSomeOtherSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 pIcons_LOD->ReleaseAll2();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12977 if (pRenderer->pRenderD3D)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 pRenderer->field_1036B8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 pRenderer->_gpu_memory_used = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 sub_46080D();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12983 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 pIndoor->Release();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12985 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12986 pOutdoor->Release2();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 pSoundList->_4A9D79(0);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12990 uCurrentlyLoadedLevelType = LEVEL_null;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 pSpriteFrameTable->ResetSomeSpriteFlags();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 v0 = uNumVisibleWindows;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 while ( v0 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 //----- (004646F0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 void PrepareWorld(unsigned int this_)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 v1 = this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 pGame->pVisInstance->_4C1A02();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 pParty->uFlags = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 pStru277->_427D48(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 DoPrepareWorld(0, (v1 == 0) + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 //----- (00464761) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 void __thiscall Game_DeinitializeAndTerminate(int exitCode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v1 = exitCode;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 v2 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 SetPriorityClass(v2, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 pRenderer->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 if ( !DestroyWindow(hWnd) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 hWnd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 exit(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 //----- (004647AB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 void __cdecl FinalInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 pViewport->_4C02F8((signed __int64)(flt_6BE3A0 * 65536.0));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13041
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13042 pIndoorCamera = new IndoorCamera;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 pIndoorCamera->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 65,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 viewparams->uScreenZ - viewparams->uScreenX + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 viewparams->uScreenW - viewparams->uScreenY + 1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13047
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 InitializeTurnBasedAnimations(&stru_50C198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 // 6BE3A0: using guessed type float flt_6BE3A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 //----- (00464839) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 char __cdecl Is_out15odm_underwater()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 return _strcmpi(pCurrentMapName, "out15.odm") == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 //----- (00464851) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 void __cdecl SetUnderwaterFog()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 day_fogrange_1 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 day_fogrange_2 = 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13067
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13068
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 //----- (00464866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 void __fastcall DoPrepareWorld(unsigned int bLoading, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 char *v3; // eax@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13075 //char *v4; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 unsigned int v5; // eax@3
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13077 //size_t v6; // ecx@10
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13078 //char *v7; // eax@11
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 char Str1[20]; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 unsigned int v9; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 v9 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 pDecalBuilder->Reset(0);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13086 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 v3 = strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 strcpy(Str1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 Level_LoadEvtAndStr(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 LoadLevel_InitializeLevelEvt();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 _strrev(Str1);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13096
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13097 for (uint i = 0; i < 1000; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13098 pLayingItems[i].uObjectDescID = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13099
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 v5 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 uLevelMapStatsID = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 if ( !_strcmpi(pCurrentMapName, "out15.odm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 pParty->field_6F4_packedid = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 if ( _strcmpi(Str1, "blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 PrepareToLoadODM(v9, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 PrepareToLoadBLV(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 pAudioPlayer->SetMapEAX();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 sub_461103();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 if ( !_strcmpi(pCurrentMapName, "d11.blv") || !_strcmpi(pCurrentMapName, "d10.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 {
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13118 //spawning grounds & good analogue - no loot & exp from monsters
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13119
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13120 for (uint i = 0; i < uNumActors; ++i)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13121 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13122 pActors[i].pMonsterInfo.uTreasureType = 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13123 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13124 pActors[i].pMonsterInfo.uExp = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 bDialogueUI_InitializeActor_NPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 OnMapLoad();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 pGameLoadingUI_ProgressBar->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 _flushall();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
13133
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 //----- (004649EF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 int v3; // [sp+4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 DWORD cbData; // [sp+8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 DWORD dwDisposition; // [sp+10h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 BYTE Data[4]; // [sp+14h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 HKEY hKey; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 HKEY phkResult; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 HKEY v10; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 HKEY v11; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 v3 = uDefValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 cbData = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13157 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13158 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13159 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v10, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13160 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13161 if ( !RegCreateKeyExA(v10, "1.0", 0, "", 0, 0xF003Fu, 0, &v11, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 *(int *)Data = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 RegCloseKey(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 RegCloseKey(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 return *(int *)Data;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 //----- (00464B02) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 size_t v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 const char *Str; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 HKEY v8; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 HKEY v9; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 Str = pString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13199 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13200 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13201 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13202 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13203 if ( !RegCreateKeyExA(v8, "1.0", 0, "", 0, 0xF003Fu, 0, &v9, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 v2 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 RegSetValueExA(v9, lpValueName, 0, 1u, (const BYTE *)Str, v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 RegCloseKey(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 //----- (00464BEF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 LSTATUS (__stdcall *v4)(HKEY); // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 LSTATUS result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 DWORD Type; // [sp+Ch] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 LPCSTR lpValueName; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 DWORD cbData; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 LPBYTE Dest; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 DWORD dwDisposition; // [sp+1Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 HKEY phkResult; // [sp+20h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 HKEY hKey; // [sp+24h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 HKEY v13; // [sp+28h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 HKEY v14; // [sp+2Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 cbData = uBufLen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 Dest = (LPBYTE)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 lpValueName = pKeyName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey)
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13241 || RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13242 || RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v13, &dwDisposition)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13243 || RegCreateKeyExA(v13, "1.0", 0, "", 0, 0xF003Fu, 0, &v14, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 if ( RegQueryValueExA(v14, lpValueName, 0, &Type, Dest, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 RegCloseKey(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 result = RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 result = v4(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 result = v4(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 if ( hKey )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 result = v4(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 if ( phkResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 result = v4(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 //----- (00464D32) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 BYTE Data[4]; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 HKEY v7; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 HKEY v8; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 *(int *)Data = val;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13292 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13293 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13294 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v7, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13295 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13296 if ( !RegCreateKeyExA(v7, "1.0", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 RegSetValueExA(v8, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 RegCloseKey(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 //----- (00464E17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 bool __fastcall CheckMM7CD(char c)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 char DstBuf[256]; // [sp+Ch] [bp-218h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 char strCommand[256]; // [sp+10Ch] [bp-118h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 char Filename[20]; // [sp+20Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 wchar_t pMagicPath[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 swprintf(pMagicPath, L"%C:\\anims\\magic7.vid", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 if (GetFileAttributesW(pMagicPath) == -1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 wsprintfA(strCommand, "info CD UPC wait");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 wsprintfA(strCommand, "close CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 *Filename = c;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 auto f = fopen(Filename, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 if (!f)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 if (!fseek(f, 0, SEEK_END))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 if (!fseek(f, -100, SEEK_CUR))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 fread(DstBuf, 1u, 0x64u, f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 //----- (00464F1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 char v4; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 INT_PTR v12; // [sp-4h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 if ( a2 == 272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 hInsertCDWindow = hDlg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 v7 = v6 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 v8 = v7 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 v9 = v8 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 if ( v9 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 v11 = "Odwolaj";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 SetWindowTextA(hDlg, "Inserire il secondo CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 v11 = "Annulla";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 SetWindowTextA(hDlg, "Insérez le CD 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 v11 = "Supprimer";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 v11 = "Cancelar";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 v11 = "Abbrechen";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 v10(hDlg, 2, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 if ( a2 == 273 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 if ( a3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 EndDialog(hDlg, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 v4 = a3 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 v4 = a2 == 1025;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 //----- (00465061) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 char drive[4] = {'X', ':', '\\', 0};
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 bool bGotCDFromRegistry = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 HKEY hSoftware = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 hNWC = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 hMM7 = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 hVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 DWORD cbData = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 bGotCDFromRegistry = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 RegCloseKey(hVersion);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 RegCloseKey(hMM7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 RegCloseKey(hNWC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 RegCloseKey(hSoftware);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 if (bGotCDFromRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 if (CheckMM7CD(*drive))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 while (true)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 for (uint i = 0; i < 26; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 drive[0] = 'A' + i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 if (GetDriveTypeA(drive) == DRIVE_CDROM)
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13486 if (CheckMM7CD(*drive))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 WriteWindowsRegistryString("CDDrive", drive);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", ::hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 //----- (004651F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 bool MM7_Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 {
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13503 wchar_t pCurrentDir[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13504 _wgetcwd(pCurrentDir, 1024);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13505
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13506 wchar_t pMM6IniFile[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13507 wsprintf(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13508
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13509 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13510 if (bNoCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13511 bCanLoadFromCD = false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13512 if (bCanLoadFromCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13513 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13514 if (!FindMM7CD(hWnd, &cMM7GameCDDriveLetter))
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13515 return false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13516 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13517
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13518
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 srand(GetTickCount());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 /*GetDiskFreeSpaceA(0, &SectorsPerCluster, &BytesPerSector, &hdc, &TotalNumberOfClusters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 v4 = hdc * BytesPerSector * SectorsPerCluster;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 if ( (unsigned int)v4 < 0x1E00000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 "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
13528 (unsigned int)v4 / 1024i64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 v41 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 v40 = "More Hard Drive Space Required";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 v39 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 WNDCLASSEXW wcxw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 wcxw.cbSize = sizeof(wcxw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 wcxw.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 wcxw.lpfnWndProc = (WNDPROC)aWinProc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 wcxw.cbClsExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 wcxw.cbWndExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 wcxw.hInstance = GetModuleHandleW(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 wcxw.hCursor = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 wcxw.hIcon = wcxw.hIconSm = LoadIconW(wcxw.hInstance, L"MM7_ICON");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 wcxw.lpszMenuName = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 wcxw.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13546 wcxw.lpszClassName = L"M&MTrilogy";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 if (!RegisterClassExW(&wcxw))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 Log::Warning(L"Cannot register window class");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 auto hDesktopDC = GetDC(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 uint uDesktopWidth = GetDeviceCaps(hDesktopDC, HORZRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 uint uDesktopHeight = GetDeviceCaps(hDesktopDC, VERTRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 if (GetDeviceCaps(hDesktopDC, BITSPIXEL) != 16 ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 GetDeviceCaps(hDesktopDC, PLANES) != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 dword_6BE364_game_settings_1 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 ReleaseDC(nullptr, hDesktopDC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 uint uTotalWinWidth = 2 * GetSystemMetrics(SM_CXFRAME) + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 uint uTotalWinHeight = GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYFRAME) + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 uint uWinCenteredPosX = (uDesktopWidth - uTotalWinWidth) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 uint uWinCenteredPosY = (uDesktopHeight - uTotalWinHeight) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 uWindowX = ReadWindowsRegistryInt("window X", uWinCenteredPosX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 uWindowX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 WriteWindowsRegistryInt("window X", uWindowX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 uWindowY = ReadWindowsRegistryInt("window Y", uWinCenteredPosY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 uWindowY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 WriteWindowsRegistryInt("window Y", uWindowY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 hWnd = CreateWindowExW(0, wcxw.lpszClassName, L"Might and Magic® VII",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 uWindowStyle = WS_SYSMENU | WS_GROUP | WS_DLGFRAME | WS_BORDER,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 640, 480,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 hOSMenu = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 wcxw.hInstance,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 nullptr);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13587 SetWindowTextW(hWnd, L"Might and Magic® VII");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 pRenderer = Render::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 if (!pRenderer)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 Log::Warning(L"Render creation failed");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 if (!pRenderer->Initialize(bWindowMode, uDefaultDevice, bColoredLights, uLevelOfDetail, bTinting))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 Log::Warning(L"Render failed to initialize");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 pAllocator = Allocator::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 if (!pAllocator->Initialize(26 * 1024))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 L"Unable to Allocate 26Mb of RAM",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 L"More RAM Memory Required", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 pParty = new Party;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 pParty->sEyelevel = pParty->uDefaultEyelevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 bUseRegistry = GetPrivateProfileIntW(L"settings", L"registry", 1, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 MM6_Initialize(pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 pKeyActionMap = new KeyboardActionMapping;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 pEventTimer = Timer::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 pEventTimer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 OnTimer(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 GameUI_StatusBar_UpdateTimedString(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 pGame = Game::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 pMouse = pGame->pMouseInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 RECT rcWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 GetWindowRect(hWnd, &rcWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 RECT rcClient;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 GetClientRect(hWnd, &rcClient);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 uWindowWidth = rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 uWindowHeight = rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 MoveWindow(hWnd, uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 ShowWindow(hWnd, SW_SHOWNORMAL);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13654
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 pIcons_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 if (!pIcons_LOD->LoadIconsOrEvents("data\\icons.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 pIcons_LOD->dword_011BA4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 pEvents_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 if (!pEvents_LOD->LoadIconsOrEvents("data\\events.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 InitializeGameText();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 pBitmaps_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 if (!pBitmaps_LOD->LoadBitmaps("data\\bitmaps.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 bUseLoResSprites = ReadWindowsRegistryInt("resolution", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 bUseLoResSprites = GetPrivateProfileIntW(L"settings", L"resolution", 0, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 const char *pSpritesFile = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 if (bUseLoResSprites)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 pSpritesFile = "data\\spriteLO.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 pSpritesFile = "data\\sprites.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 pSprites_LOD = new LODFile_Sprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 if (!pSprites_LOD->LoadSprites(pSpritesFile))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 if (!pSpriteFrameTable->FromFileTxt("data\\sft.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 Abortf("Unable to open sft.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 if (!pDecorationList->FromFileTxt("data\\declist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 Abortf("Unable to open declist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 if (!pObjectList->FromFileTxt("data\\objlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 Abortf("Unable to open objlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 if (!pMonsterList->FromFileTxt("data\\monlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 Abortf("Unable to open monlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 if (!pIconsFrameTable->FromFileTxt("data\\ift.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 Abortf("Unable to open ift.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 if (!pTextureFrameTable->FromFileTxt("data\\tft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 Abortf("Unable to open tft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 if (!pTileTable->FromFileTxt("data\\tile.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 Abortf("Unable to open tile.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 if (!pPlayerFrameTable->FromFileTxt("data\\pft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 Abortf("Unable to open pft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 if (!pChestList->FromFileTxt("data\\chest.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 Abortf("Unable to open chest.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 if (!pOverlayList->FromFileTxt("data\\overlay.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 Abortf("Unable to open overlay.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 if (!pSoundList->FromFileTxt("data\\sounds.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 Abortf("Unable to open sounds.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 auto pSFT = pEvents_LOD->LoadRaw("dsft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 pSpriteFrameTable->FromFile(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 free(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 auto pTFT = pEvents_LOD->LoadRaw("dtft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 pTextureFrameTable->FromFile(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 free(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 auto pTiles = pEvents_LOD->LoadRaw("dtile.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 pTileTable->FromFile(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 free(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 auto pPFT = pEvents_LOD->LoadRaw("dpft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 pPlayerFrameTable->FromFile(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 free(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 auto pIFT = pEvents_LOD->LoadRaw("dift.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 pIconsFrameTable->FromFile(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 free(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 auto pDecs = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 pDecorationList->FromFile(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 free(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 auto pObjs = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 pObjectList->FromFile(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 free(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 auto pMons = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 pMonsterList->FromFile(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 free(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 auto pChests = pEvents_LOD->LoadRaw("dchest.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 pChestList->FromFile(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 free(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 auto pOverlays = pEvents_LOD->LoadRaw("doverlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 pOverlayList->FromFile(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 free(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 auto pSounds = pEvents_LOD->LoadRaw("dsounds.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 pSoundList->FromFile(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 free(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 pSpriteFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 pDecorationList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 pObjectList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 pMonsterList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 pIconsFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 pTextureFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 pTileTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 pPlayerFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 pChestList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 pOverlayList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 pSoundList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 // color depth != 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 // or
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 // not in window
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 SetMenu(hWnd, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 SetWindowLongA(hWnd, GWL_EXSTYLE, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 pRenderer->InitializeFullscreen(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 ClipCursor(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 pRenderer->SwitchToWindow(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 uSoundVolumeMultiplier = ReadWindowsRegistryInt("soundflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13845 if (uSoundVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 uSoundVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 uMusicVolimeMultiplier = ReadWindowsRegistryInt("musicflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13848 if (uMusicVolimeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 uMusicVolimeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 uVoicesVolumeMultiplier = ReadWindowsRegistryInt("CharVoices", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13851 if (uVoicesVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 uVoicesVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 byte_6BE388_graphicsmode = ReadWindowsRegistryInt("graphicsmode", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 if (byte_6BE388_graphicsmode < 0 || byte_6BE388_graphicsmode > 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 byte_6BE388_graphicsmode = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 uGammaPos = ReadWindowsRegistryInt("GammaPos", 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 if (uGammaPos < 0 || uGammaPos > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 uGammaPos = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 if ( ReadWindowsRegistryInt("Bloodsplats", 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 pGame->uFlags2 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 pGame->uFlags2 &= 0xFFFFFFDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 dword_6BE384_2dacceloff = ReadWindowsRegistryInt("2dacceloff", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13871 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 pAudioPlayer->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 pVideoPlayer = new VideoPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 pVideoPlayer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13877 dword_6BE364_game_settings_1 |= 0x4000;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 switch ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 uTurnSpeed = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 uTurnSpeed = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 uTurnSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 }
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13898 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 //----- (00465D0B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 void __cdecl SecondaryInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 __int16 v4; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910 int v7; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 ObjectDesc *v8; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912 char pContainer[32]; // [sp+10h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 pMouse->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 CreateAsyncMouse();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 CreateAsyncKeyboard();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 pItemsTable = new ItemsTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 pItemsTable->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 pBitmaps_LOD->dword_011BA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
90
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13925 pPaletteManager->pPalette_mistColor[0] = 128;
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13926 pPaletteManager->pPalette_mistColor[1] = 128;
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13927 pPaletteManager->pPalette_mistColor[2] = 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 pSprites_LOD->field_ECAC = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 pObjectList->InitializeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 pOverlayList->InitializeSprites();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13932 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 pSoundList->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 static const char *pUIAnimNames[4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 "glow03", "glow05",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 "torchA", "wizeyeA"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 static unsigned short _4E98D0[4][4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 {479, 0, 329, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13943 {585, 0, 332, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 {468, 0, 0, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 {606, 0, 0, 0}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 for (uint i = 0; i < 4; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 pUIAnims[i]->uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 pUIAnims[i]->uAnimTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 pUIAnims[i]->x = _4E98D0[i][0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 pUIAnims[i]->y = _4E98D0[i][2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 if ( (signed int)pObjectList->uNumObjects > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 BYTE3(v7) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 v8 = &pObjectList->pObjects[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 *(short *)((char *)&v7 + 1) = v8->uParticleTrailColorR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 LOBYTE(v7) = v8->uParticleTrailColorG;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 v8->uParticleTrailColor = v8->uParticleTrailColorB | (v7 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 while ( v5 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 flt_6BE3A0 = 0.55000001f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 MainMenuUI_Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 pGame->pStru6Instance->LoadAnimations();
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13979
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13980 for (uint i = 0; i < 7; ++i)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13981 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13982 sprintf(pContainer, "HDWTR%03u", i);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13983 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(pContainer);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13984 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 pNPCStats = new NPCStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 pNPCStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 Initialize_GlobalEVT();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 pBitmaps_LOD->dword_11B80 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 if ( pBitmaps_LOD->dword_11B84 < (signed int)pBitmaps_LOD->uNumLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 pSprites_LOD->field_ECA4 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 if ( pSprites_LOD->field_ECA0 < (signed int)pSprites_LOD->uNumLoadedSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 pPaletteManager->LockAll();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13997
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 _mkdir("Saves");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13999 for (uint i = 0; i < 5; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14000 for (uint j = 0; j < 6; ++j)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14001 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14002 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14003 remove(pTmpBuf);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14004 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14005 /*do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 while ( v11 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14017 while ( v10 < 5 );*/
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14018
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 Initialize_GamesLOD_NewLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 dword_576E2C = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 dword_576E28 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 bool MM_Main(const wchar_t *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 HWND hPrevWnd; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 HWND hPrevWnd_; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 HWND v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 //bool v9; // edx@16
30
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14040 //OtherOverlay *v10; // esi@44
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14041 //signed int v11; // edi@44
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 unsigned int v12; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 HANDLE v13; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 unsigned int startms; // [sp+8h] [bp-24h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 RECT Rect; // [sp+Ch] [bp-20h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 int a2[4]; // [sp+1Ch] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14048 auto mm7text_dll = LoadLibraryW(L"mm7text.dll");
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14049 sprintfex = (int (__cdecl *)(char *a1, const char *a2, ...))GetProcAddress(mm7text_dll, "_sprintfex");
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14050
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 if (pCmdLine && *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 if (wcsstr(pCmdLine, L"-usedefs"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 bDebugResouces = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 if (wcsstr(pCmdLine, L"-window"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 dword_6BE368_debug_settings_2 |= 1u;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14057
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14058 if (wcsstr(pCmdLine, L"-nointro"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14059 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14060 if (wcsstr(pCmdLine, L"-nologo"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14061 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 if (wcsstr(pCmdLine, L"-nosound"))
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14063 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14064
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14065 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14066 if (wcsstr(pCmdLine, L"-nowalksound"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14067 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 if (wcsstr(pCmdLine, L"-noanim"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 dword_6BE364_game_settings_1 |= 0x40;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14071 bNoVideo = true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14072 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14073 if (wcsstr(pCmdLine, L"-nocd"))
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14074 bNoCD = true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 stru_51076C.registry_debug_flags = ReadWindowsRegistryInt("debug flags", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 v8 = sub_4AC1C9(0, (Vec4_int_ *)a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 Rect.left = *(int *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 Rect.top = *(int *)(v8 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 Rect.right = *(int *)(v8 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 Rect.bottom = *(int *)(v8 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 uCPUSpeed = Rect.bottom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 if (MM7_Initialize())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14089 Log::Warning(L"MM init: ok");
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14090
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 SetWindowPos(hWnd, (HWND)((int)HWND_MESSAGE|0x2), 320, 240, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 Rect.left = 325;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 Rect.top = 245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 Rect.right = 326;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 Rect.bottom = 246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 ClipCursor(&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 SetUserInterface(1, false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 WriteWindowsRegistryInt("Ran once", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 dword_6BE364_game_settings_1 |= 0x4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 pGame->InitializeGammaController();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 SecondaryInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 pRenderer->Clip_v2(0, 0, 639u, 479u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 FinalInitialization();
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14109
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14110 Log::Warning(L"MM: entering main loop");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 MainMenu_Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14118 switch (uGameState)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14119 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14120 case GAME_FINISHED:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 pGame->Deinitialize();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14122 return true;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14123 }
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14124
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14125 if (GetCurrentMenuID() == MENU_FINISHED)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14126 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14127 uGameState = GAME_FINISHED;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14128 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14130 if (GetCurrentMenuID() == MENU_NEWGAME)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 pParty->Reset();
30
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14135
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14136 for (uint k = 0; k < 50; ++k)
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14137 pOtherOverlayList->pOverlays[k].Reset();
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14138
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 strcpy(pCurrentMapName, pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 pParty->CreateDefaultParty(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 PlayerCreationUI_Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 if ( PlayerCreationUI_Loop() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 DeleteCCharFont();
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
14148 bFlashQuestBook = true;
13
17150bdf321e иÑправлено неполное воÑпроизведение роликов, бинков
Серик@ПончиК
parents: 4
diff changeset
14149 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
14150 Autosave();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14153 if (GetCurrentMenuID() == MENU_CREDITS)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14155 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14161 if (GetCurrentMenuID() != MENU_10)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 pMouse->Activate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14164 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 pParty->CreateDefaultParty(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 crt_init_globals_46271C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 extern OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14175 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 _chdir("..\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 strcpy(pCurrentMapName, ofn.lpstrFileTitle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14184 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 pGame->Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 if ( uGameState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 v12 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 goto LABEL_57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 if ( uGameState == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 LABEL_57:
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14201 SetCurrentMenuID((MENU_STATE)v12);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 if ( uGameState == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 extern MENU_STATE __cdecl CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 LABEL_53:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14218 if (!bNoSound && pAudioPlayer->hAILRedbook)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 pAudioPlayer->SetMusicVolume(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 unsigned int end_ms;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 0xEu, &startms, &end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14230 else
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14231 Log::Warning(L"MM init: failed");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 //----- (004637E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 char __cdecl sub_4637E0_is_there_popup_onscreen()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 return dword_507BF0_is_there_popup_onscreen == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 //----- (00465F5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 void __cdecl CreateAsyncMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 if (!pAsyncMouse &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 pRenderer->bUserDirect3D &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 pRenderer->uAcquiredDirect3DDevice == 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 pAsyncMouse = new AsyncMouse(&pRenderer->pDirectDraw4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 //----- (00465FF0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 void __cdecl CreateAsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 if (!pAsyncKeyboard &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 pGame->pKeyboardInstance->bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 pAsyncKeyboard = new AsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 if (pAsyncKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 //----- (00466082) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 void MM6_Initialize(const wchar_t *pIniFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 //int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 UINT v1; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 size_t v2; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 size_t v3; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 size_t v4; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 //char v5[120]; // [sp+Ch] [bp-17Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 //char String[120]; // [sp+84h] [bp-104h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 unsigned int v9; // [sp+184h] [bp-4h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 //_getcwd(v5, 120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 viewparams = new ViewingParams;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 viewparams->uScreenX = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 viewparams->uScreenY = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 viewparams->uScreenZ = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 viewparams->uScreenW = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 pAudioPlayer = new AudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 if ( pAudioPlayer->uMixerChannels > 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 pAudioPlayer->uMixerChannels = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14306
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 dword_6BE368_debug_settings_2 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 v1 = ReadWindowsRegistryInt("startinwindow", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 v1 = GetPrivateProfileIntW(L"debug", L"startinwindow", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 if (v1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 dword_6BE368_debug_settings_2 |= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 dword_6BE368_debug_settings_2 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 dword_6BE368_debug_settings_2 |= 0x10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 dword_6BE368_debug_settings_2 |= 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 wchar_t pStartingMapNameW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 sprintf(pStartingMapName, "%S", pStartingMapNameW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 if ( strlen(pStartingMapName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 if ( pStartingMapName[v9] == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 pStartingMapName[v9] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 v2 = strlen(pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 while ( v9 < v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 pOutdoorCamera = new OutdoorCamera;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 outdoor_day_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.r", 81, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 outdoor_day_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.g", 121, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 outdoor_day_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.b", 236, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 outdoor_day_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.r", 153, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 outdoor_day_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.g", 193, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 outdoor_day_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.b", 237, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 outdoor_night_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.r", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 outdoor_night_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.g", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 outdoor_night_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.b", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 outdoor_night_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.r", 11, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 outdoor_night_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.g", 41, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 outdoor_night_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.b", 129, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 pOutdoorCamera->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 pOutdoorCamera->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 pOutdoorCamera->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 pOutdoorCamera->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 pOutdoorCamera->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 pOutdoorCamera->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 mipmapping_terrain_mm1 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm1", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 mipmapping_terrain_mm2 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm2", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 mipmapping_terrain_mm3 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm3", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 mipmapping_building_mm1 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm1", 1024, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 mipmapping_building_mm2 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm2", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 pOutdoorCamera->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 wchar_t pDefaultSkyTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 wchar_t pDefaultGroundTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 wchar_t pFloat[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 if ( strlen(pDefaultSkyTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 if ( pDefaultSkyTexture[v3] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 pDefaultSkyTexture[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 while ( v3 < strlen(pDefaultSkyTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 if ( strlen(pDefaultGroundTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 if ( pDefaultGroundTexture[v4] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 pDefaultGroundTexture[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 while ( v4 < strlen(pDefaultGroundTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 texmapping_terrain_subdivsize = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivsize", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 texmapping_terrain_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivpow2", 4, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 texmapping_building_subdivsize = GetPrivateProfileIntW(L"texmapping", L"building_subdivsize", 32, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 texmapping_building_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"building_subdivpow2", 5, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 //----- (004666D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 void __cdecl MM7Initialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 if ( !byte_6BE388_graphicsmode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 outdoor_grid_band_1 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 outdoor_grid_band_2 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 outdoor_grid_band_3 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 pOutdoorCamera->shading_dist_mist = 8192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 pOutdoorCamera->bNoSky = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 mipmapping_terrain_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 mipmapping_terrain_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 mipmapping_building_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 mipmapping_building_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 pOutdoorCamera->shading_dist_shade = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 pOutdoorCamera->terrain_gamma = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 pOutdoorCamera->building_gamme = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 mipmapping_terrain_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 mipmapping_building_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 pOutdoorCamera->shading_dist_shademist = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 pOutdoorCamera->outdoor_no_wavy_water = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 sub_47F4D3(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 viewparams->uSomeY = viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 viewparams->uSomeX = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 viewparams->uSomeZ = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 viewparams->uSomeW = viewparams->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 pViewport->SetScreen(viewparams->uScreenX, viewparams->uScreenY, viewparams->uScreenZ, viewparams->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 //----- (00466B8C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 int __cdecl AbortWithError()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 if ( !aborting_app )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 aborting_app = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 SaveGame(1, 0); // "Internal Error"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 // "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
14474 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 // 720018: using guessed type int aborting_app;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 //----- (00466BE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 void Abortf(const char *Format, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 va_list va; // [sp+8h] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 va_start(va, Format);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 vsprintf(pTmpBuf, Format, va);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 pMouse->Activate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 MessageBoxA(0, pTmpBuf, "Error", 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 //----- (00466C40) --------------------------------------------------------
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14497 const wchar_t *MENU_STATE_to_string(MENU_STATE m)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14498 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14499 switch (m)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14500 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14501 case -1: return L"-1";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14502 case MENU_MAIN: return L"MENU_MAIN";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14503 case MENU_NEWGAME: return L"MENU_NEWGAME";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14504 case MENU_CREDITS: return L"MENU_CREDITS";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14505 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14506 case MENU_FINISHED: return L"MENU_FINISHED";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14507 case MENU_5: return L"MENU_5";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14508 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14509 case MENU_7: return L"MENU_7";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14510 case MENU_Credits: return L"MENU_Credits";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14511 case MENU_LOAD: return L"MENU_LOAD";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14512 case MENU_10: return L"MENU_10";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14513 default: return L"unk";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14514 };
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14515 };
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14516 void SetCurrentMenuID(MENU_STATE uMenu)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14517 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14518 if ((int)uCurrentMenuID != -1)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14519 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14520 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14523 uCurrentMenuID = uMenu;
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14524
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14525 Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 //----- (00466CA0) --------------------------------------------------------
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14529 MENU_STATE GetCurrentMenuID()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 return uCurrentMenuID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 if ( v4 > -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 switch ( v4 + 2005532212 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 v7 = "DDERR_SURFACENOTATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 v7 = "DDERR_TOOBIGHEIGHT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 v7 = "DDERR_TOOBIGSIZE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 v7 = "DDERR_TOOBIGWIDTH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 case 50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 v7 = "DDERR_UNSUPPORTEDFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 case 60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 v7 = "DDERR_UNSUPPORTEDMASK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 case 61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 v7 = "DDERR_INVALIDSTREAM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 case 77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 v7 = "DDERR_VERTICALBLANKINPROGRESS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 case 80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 v7 = "DDERR_WASSTILLDRAWING";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 case 100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 v7 = "DDERR_XALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 v7 = "DDERR_INVALIDDIRECTDRAWGUID";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 v7 = "DDERR_DIRECTDRAWALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 v7 = "DDERR_NODIRECTDRAWHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 v7 = "DDERR_PRIMARYSURFACEALREADYEXISTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 case 105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 v7 = "DDERR_NOEMULATION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 case 106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 v7 = "DDERR_REGIONTOOSMALL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 case 107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 v7 = "DDERR_CLIPPERISUSINGHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 case 108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 v7 = "DDERR_NOCLIPPERATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 case 109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 v7 = "DDERR_NOHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 case 110:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 v7 = "DDERR_HWNDSUBCLASSED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 case 111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 v7 = "DDERR_HWNDALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 case 112:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 v7 = "DDERR_NOPALETTEATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 case 113:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 v7 = "DDERR_NOPALETTEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 case 114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 v7 = "DDERR_BLTFASTCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 case 115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 v7 = "DDERR_NOBLTHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 case 116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 v7 = "DDERR_NODDROPSHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 case 117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 v7 = "DDERR_OVERLAYNOTVISIBLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 case 118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 v7 = "DDERR_NOOVERLAYDEST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 case 119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 v7 = "DDERR_INVALIDPOSITION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 case 120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 v7 = "DDERR_NOTAOVERLAYSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 case 121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 v7 = "DDERR_EXCLUSIVEMODEALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 case 122:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 v7 = "DDERR_NOTFLIPPABLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 case 123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 v7 = "DDERR_CANTDUPLICATE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 case 125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 v7 = "DDERR_CANTCREATEDC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 case 126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 v7 = "DDERR_NODC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 case 127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 v7 = "DDERR_WRONGMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 case 128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 v7 = "DDERR_IMPLICITLYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 case 129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 v7 = "DDERR_NOTPALETTIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 case 130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 v7 = "DDERR_UNSUPPORTEDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 case 131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 v7 = "DDERR_NOMIPMAPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 case 132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 v7 = "DDERR_INVALIDSURFACETYPE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 case 140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 v7 = "DDERR_NOOPTIMIZEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 case 141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 v7 = "DDERR_NOTLOADED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 case 142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 v7 = "DDERR_NOFOCUSWINDOW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 case 160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 v7 = "DDERR_DCALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 case 170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 v7 = "DDERR_NONONLOCALVIDMEM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 case 180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 v7 = "DDERR_CANTPAGELOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 case 200:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 v7 = "DDERR_CANTPAGEUNLOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 v7 = "DDERR_NOTPAGELOCKED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 case 230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 v7 = "DDERR_MOREDATA";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 case 231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 v7 = "DDERR_EXPIRED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 case 235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 v7 = "DDERR_VIDEONOTACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 case 239:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 v7 = "DDERR_DEVICEDOESNTOWNSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 case 124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 if ( v4 != -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 if ( v4 > -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 if ( v4 <= -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 if ( v4 == -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 v7 = "DDERR_NOVSYNCHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 if ( v4 > -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 if ( v4 == -2005532382 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 v7 = "DDERR_NOROTATIONHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 if ( v4 == -2005532362 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 v7 = "DDERR_NOSTRETCHHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 if ( v4 == -2005532356 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 v7 = "DDERR_NOT4BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 if ( v4 == -2005532355 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 v7 = "DDERR_NOT4BITCOLORINDEX";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 if ( v4 == -2005532352 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 v7 = "DDERR_NOT8BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 if ( v4 == -2005532342 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 v7 = "DDERR_NOTEXTUREHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 if ( v4 == -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 v7 = "DDERR_NORASTEROPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 if ( v4 == -2005532442 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 v7 = "DDERR_NOFLIPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 if ( v4 == -2005532432 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 v7 = "DDERR_NOGDI";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 if ( v4 == -2005532422 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 v7 = "DDERR_NOMIRRORHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 if ( v4 == -2005532417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 v7 = "DDERR_NOTFOUND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 if ( v4 == -2005532412 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 v7 = "DDERR_NOOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 if ( v4 == -2005532402 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 v7 = "DDERR_OVERLAPPINGRECTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 if ( v4 <= -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 if ( v4 == -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 v7 = "DDERR_PALETTEBUSY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 if ( v4 == -2005532332 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 v7 = "DDERR_NOZBUFFERHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 if ( v4 == -2005532322 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 v7 = "DDERR_NOZOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 if ( v4 == DDERR_OUTOFCAPS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 v7 = "DDERR_OUTOFCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 if ( v4 == DDERR_OUTOFVIDEOMEMORY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 v7 = "DDERR_OUTOFVIDEOMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 if ( v4 == DDERR_OVERLAYCANTCLIP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 v7 = "DDERR_OVERLAYCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 if ( v4 == DDERR_OVERLAYCOLORKEYONLYONEACTIVE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 v7 = "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 if ( v4 == -2005532272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 v7 = "DDERR_COLORKEYNOTSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 if ( v4 == -2005532262 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 v7 = "DDERR_SURFACEALREADYATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 if ( v4 == -2005532252 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 v7 = "DDERR_SURFACEALREADYDEPENDENT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 if ( v4 != -2005532242 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 if ( v4 == -2005532237 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 v7 = "DDERR_CANTLOCKSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 if ( v4 == -2005532232 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 v7 = "DDERR_SURFACEISOBSCURED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 if ( v4 == -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 v7 = "DDERR_NOEXCLUSIVEMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 if ( v4 <= -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 if ( v4 == -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 v7 = "DDERR_INVALIDCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 if ( v4 > -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 if ( v4 == -2005532652 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 v7 = "DDERR_CANNOTDETACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 if ( v4 == -2005532632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 v7 = "DDERR_CURRENTLYNOTAVAIL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 if ( v4 == -2005532617 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v7 = "DDERR_EXCEPTION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 if ( v4 == -2005532582 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 v7 = "DDERR_HEIGHTALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 if ( v4 == -2005532577 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 v7 = "DDERR_INCOMPATIBLEPRIMARY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 if ( v4 == -2005532572 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 v7 = "DDERR_INVALIDCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 if ( v4 == -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 v7 = "DDERR_CANNOTATTACHSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 if ( v4 == -2147467263 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 v7 = "DDERR_UNSUPPORTED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 if ( v4 == -2147467259 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 v7 = "DDERR_GENERIC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 if ( v4 == -2147221008 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 v7 = "DDERR_NOTINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 if ( v4 == -2147024882 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 v7 = "DDERR_OUTOFMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 if ( v4 == -2147024809 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v7 = "DDERR_INVALIDPARAMS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 if ( v4 == -2005532667 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 v7 = "DDERR_ALREADYINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 LABEL_173:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 v13 = strlen(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 v12 = (char *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 std::stringoperator_assign__const_char_ptr__(&a1, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 pRenderer->field_40110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 v15 = &v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 std::string40E2C8(&v11, Str, (int)((char *)&hr + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 v10 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 Str = (char *)&v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 std::string40E2C8(&v9, "Direct Draw Error", (int)((char *)&a3 + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 LOBYTE(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 CheckHRESULT_stru0::ShowMessageBox(v6, &a1, v9, v10, v11, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 sprintfex(&Src, "Unknown DirectDraw/Direct3D error number %X", v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 v13 = strlen(&Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 v12 = &Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 if ( v4 > -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 if ( v4 == -2005532467 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 v7 = "DDERR_NOCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 if ( v4 == -2005532462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 v7 = "DDERR_NOCOLORCONVHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 if ( v4 == -2005532460 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 v7 = "DDERR_NOCOOPERATIVELEVELSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 if ( v4 == -2005532457 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 v7 = "DDERR_NOCOLORKEY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 if ( v4 == -2005532452 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 v7 = "DDERR_NOCOLORKEYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 if ( v4 == -2005532450 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 v7 = "DDERR_NODIRECTDRAWSUPPORT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 if ( v4 == -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 v7 = "DDERR_NOALPHAHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 if ( v4 == -2005532552 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 v7 = "DDERR_INVALIDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 if ( v4 == -2005532542 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 v7 = "DDERR_INVALIDOBJECT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 if ( v4 == -2005532527 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 v7 = "DDERR_INVALIDPIXELFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 if ( v4 != -2005532522 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 if ( v4 == -2005532512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 v7 = "DDERR_LOCKEDSURFACES";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 if ( v4 == -2005532502 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 v7 = "DDERR_NO3D";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 }*/
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 //----- (00467D5D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 int __thiscall sub_467D5D(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 return *(int *)(_this + 7204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 //----- (00467E7F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 Player *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 int v4; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 ItemGen _this; // [sp+Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 Player *v9; // [sp+30h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 int v10; // [sp+34h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 int *v11; // [sp+38h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 v1 = uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 _this.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
15067 v2 = (unsigned __int8)byte_4E8394[v1 + 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 v3 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 v11 = (int *)((char *)&v3->pEquipment + 4 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 v4 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 v10 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 *(char *)(v5 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 pParty->SetHoldingItem((ItemGen *)(v5 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 v6 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 _this.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 memcpy((void *)(v5 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 *v11 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 v7 = v3->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 if ( (v7 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 pParty->pPickedItem.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 memcpy(&v9->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v9->pInventoryItems[v7]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 *v11 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 //----- (00467F48) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 void __fastcall sub_467F48(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 if ( !ptr_507BC4 && a1 >= 700 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 if ( a1 <= 782 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15109 ptr_507BC4 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)30, v1 - 700, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 // 720980: using guessed type int uTextureID_720980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 //----- (00467F9F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 void __cdecl free_book_subwindow()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 if ( ptr_507BC4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 ptr_507BC4->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 ptr_507BC4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 //----- (00467FB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 char __cdecl sub_467FB6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 char *v1; // ST18_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 unsigned int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 GUIWindow a1; // [sp+Ch] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 memcpy(&a1, ptr_507BC4, sizeof(a1));
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15134 a1.Hint = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 a1.uFrameX = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 a1.uFrameY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 a1.uFrameWidth = 468;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 v0 = pFontSmallnum->CalcTextHeight(pScrolls[(unsigned int)ptr_507BC4->ptr_1C], &a1, 0, 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 + 2 * LOBYTE(pFontCreate->uFontHeight)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 + 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 a1.uFrameHeight = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 if ( (signed int)(v0 + a1.uFrameY) > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 v0 = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 a1.uFrameHeight = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 a1.uFrameW = v0 + a1.uFrameY - 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15149 a1.DrawMessageBox(0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 a1.uFrameX += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 a1.uFrameWidth -= 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 a1.uFrameY += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 a1.uFrameHeight -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 v1 = pItemsTable->pItems[(unsigned int)ptr_507BC4->ptr_1C + 700].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 sprintfex(pTmpBuf, format_4E2D80, v2, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 return a1.DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 LOBYTE(pFontCreate->uFontHeight) - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 pScrolls[(unsigned int)ptr_507BC4->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 //----- (00468F8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 void __cdecl OnPaperdollLeftClick()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 unsigned int v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 unsigned int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 unsigned __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 unsigned int v6; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 unsigned int v8; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 int v9; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 int v10; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 int v11; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 int v12; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 int v13; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 char v14; // zf@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 int v15; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 int v16; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 int v17; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 unsigned int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 unsigned int v19; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 int v20; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 int v21; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 unsigned int v22; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 unsigned int v23; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 int v24; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 unsigned int v26; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 int v27; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 int v28; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 int v29; // esi@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 int v30; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 int v31; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 unsigned int v32; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 unsigned int v33; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 int v34; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 unsigned int v35; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 int v36; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 int v37; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 ItemGen *v38; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 __int16 v39; // dx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 signed int v40; // [sp-1Ch] [bp-68h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 unsigned int v41; // [sp-18h] [bp-64h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 signed int v42; // [sp-14h] [bp-60h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 signed int v43; // [sp-10h] [bp-5Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 int v44; // [sp-Ch] [bp-58h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 unsigned int v45; // [sp-8h] [bp-54h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 int v46; // [sp-4h] [bp-50h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 ItemGen _this; // [sp+Ch] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 unsigned int v48; // [sp+30h] [bp-1Ch]@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 unsigned int v49; // [sp+34h] [bp-18h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 unsigned int v50; // [sp+38h] [bp-14h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 int v51; // [sp+3Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 unsigned int v52; // [sp+40h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 int v53; // [sp+44h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 unsigned int v54; // [sp+48h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 v1 = v0->pEquipment.uMainHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 v2 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 v54 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 v53 = v1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15240 if ( v1 && pItemsTable->pItems[*(int *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uEquipType == 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 v51 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 v4 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 if ( v4 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 if ( (signed int)SkillToMastery(v5) < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 v0->PlaySound(39, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 if ( (v4 == 8 || v4 == 1 || v4 == 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 && v1
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15267 && pItemsTable->pItems[*(int *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uSkillType == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 sub_467E7F_EquipBody(3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 WetsuitOn(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 v6 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 switch ( v52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 sub_467E7F_EquipBody(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 v52 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 v7 = (int)&v0->pEquipment.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 if ( !*(int *)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 v8 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 if ( (v8 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 v7 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 if ( (signed int)v52 > 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 v9 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 pParty->pPickedItem.uBodyAnchor = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 *(&v0->pEquipment.uOffHand + v9) = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 if ( v52 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 v52 = v0->pEquipment.field_3C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 v10 = (int)((char *)v0 + 36 * v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 *(char *)(v10 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 pParty->SetHoldingItem((ItemGen *)(v10 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 _this.uBodyAnchor = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 v11 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 memcpy((void *)(v10 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 v0->pEquipment.field_3C = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 v12 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 *(char *)(v12 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 v13 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 v14 = v51 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 memcpy((void *)(v12 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 v0->pEquipment.uOffHand = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 if ( (v52 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 v17 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 v0->pEquipment.uOffHand = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 v15 = (int)((char *)v0 + 36 * (v53 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 *(char *)(v15 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 v16 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 v0->pEquipment.uOffHand = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 v0->pEquipment.uMainHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 case 0xCu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 && pParty->pPickedItem.uItemID != 64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 && pParty->pPickedItem.uItemID != 65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15394 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 v18 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 v19 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 v18 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 v19 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 v49 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 if ( (signed int)v18 >= 560 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 v20 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 *(char *)(v20 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 v21 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 memcpy((void *)(v20 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421 v0->pEquipment.uOffHand = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 v22 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 v50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 v23 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 if ( (v23 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 v50 = (unsigned int)&v0->pInventoryItems[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 v0->pEquipment.uOffHand = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 if ( v52 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 v22 = *(int *)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 if ( !v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 v26 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 if ( (v26 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451 v50 = (unsigned int)&v0->pInventoryItems[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 v0->pEquipment.uMainHand = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 v24 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 *(char *)(v24 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 pParty->SetHoldingItem((ItemGen *)(v24 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 v25 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 memcpy((void *)(v24 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 v0->pEquipment.uMainHand = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 v50 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 if ( v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 stru_A750F8[uActiveCharacter - 1]._494836(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 *((int *)&pSpellDatas[66].field_8 + v50),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 uActiveCharacter - 1 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 if ( v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 v27 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 *(char *)(v27 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500 pParty->SetHoldingItem((ItemGen *)(v27 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 v28 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 memcpy((void *)(v27 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504 v0->pEquipment.uMainHand = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 if ( (v52 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 v29 = (int)((char *)v0 + 36 * (v54 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 *(char *)(v29 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517 pParty->SetHoldingItem((ItemGen *)(v29 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 v30 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 v0->pEquipment.uMainHand = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 v31 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 v0->pEquipment.uMainHand = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 v0->UseItem_DrinkPotion_etc(uActiveCharacter, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15542 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 v32 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 v33 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 v49 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 v48 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551 v32 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15552 v33 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 v36 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 v37 = (int)((char *)v0 + 36 * v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 v50 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 v38 = (ItemGen *)(v37 + 532);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 v14 = v38->uItemID == 604;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 v52 = pItemsTable->pItems[v38->uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 LABEL_95:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 if ( unk_50C9A0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 v39 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 *((int *)ptr_507BD4->ptr_1C + 3) = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 *((short *)ptr_507BD4->ptr_1C + 3) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 ptr_50C9A4 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 unk_50C9A0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 dword_50C9D4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 dword_50C9D0 = 113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 dword_50C9D8 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 if ( !ptr_50C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 pParty->SetHoldingItem(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 *(&v0->uBirthYear + *(char *)(v50 + 556)) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 v38->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 v35 = v0->pEquipment.uBow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15612 auto _a = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v35 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 pParty->SetHoldingItem(_a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 _a->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 v0->pEquipment.uBow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 //----- (0046A0A1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 int __thiscall UnprojectX(int x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 if ( pRenderer->pRenderD3D )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15632 v1 = pGame->pIndoorCameraD3D->fov;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 //----- (0046A0F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 int __thiscall UnprojectY(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 if ( pRenderer->pRenderD3D )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15653 v1 = pGame->pIndoorCameraD3D->fov;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 return stru_5C6E00->Atan2(_this - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 //----- (0046A14B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 char __cdecl OnPressSpace()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 SHORT v0; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 int *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 char *v2; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 unsigned int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 signed int v4; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 unsigned int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 int v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 int v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 int v8; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 int *v9; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 signed int v10; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 int i; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 int v12; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 int v13; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 int j; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 int v16; // [sp+4h] [bp-1Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 char *v17; // [sp+8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 unsigned int v18; // [sp+Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 int v19; // [sp+10h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 int *v20; // [sp+14h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 int *v21; // [sp+18h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 int v22; // [sp+1Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 v0 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 pGame->_44EB12((v0 & 0x8001) != 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 v1 = (int *)pGame->pVisInstance->get_picked_object_zbuf_val();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 if ( v1 != (int *)-1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 LOBYTE(v1) = DoInteractionWithTopmostZObject((unsigned __int16)v1, (signed int)(unsigned __int16)v1 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 v2 = (char *)v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 v1 = (int *)((char *)v1 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 v3 = 640 * viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 v20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 if ( (signed int)v2 >= (signed int)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 v4 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 v7 = *v1 & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 if ( v4 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 if ( dword_7207F0[v6] == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 v19 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 while ( v6 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 if ( (v7 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 v16 = (unsigned int)v7 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 if ( (signed int)(((unsigned int)*v21 >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 if ( (unsigned int)*v21 > 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 if ( v19 == v22 && v4 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 v8 = *v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 dword_7207EC[v4] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 dword_72065C[v4] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 v1 = v21 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 v21 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 v2 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 v3 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 if ( v22 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 v9 = dword_720660;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 for ( i = v10; i < v22; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 v12 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 v13 = dword_720660[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 if ( v13 < *v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 *v9 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 dword_720660[i] = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 LOBYTE(v1) = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 while ( v10 - 1 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 for ( j = 0; j < v22; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 if ( !(char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 // 72065C: using guessed type int dword_72065C[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 // 7207EC: using guessed type int dword_7207EC[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 //----- (0046A334) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 BLVFace *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 unsigned int v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 unsigned __int16 v6; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 ODMFace *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 LevelDecoration *v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 __int16 v9; // ax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 int v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 int v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 int v12; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 Actor *v13; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 unsigned __int16 v14; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 unsigned __int16 v15; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 const char *v16; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 int v17; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 int v18; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 ItemGen *v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 unsigned int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 int v21; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 std::string v22; // [sp-18h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 const char *v23; // [sp-8h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 int v24; // [sp-4h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 char v25; // [sp+8h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 int v26; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 int a3; // [sp+13h] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 switch ( a1 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 v17 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 v26 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 v18 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 || v17 >= 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 || !pLayingItems[v18].uObjectDescID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 v19 = &pLayingItems[v18].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 v20 = pLayingItems[v18].stru_24.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 if ( pItemsTable->pItems[v20].uEquipType == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 party_finds_gold(v19->uAdditionalValue, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 v21 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 ShowStatusBarString(pTmpBuf2, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 if ( v19->uItemID == 506 )
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
15857 _449B7E_toggle_bit(pParty->_award_bits, 184, 1u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 if ( v19->uItemID == 455 )
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
15859 _449B7E_toggle_bit(pParty->_award_bits, 185, 1u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 if ( !pParty->AddItem(v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 pParty->SetHoldingItem(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 v21 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 LayingItem::_42F933(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 v12 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 v13 = &pActors[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 v14 = v13->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 if ( v14 == 4 || v14 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 if ( v14 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 stru_50C198.LootActor(&pActors[a1 >> 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 if ( !v13->GetActorsRelation(0) && !(BYTE2(v13->uAttributes) & 8) && v13->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 Actor::FaceObject(v12, 4u, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 if ( v13->uNPC_ID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 v15 = pNPCStats->pGroups_copy[v13->uGroup];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 v16 = pNPCStats->pCatchPhrases[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 strcpy(byte_5B0938, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 sub_4451A8_press_any_key(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 v8 = &pLevelDecorations[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 v9 = v8->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 EventProcessor(v9, a1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 LOBYTE(v8->field_2) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 if ( !pLevelDecorations[a1 >> 3].IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 return 1;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
15920 v10 = v8->_idx_in_stru123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 v24 = 1;
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
15922 v11 = stru_5E4C90._decor_events[v10 - 75] + 380;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 _5C3420_pDecoration = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 if ( (a1 & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 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
15932 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 if ( a1 >> 9 >= pOutdoor->uNumBModels
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15937 || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uAttributes) & 0x10)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 || (v6 = v7->sCogTriggeredID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 EventProcessor((signed __int16)v6, v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 v4 = &pIndoor->pFaces[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 v5 = v4->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 if ( !(v5 & 0x2000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 ShowNothingHereStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 return 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15953 if ( pCurrentScreen != 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15959 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 //----- (0046A6AC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 int __fastcall sub_46A6AC(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 unsigned int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 int *v5; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 signed int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 unsigned __int16 v8; // ax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 int i; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 int v11; // [sp+0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 unsigned int v12; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 unsigned int v13; // [sp+8h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 int v14; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 int *v15; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 int v16; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 result = sub_46A7C8(a1, a2, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 v4 = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 v12 = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 v15 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 v13 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 if ( (signed int)v4 < (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 v5 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 v6 = ((v12 - v4 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 if ( (*(char *)v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 if ( *v5 <= a3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 v7 = (signed int)(unsigned __int16)*v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 v8 = pActors[v7].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 if ( v8 != 4 && v8 != 11 && v8 != 17 && v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 for ( i = 0; i < v16; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 if ( *(int *)(v14 + 4 * i) == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 if ( i == v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 if ( i < v11 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 v10 = v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 *(int *)(v14 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 v5 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 v15 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 --v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 result = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 //----- (0046A7C8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 int __fastcall sub_46A7C8(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 unsigned int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 unsigned int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 unsigned int v7; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 unsigned __int16 v8; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 float v9; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 unsigned int v12; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 int v13; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 int v14; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 int v15; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 unsigned int a1a; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 v13 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 v14 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 a1a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 v12 = pRenderer->GetBillboardDrawListSize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 if ( (signed int)v12 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070 v3 = pRenderer->GetParentBillboardID(a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 v4 = pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 if ( (v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 if ( v4 <= (unsigned int)(a3 << 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 v6 = v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 v8 = pActors[v6].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 if ( v8 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 if ( v8 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 if ( v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 if ( v8 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 v9 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 if ( v15 < v14 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 v10 = v15++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 *(int *)(v13 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 ++a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 while ( (signed int)a1a < (signed int)v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 return v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 //----- (0046A89E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 int __fastcall sub_46A89E(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 unsigned int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 unsigned int v10; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 unsigned int v11; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 __int16 v12; // ax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 int v13; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 int v15; // [sp+4h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 int v16; // [sp+8h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 int v17; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 int v18; // [sp+10h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 int v19; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 v16 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 v5 = abs(*((short *)v4 - 17) - pParty->vPosition.x);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16143 v17 = abs(*((short *)v4 - 16) - pParty->vPosition.y);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16144 v18 = abs(*((short *)v4 - 15) - pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 v7 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 v8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 if ( v6 < v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 v9 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 v7 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 if ( v6 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 v10 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 v6 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 v8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 if ( v7 < (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 v7 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 v12 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 if ( *(short *)v4 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 if ( v12 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 if ( v12 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 if ( v12 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 if ( v12 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 v13 = v19++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 *(int *)(v16 + 4 * v13) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 if ( v19 >= v15 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 while ( v3 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 //----- (0046A99B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 int __cdecl sub_46A99B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 signed int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 int *v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 int v7; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 int v8; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 int v9; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 unsigned __int8 v10; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 char v11; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 char v12; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 int *v14; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 signed int v15; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 int i; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 int v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 int v18; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 int v19; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 unsigned int v20; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 BLVFace *v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 unsigned int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 const char *v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 const char *v24; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 LevelDecoration *v25; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 LevelDecoration *v26; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 __int16 v27; // ax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 int v28; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 int v29; // [sp+14h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 int v30; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 signed int v31; // [sp+1Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 int v32; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 v1 = (signed int)(viewparams->uScreenW + viewparams->uScreenY) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 v2 = (signed int)(viewparams->uScreenX + viewparams->uScreenZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 v3 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 v30 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 v28 = v1 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 if ( v1 - 50 >= v1 + 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 v5 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 v29 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 v31 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 v8 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 if ( (unsigned int)*v6 <= 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 while ( v9 < v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 if ( v9 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 if ( v8 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 dword_720020_zvalues[v7] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 dword_7201B0_zvalues[v7] = (unsigned __int16)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 v32 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 if ( v7 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 if ( !v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 v4 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 v5 = v29 + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 v29 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 if ( v30 < v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 if ( !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 if ( !((unsigned __int8)(v11 ^ v12) | v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 v14 = dword_720020_zvalues;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 for ( i = v15; i < v32; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 v17 = dword_720020_zvalues[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 if ( v17 < *v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 dword_720020_zvalues[i] = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 *v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 while ( v15 - 1 < v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 v0 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 if ( v0 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 v19 = dword_720020_zvalues[v18] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 if ( (dword_720020_zvalues[v18] & 7) == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 if ( v20 >= 0x3E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 if ( !(pLayingItems[v20].uAttributes & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 v23 = pLayingItems[v20].stru_24.GetDisplayName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 if ( (dword_720020_zvalues[v18] & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 if ( v20 >= 0xBB8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 v24 = (const char *)&pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 if ( (dword_720020_zvalues[v18] & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 if ( (dword_720020_zvalues[v18] & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 v21 = &pIndoor->pFaces[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 if ( !(BYTE3(v21->uAttributes) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 >= pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 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
16368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 v23 = _444732_GetEventHintString(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 if ( v18 >= v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 v25 = &pLevelDecorations[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 v27 = v25->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 v23 = _444732_GetEventHintString(v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 if ( v25->IsInteractive() )
101
8be5293b6b33 odm loading
Nomad
parents: 97
diff changeset
16392 v24 = pNPCTopics[stru_5E4C90._decor_events[v26->_idx_in_stru123 - 75] + 379].pTopic;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 sub_41C0B8_set_status_string(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 //----- (0046BDA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 unsigned int __cdecl GetGravityStrength()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 v0 = ~LOBYTE(pGame->uFlags2) & 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 LOBYTE(v0) = v0 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 return (unsigned int)v0 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 //----- (0046BDC0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 if ( dword_6BE364_game_settings_1 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 BLV_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 ODM_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 _438F8F_area_of_effect__damage_evaluate();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 //----- (0046BDF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 void __cdecl BLV_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 BLV_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 UpdateActors_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 BLV_UpdateDoors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 //----- (0046BE0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 void __cdecl ODM_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 bool v0; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 int pOut; // [sp+8h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 ODM_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 if ( pParty->vPosition.x < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 || pParty->vPosition.x > 22528
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16455 || pParty->vPosition.y < -22528
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16456 || pParty->vPosition.y > 22528 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16459 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, (char *)&pOut, 32);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 if ( pParty->vPosition.x < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 pParty->vPosition.x = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 if ( pParty->vPosition.x > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 pParty->vPosition.x = 22528;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16466 if ( pParty->vPosition.y < -22528 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16467 pParty->vPosition.y = -22528;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16468 if ( pParty->vPosition.y > 22528 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16469 pParty->vPosition.y = 22528;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 UI_CreateTravelDialogue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 UpdateActors_ODM();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 //----- (0046BEF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 void LayingItem::_46BEF1_apply_spells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 LayingItem *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 __int16 v3; // fps@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 unsigned __int8 v4; // c0@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 unsigned __int8 v5; // c3@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 signed int v6; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 v2 = (char *)&pActors[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 if ( ((Actor *)(v2 - 144))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 //UNDEF(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 if ( !(v4 | v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 if ( stru_50C198.GetMagicalResistance((Actor *)(v2 - 144), 0xAu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 ((SpellBuff *)&v2[16 * v1->field_48 + 68])->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 v1->field_50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 *(v2 - 106) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 while ( v6 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 //----- (0046BFFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 LayingItem *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 ObjectDesc *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 unsigned __int16 v5; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 unsigned __int16 v6; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 signed int v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 unsigned int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 unsigned int v9; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 signed int v10; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 char *v11; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 unsigned __int16 v12; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 unsigned int v14; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 unsigned __int16 v15; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 int v16; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 unsigned int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 __int16 v18; // di@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 signed int v19; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 unsigned __int8 v20; // sf@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 char *v21; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 unsigned __int16 v22; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 unsigned int v23; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 signed int v24; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 char *v25; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 int v26; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 int v27; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 int v28; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 int v29; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 unsigned __int16 v30; // ax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 unsigned int v31; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 int v32; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 unsigned int v33; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 signed int v34; // edx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 char *v35; // ecx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 unsigned __int16 v36; // ax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 int v37; // ST14_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 int v39; // ST10_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 int v40; // ST0C_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 int v41; // edx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 int v42; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 int v43; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 unsigned __int8 v44; // zf@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 int v45; // edx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 unsigned __int16 v46; // ax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 int v47; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 int v48; // edx@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 int v49; // edx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 int v50; // edx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 unsigned int v51; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 signed int v52; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 char *v53; // edx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 unsigned __int16 v54; // ax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 unsigned int v55; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 signed int v56; // ebx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 char *v57; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 unsigned __int16 v58; // ax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 unsigned __int16 v59; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 unsigned int v60; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 signed int v61; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 char *v62; // edx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 unsigned __int16 v63; // ax@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 int v64; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 signed int v65; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 unsigned int v66; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 unsigned __int16 v67; // ax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 unsigned int v68; // ecx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 signed int v69; // ebx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 char *v70; // edx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 unsigned __int16 v71; // ax@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 unsigned int v72; // ebx@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 int v73; // ST14_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 int v74; // ST10_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 int v75; // ebx@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 int v76; // ST0C_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 unsigned __int16 v77; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 int v78; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 char v79; // zf@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 unsigned int v80; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 signed int v81; // edx@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 char *v82; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 unsigned __int16 v83; // ax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 unsigned __int16 v84; // ax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 unsigned int v85; // ecx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 signed int v86; // ebx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 char *v87; // edx@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 unsigned __int16 v88; // ax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 unsigned int v89; // eax@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 int v90; // ST34_4@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 int v91; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 unsigned int v92; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 unsigned int v93; // eax@177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 char *v94; // ecx@178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 unsigned __int16 v95; // ax@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 unsigned __int16 v96; // ax@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 int v97; // eax@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 unsigned __int16 v98; // ax@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 unsigned int v99; // ecx@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 char v100; // ST18_1@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 int v101; // ST14_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 int v102; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 int v103; // ST10_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 int v104; // ST0C_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 unsigned __int16 v105; // ax@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 signed int v106; // eax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 unsigned int v107; // edx@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 signed int v108; // ebx@225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 unsigned int v109; // eax@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 signed int v110; // ebx@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 char *v111; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 unsigned __int16 v112; // ax@238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 unsigned __int16 v113; // si@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 int v114; // eax@242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 int v115; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 signed int v116; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 unsigned __int16 v117; // ax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 unsigned int v118; // ecx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 signed int v119; // ebx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 char *v120; // edx@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 unsigned __int16 v121; // ax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 unsigned int v122; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 char *v123; // edx@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 int v124; // eax@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 int v125; // [sp-20h] [bp-4Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 signed int v126; // [sp-1Ch] [bp-48h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 unsigned int v127; // [sp-18h] [bp-44h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 signed int v128; // [sp-14h] [bp-40h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 signed int v129; // [sp-10h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 int v130; // [sp-Ch] [bp-38h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 unsigned int v131; // [sp-8h] [bp-34h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 char v132; // [sp-8h] [bp-34h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 int v133; // [sp-4h] [bp-30h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 char v134; // [sp-4h] [bp-30h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 signed int v135; // [sp-4h] [bp-30h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 int v136; // [sp+Ch] [bp-20h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 int v137; // [sp+10h] [bp-1Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 signed int v138; // [sp+14h] [bp-18h]@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 signed int v139; // [sp+18h] [bp-14h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 char *v140; // [sp+1Ch] [bp-10h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 signed int v141; // [sp+1Ch] [bp-10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 unsigned int v142; // [sp+1Ch] [bp-10h]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 signed int v143; // [sp+1Ch] [bp-10h]@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 char *v144; // [sp+1Ch] [bp-10h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 signed int v145; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 signed int v146; // [sp+20h] [bp-Ch]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 int v147; // [sp+20h] [bp-Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 signed int v148; // [sp+20h] [bp-Ch]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 int v149; // [sp+20h] [bp-Ch]@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 int v151; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 signed int v152; // [sp+24h] [bp-8h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 unsigned int v153; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 v153 = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 v2 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 v3 = &pObjectList->pObjects[v2->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 v145 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 v151 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 if ( (v2->field_58 & 7) == 3 && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 if ( (a2 & 7) == 4 && (v2->field_58 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 v5 = v2->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 if ( v5 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 v2->uAttributes = v5 & 0xFFFB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 if ( v151 == 6 && (v2->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 v6 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 v7 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 if ( v7 > 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 if ( v7 > 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 if ( v7 > 8090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 if ( v7 == 9010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 if ( v7 != 9040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 if ( v7 != 9080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 LABEL_191:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 v98 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 v99 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 v2->uItemType = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 if ( (signed int)v99 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 v144 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 while ( v98 != *(short *)v144 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 v144 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 if ( v146 >= (signed int)v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 LABEL_195:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 LABEL_172:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 v143 = 17030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 switch ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 case 0x1798u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 v143 = 15040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 case 0xFAAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 v143 = 13010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 case 0x2346u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 v143 = 18030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 v138 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 if ( v6 != 9030 || v2->field_50 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 goto LABEL_246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 if ( !v138 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 v109 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 if ( (signed int)v109 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 LABEL_238:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 v111 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 while ( v2->uItemType != *(short *)v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 ++v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 v111 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 if ( v110 >= (signed int)v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 goto LABEL_238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 v112 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 v2->uObjectDescID = v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 if ( !v112 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 v113 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 if ( v113 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 v114 = (signed __int16)v113 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 v130 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 v115 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 LOBYTE(v115) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 v126 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 v116 = v143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 goto LABEL_269;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 LABEL_246:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 v106 = v145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 v150 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 v139 = v106 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 v137 = v2->field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 v152 = v2->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 v136 = v2->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 if ( v6 == 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 v150 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 if ( v152 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 v150 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 if ( v152 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 v150 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 BYTE2(pActors[v139].uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 if ( v7 == 6040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 v135 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 if ( v7 == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 v135 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 v107 = v136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 LABEL_222:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 if ( v6 != 9030 || v152 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 v108 = v139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 v138 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 if ( v2->uItemType == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
16862 pActors[v108].uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 pActors[v108].UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[v136] + v108 * 836))->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 v152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 v150,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 v2->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 v2->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 v2->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 v135 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 v107 = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 goto LABEL_222;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 if ( v7 == 8090 || v7 == 7030 || v7 == 7090 || v7 == 8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 if ( v7 == 8010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 if ( v151 == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 v93 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 if ( (signed int)v93 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 v94 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 while ( v2->uItemType != *(short *)v94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 v94 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 if ( v52 >= (signed int)v93 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 v79 = v7 == 8030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 if ( v7 == 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 if ( v7 <= 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 if ( v7 != 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 v48 = v7 - 3090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 v49 = v48 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 v50 = v49 - 908;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 v45 = v50 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 goto LABEL_91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 v54 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 v55 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 v2->uItemType = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 LABEL_102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 v57 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 while ( v54 != *(short *)v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 v57 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 if ( v56 >= (signed int)v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 v58 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 v2->uObjectDescID = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 if ( !v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 v15 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 if ( v15 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 v16 = (signed __int16)v15 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 v130 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 v92 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 LABEL_267:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 v124 = 8 * v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 LOBYTE(v124) = v124 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 v126 = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 LABEL_268:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 v116 = word_4EE088_sound_ids[v2->field_48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 LABEL_269:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 v125 = v116 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 v59 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 v60 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 v2->uItemType = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 LABEL_111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 v62 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 while ( v59 != *(short *)v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 v62 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 if ( v61 >= (signed int)v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 goto LABEL_111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 v63 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 v2->uObjectDescID = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 if ( !v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 v44 = v2->field_50 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 v65 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 v65 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 if ( v65 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 v141 = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 v64 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 v2->Create(v64, 0, 1000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 --v141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 while ( v141 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 LABEL_160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 LayingItem::_42F933(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 v67 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 v68 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 v2->uItemType = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 LABEL_128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 v70 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 while ( v67 != *(short *)v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 v70 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 if ( v69 >= (signed int)v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 v71 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 v2->uObjectDescID = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 v132 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 LABEL_132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 v73 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 v74 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 v75 = 8 * v72 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 v2->vVelocity.z = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 v2->vVelocity.y = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 v76 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 v2->vVelocity.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 v2->uSpriteFrameID = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 stru_50FE08.Add(v75, 512, v76, v74, v73, v132, v134);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 v77 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 if ( v77 == (short)v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 v78 = (signed __int16)v77 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 v133 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 v131 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 v130 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 v129 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 v127 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 v126 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 if ( v7 == 4090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 v84 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 v85 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 v2->uItemType = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 LABEL_155:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 v87 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 while ( v84 != *(short *)v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 v87 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 if ( v86 >= (signed int)v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 goto LABEL_155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 v88 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 v2->uObjectDescID = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 if ( !v88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 v142 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 v148 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 pRnd->SetRange(-128, 128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 v90 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 pRnd->SetRange(5, 500);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 v91 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 v2->Create(v90 + v142, 0, v91, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 --v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 while ( v148 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 goto LABEL_160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 if ( v7 == 4092 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 v80 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 v2->uItemType = 4091;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 LABEL_144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 v82 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163 while ( *(short *)v82 != 4091 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17165 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 v82 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 if ( v81 >= (signed int)v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 goto LABEL_144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 v83 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 v2->uObjectDescID = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 v132 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 goto LABEL_132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 if ( v7 == 4100 || v7 == 6010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 v79 = v7 == 6040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 if ( !v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 goto LABEL_172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 if ( v7 == 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 if ( v7 <= 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 if ( v7 == 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 v23 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 if ( (signed int)v23 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 while ( v2->uItemType != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 if ( v24 >= (signed int)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 v22 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 v2->uObjectDescID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 if ( v22 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 v2->vVelocity.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 v2->vVelocity.y = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 v2->vVelocity.x = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 v2->uSpriteFrameID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 switch ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 case 500:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 case 505:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 case 510:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 case 515:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 case 520:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 case 525:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 case 530:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 case 535:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 case 540:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 v8 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 if ( (signed int)v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 v11 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 case 545:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 case 550:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 if ( v2->stru_24.uItemID != 405 && v2->stru_24.uAdditionalValue != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 v17 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 v2->uItemType = 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 v21 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 while ( *(short *)v21 != 600 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 v21 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 if ( v19 >= (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 v22 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 while ( v2->uItemType != *(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17284 v11 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 if ( v10 >= (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 v2->uObjectDescID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 v44 = v2->uItemType == 555;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 if ( !v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 if ( v7 > 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 v41 = v7 - 2030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 v42 = v41 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 if ( v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 v43 = v42 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 v45 = v43 - 910;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 LABEL_91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 if ( !v44 && v45 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 v51 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 if ( (signed int)v51 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 v53 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 while ( v2->uItemType != *(short *)v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 v53 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 if ( v52 >= (signed int)v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 v2->uObjectDescID = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 if ( v95 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 v96 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 v2->vVelocity.z = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 v2->vVelocity.y = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 v2->vVelocity.x = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 v2->uSpriteFrameID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 if ( v96 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 v97 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 v97 = (signed __int16)v96 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 v130 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 v92 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 goto LABEL_267;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 if ( v7 == 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 v26 = v7 - 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 v33 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 v2->uItemType = 601;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 v35 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 while ( *(short *)v35 != 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 v35 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 if ( v34 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 v36 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 v2->uObjectDescID = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 if ( !v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 v37 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 v38 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 v39 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 LOBYTE(v38) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 v40 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 v147 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 stru_50FE08.Add(v38, 512, v40, v39, v37, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, 0, v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 v126 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 v27 = v26 - 410;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 v28 = v27 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 goto LABEL_191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 v29 = v28 - 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 if ( v29 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 v30 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 v31 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 v2->uItemType = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 if ( (signed int)v31 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 v140 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 while ( v30 != *(short *)v140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 v140 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 if ( v146 >= (signed int)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 v46 = v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 v2->uObjectDescID = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 if ( v46 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 v100 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 v101 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 v2->uSpriteFrameID = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 v102 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 v103 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 LOBYTE(v102) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 v2->vVelocity.x = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 v2->vVelocity.y = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 v104 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 v2->vVelocity.z = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 v149 = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 array_5118E8._440E91(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 v2->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 v2->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 v2->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 v105 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 if ( v105 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 v47 = (signed __int16)v105 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 v133 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 v131 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 v130 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 v129 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 v127 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 v126 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 if ( v151 == 6 || v151 == 5 || (v9 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 if ( v151 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17493 v122 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 if ( (signed int)v122 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 v123 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 while ( v2->uItemType != *(short *)v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 v123 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 if ( v52 >= (signed int)v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 LABEL_202:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 v95 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 v117 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 v118 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 v2->uItemType = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 v120 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 while ( v117 != *(short *)v120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 v120 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 if ( v119 >= (signed int)v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 v121 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 v2->uObjectDescID = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 if ( !v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 v130 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 v13 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 LOBYTE(v13) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 v125 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558