annotate mm7_2.cpp @ 90:8c6308bb19b3

2.11.12
author Ritor1
date Fri, 02 Nov 2012 00:41:52 +0600
parents f9a33f75bae3
children b5e26a133fae 51a5b0dc3f30 e633cde38d64
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <io.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include <direct.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "GUIButton.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "GUIFont.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 #include "PaletteManager.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 #include "stru287.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 #include "stru157.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 #include "TileFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 #include "PlayerFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 #include "Awards.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 #include "Autonotes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #include "stru160.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #include "FactionTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 #include "StorylineTextTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 #include "Random.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 #include "stru277.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 #include "stru298.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 #include "stru12.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 #include "stru351.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 #include "Events2D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 #include "stru159.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 //----- (004B4F4F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 char *__cdecl sub_4B4F4F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 const char *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 const char *v1; // ST10_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 unsigned __int16 v2; // ST0C_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 GUIWindow v5; // [sp+8h] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 memcpy(&v5, ptr_507BC0, sizeof(v5));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 v0 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 v1 = pGlobalTXT_LocalizationStrings[672];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 v5.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 v5.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v5.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 return v5.DrawText2(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 //----- (004B68EA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 bool __fastcall sub_4B68EA(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 int *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 v2 = &dword_4F0E10[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v3 = 8 * *((char *)v2 + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v3])) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 if ( v1 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 //----- (004B7911) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 void __cdecl sub_4B7911()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 int v1; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 int v2; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 GUIFont *v3; // ST20_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 int v4; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 MonsterInfo *v5; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 unsigned int v6; // ST20_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 char *v7; // ST1C_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 unsigned int v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 int v9; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 char *v10; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 signed int v11; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 signed int i; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 GUIWindow *v14; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 __int64 v15; // qax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 signed int v16; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 int v17; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 unsigned __int8 v18; // sf@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 char **v19; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 GUIButton *v20; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 GUIButton *v21; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 unsigned int v23; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 unsigned __int16 v24; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 GUIWindow a1; // [sp+Ch] [bp-110h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 GUIWindow w; // [sp+60h] [bp-BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 GUIWindow _this; // [sp+B4h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 int v28; // [sp+108h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 int v29; // [sp+10Ch] [bp-10h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 int v30; // [sp+110h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 int v31; // [sp+114h] [bp-8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 _this.DrawText2(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 if ( pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 v11 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 for ( i = 0; i < v11; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 pOutString = (GUIFont *)((char *)pOutString + v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 v29 = (100 - (signed int)pOutString) / v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v16 = v15 - HIDWORD(v15);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
169 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
170 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v17 = (v16 >> 1) - v29 / 2 + 158;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
172 v18 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
173 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v31 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v19 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 v20 = v14->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 v20->uY = v29 + v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v23 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 v21->uHeight = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v17 = v23 + v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 v21->uW = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 v24 = v30;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
189 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 _this.DrawText2(pFontArrus, 0, v23, v24, *v19, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 pOutString = (GUIFont *)((char *)pOutString + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
197 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 if ( dword_F8B19C != 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 if ( dword_F8B19C != 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 if ( ptr_507BC0->field_40 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 sprintfex(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 _this.DrawText2(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 _this.DrawText2(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 v3 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v2 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 if ( v1 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 if ( v1 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 v2 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 if ( v2 > pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 v2 = pParty->uFine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 Party::TakeGold(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 pParty->uFine -= v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 if ( pParty->uFine < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 pParty->uFine = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 if ( ptr_507BC0->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 v5 = &pMonsterStats->pInfos[word_F8B1A0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v7 = v5->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 sprintfex(pTmpBuf, &byte_4F0F98, v8, v7, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 ptr_F8B1E8 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 memcpy(&a1, pDialogueWindow, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 w.uFrameWidth = 458;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 w.uFrameZ = 457;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 if ( 352 - v9 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 352 - v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 (pTex ? pTex->uTextureHeight : 26) - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 // F8B1A0: using guessed type __int16 word_F8B1A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 //----- (004B7D7E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 void __cdecl _4B7D7E_bank()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 GUIWindow *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 int v1; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 unsigned int v3; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 GUIFont *v4; // ST10_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 int v6; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 unsigned int v7; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 unsigned __int16 v8; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 unsigned __int16 v9; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 char *v10; // [sp-8h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 char *v11; // [sp-4h] [bp-6Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 __int16 v13[2]; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 __int16 v14[2]; // [sp+64h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 memcpy(&_this, ptr_507BC0, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 _this.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 _this.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 _this.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 sprintfex(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 _this.DrawText2(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 if ( dword_F8B19C == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 if ( v6 > pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 v7 = pParty->uNumGold;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 pParty->uNumGoldInBank += v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 pPlayers[uActiveCharacter]->PlaySound(81, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 v0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 if ( v1 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v10 = pGlobalTXT_LocalizationStrings[60];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 if ( dword_F8B19C != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 if ( ptr_507BC0->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 v1 = ptr_507BC0->field_40 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 if ( ptr_507BC0->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 ptr_507BC0->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 if ( v2 > pParty->uNumGoldInBank )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 v3 = pParty->uNumGoldInBank;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 Party::SetGold(pParty->uNumGold + v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 pParty->uNumGoldInBank -= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v11 = pGlobalTXT_LocalizationStrings[112];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 v10 = pGlobalTXT_LocalizationStrings[244];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 sprintfex(pTmpBuf, "%s\n%s", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 _this.DrawText2(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 _this.DrawText2(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 v4 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 v8 = v14[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
406 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 v8 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 _this.DrawText2(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 v9 = v14[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
410 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v9 = v13[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 _this.DrawText2(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 //----- (004B8285) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 void __cdecl sub_4B8285_prolly_draw_arcomage_result()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 Player *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 signed int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 signed int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 GUIWindow *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 signed int v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 unsigned int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 int v11; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 unsigned int v12; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 int v14; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 GUIButton *v15; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 GUIButton *v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 int v17; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 char *v18; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 int v19; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 unsigned int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 int v21; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 int v22; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 unsigned __int16 v23; // ax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 int v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 int v25; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 char *v26; // esi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 int v27; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 unsigned int v28; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 unsigned int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int v30; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 signed int v31; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 unsigned int v32; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 GUIWindow *v33; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 int v34; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 int v35; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 int v36; // esi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 char v37; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 GUIButton *v38; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 int v39; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 int v40; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 int v41; // ecx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 int v42; // ecx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 unsigned int v43; // edx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 int v44; // edx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 int v45; // ecx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 int v46; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 int v47; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 signed int v48; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 signed int i; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 int v50; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 GUIWindow *v51; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 _QWORD v52; // qax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 signed int v53; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 int v54; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 GUIButton *v55; // esi@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 const char **v56; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 int v57; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 unsigned int v58; // ecx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 Player *v59; // edx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 unsigned __int16 v60; // ax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 int v61; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 int v62; // edi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 char *v63; // eax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 GUIFont *v64; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 GUIFont *v65; // edi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 unsigned int v66; // [sp-10h] [bp-284h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 int v68; // [sp-Ch] [bp-280h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 char *v69; // [sp-8h] [bp-27Ch]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 int v70; // [sp-8h] [bp-27Ch]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 unsigned int v71; // [sp-4h] [bp-278h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 const char *v72; // [sp-4h] [bp-278h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 unsigned int v73; // [sp-4h] [bp-278h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 char Dest; // [sp+Ch] [bp-268h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 char v75; // [sp+70h] [bp-204h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 char a1; // [sp+D4h] [bp-1A0h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 char v77; // [sp+138h] [bp-13Ch]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 GUIWindow v79; // [sp+1F0h] [bp-84h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 char *Str[2]; // [sp+244h] [bp-30h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 unsigned int v81; // [sp+24Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 unsigned __int8 v82; // [sp+253h] [bp-21h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 int v83; // [sp+254h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 __int16 v84[2]; // [sp+258h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 Player *v85; // [sp+25Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 int v86; // [sp+260h] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 int v89; // [sp+268h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 GUIFont *pOutString; // [sp+270h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 memcpy(&v79, ptr_507BC0, sizeof(v79));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 v85 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 v1 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 v79.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 v79.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 v79.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 v81 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 *(int *)v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 //v2 = p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 v2 = p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 *(float *)&v83 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 *(float *)&v89 = v2 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 v3 = (signed __int64)(*(float *)&v89 * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 v4 = v3 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 if ( v4 < v3 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 v4 = v3 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 pOutString = (GUIFont *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 pOutString = (GUIFont *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 v7 = v6 * (100 - v85->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 if ( v7 < v6 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 v7 = v6 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 v83 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 if ( dword_F8B19C > 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 if ( dword_F8B19C == 102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 v65 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 pOutString = pFontArrus;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
549 strcpy(pTmpBuf, pNPCTopics[354].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 v62 = v65->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 if ( 352 - v62 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 v62 = pFontCreate->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 352 - v62,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 (pTex ? pTex->uTextureHeight : 26) - v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v63 = FitTextInAWindow(pTmpBuf, pOutString, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v64 = pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 if ( dword_F8B19C != 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 if ( dword_F8B19C != 104 || pArcomageGame->bGameInProgress == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 if ( pArcomageGame->uGameResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 if ( pArcomageGame->uGameResult == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 strcpy(pTmpBuf, v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 LABEL_97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 v69 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 v67 = v84[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
599 strcpy(pTmpBuf, pNPCTopics[(uint)ptr_507BC0->ptr_1C + 247].pText);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 v78.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v78.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v62 = v61 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 352 - (v61 + 7),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 (pTex ? pTex->uTextureHeight : 26) - (v61 + 7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 v64 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 ptr_507BC0->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 if ( dword_F8B19C != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 if ( dword_F8B19C == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 if ( pParty->uNumGold >= (unsigned int)pOutString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 Party::TakeGold((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 v27 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 sub_4B1D27();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 pMessageQueue_50CBD0->pMessages[0].param = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 if ( dword_F8B19C != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 v8 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 *(float *)&v89 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v9 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 if ( (signed int)pOutString < v9 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 pOutString = (GUIFont *)(v9 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
665 v10 = v8->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
666 v11 = v10 + v8->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 if ( (signed int)v10 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 v12 = v8->GetControl(v10)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 if ( byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v12] && !v85->pActiveSkills[v12] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 v13 = pFontArrus->CalcTextHeight(pSkillNames[v12], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 v89 += v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
681 while ( (signed int)v10 < v8->pStartingPosActiveItem + v8->pNumPresenceButton );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 if ( v86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 v79.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 pOutString = (GUIFont *)((149 - v89) / v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 if ( (149 - v89) / v86 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 v14 = (149 - v86 * (signed int)pOutString - v89) / 2 - (signed int)pOutString / 2 + 162;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
690 v89 = v8->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 v83 = v14;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
692 if ( v89 < v89 + v8->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 v86 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v15 = v8->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 v16 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 v17 = v15->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 if ( !byte_4ED970_skill_learn_ability_by_class_table[v85->uClass][v17] || v85->pActiveSkills[v17] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 v16->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 v16->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 v16->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 v18 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 v16->uY = (unsigned int)((char *)pOutString + v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 Str[1] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 v19 = pFontArrus->CalcTextHeight(v18, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 v20 = v16->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 v21 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 v16->uHeight = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 v22 = v19 + v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 v16->uW = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 v83 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 v23 = v84[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
719 if ( pDialogueWindow->pCurrentPosActiveItem != v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 v23 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 v79.DrawText2(pFontArrus, 0, v20, v23, Str[1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
723 v24 = v8->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 ++v89;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
725 v25 = v8->pStartingPosActiveItem + v24;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 while ( v89 < v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 v26 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 goto LABEL_97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 *(_QWORD *)Str = pParty->uNumFoodRations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 pPlayers[uActiveCharacter]->PlaySound(67, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 if ( pParty->uNumGold >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 Party::TakeGold(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v28 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
771 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 v28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 sprintfex(&Dest, format_4E2DC8, v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 strcat(&Dest, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 v90 = pFontArrus->CalcTextHeight(&Dest, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 strcat(&Dest, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 v29 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
779 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 v29 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 sprintfex(&a1, format_4E2DC8, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 sprintfex(pTmpBuf2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 pGlobalTXT_LocalizationStrings[86],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 v83);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 strcat(&a1, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 strcat(&a1, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 v30 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
791 if ( pDialogueWindow->pCurrentPosActiveItem != 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 v30 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 sprintfex(&v77, format_4E2DC8, v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 strcat(&v77, pGlobalTXT_LocalizationStrings[160]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 strcat(&v77, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v87 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v31 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 if ( v31 >= 108 && v31 <= 120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 v32 = *(int *)v84;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
803 if ( pDialogueWindow->pCurrentPosActiveItem != 5 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 v32 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 sprintfex(&v75, format_4E2DC8, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 strcat(&v75, pGlobalTXT_LocalizationStrings[611]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 v87 = pFontArrus->CalcTextHeight(&v75, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 v33 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 Str[1] = (char *)pDialogueWindow;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
811 v34 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
812 v35 = v34 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
814 v37 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
815 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 if ( !(v37 ^ __OFSUB__(v34, v35)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 sprintfex(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 v71 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 v69 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v67 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 v66 = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 LABEL_98:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v79.DrawText2(pFontArrus, 0, v66, v67, v69, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 v38 = v33->GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 if ( v38->uControlParam == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 v46 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v38->uHeight = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 v38->uY = 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v41 = v46 + 145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 if ( v38->uControlParam == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 v44 = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 v45 = v90 + v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 v38->uHeight = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v38->uY = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 v41 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 if ( v38->uControlParam == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 if ( v38->uControlParam == 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 v39 = v90 + 3 * v36 + v87 + v88 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v33 = (GUIWindow *)Str[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v40 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 v38->uHeight = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v38->uY = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v41 = v39 + v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 v38->uW = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
861 v47 = v33->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 pOutString = (GUIFont *)((char *)pOutString + 1);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
863 if ( (signed int)pOutString >= v33->pNumPresenceButton + v47 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 v42 = v90 + v88 + 2 * v36 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v43 = v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 v38->uY = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v38->uHeight = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 v41 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 v48 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 pOutString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 if ( pParty->HasItem(0x28Bu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 v48 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 for ( i = 0; i < v48; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v50 = pFontArrus->CalcTextHeight(pShopOptions[i], &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 pOutString = (GUIFont *)((char *)pOutString + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 v86 = (174 - (signed int)pOutString) / v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 v52 = 174 - v48 * (174 - (signed int)pOutString) / v48 - (signed int)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 v53 = v52 - HIDWORD(v52);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
893 LODWORD(v52) = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
894 HIDWORD(v52) = v52 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 v54 = (v53 >> 1) - v86 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
896 v37 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
897 v89 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 if ( v37 ^ __OFSUB__((int)v52, HIDWORD(v52)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 v85 = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 pOutString = (GUIFont *)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v55 = v51->GetControl(v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 v56 = (const char **)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 v55->uY = v86 + v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 v57 = pFontArrus->CalcTextHeight(*v56, &v79, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 v58 = v55->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v59 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 v55->uHeight = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 v54 = v57 + v58 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 v55->uW = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v60 = v84[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
914 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v59 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 v60 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 v79.DrawText2(pFontArrus, 0, v58, v60, *(const char **)&pOutString->cFirstChar, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 v51 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 v85 = (Player *)((char *)v85 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 pOutString = (GUIFont *)((char *)pOutString + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 ++v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
922 while ( v89 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 //----- (004B8E3D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 void *__cdecl GenerateShopItems()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 GUIWindow *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 int v3; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 int v5; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 bool v6; // ebp@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 void *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 signed int v9; // [sp-Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 v2 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 while ( v2 > 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 if ( v2 <= 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 v6 = v1 > 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 v7 = v6 + 2 * v2 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v4 = word_4F0498[5 * v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v5 = *(short *)&aTooManyStation[2 * (5 * (v6 + 2 * v2) + rand() % 4) + 10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 if ( v2 <= 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 v4 = word_4F0576[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 v9 = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 if ( v2 <= 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 if ( v1 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 v4 = word_4F0578[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 v9 = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 v5 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 5] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 _t->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v3 = 5 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v2 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v4 = word_4F03FE[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v5 = word_4F0400[5 * v2 + rand() % 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 result = v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 *(int *)&pParty->field_16154[4 * (int)result] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 //----- (004B910F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 char *__cdecl sub_4B910F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 char *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 signed int v2; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 unsigned int v3; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 ItemGen *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 unsigned __int8 v6; // dl@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 char *v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 int v9; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 int v10; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 signed int v11; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 int v12; // ST08_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 int v14; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 char **v15; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 int v16; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 GUIWindow *v17; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 int v18; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 int v19; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 unsigned __int8 v20; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 GUIButton *v21; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 const char **v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 int v23; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 unsigned int v24; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 unsigned __int16 v26; // ax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 signed int v27; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 int v28; // ST08_4@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 int v29; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 GUIWindow *v30; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 void *v31; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 signed int v32; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 unsigned int v33; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 int v34; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 unsigned int v35; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 int v36; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 __int32 v37; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 GUIButton *v38; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 GUIButton *v39; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 int v40; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 char *v41; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 int v42; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 unsigned int v43; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 const char **v44; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 int v45; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 unsigned __int16 v46; // ax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 int v47; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 const char **v48; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 unsigned int v49; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 Texture *v50; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 int v51; // edi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 int v52; // esi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 Texture *v53; // ST1C_4@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 int v54; // edi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 signed int v55; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 SHORT v56; // di@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 bool v57; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 const char *v58; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 POINT *v59; // esi@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 LONG v60; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 int v61; // eax@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 int v62; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 ItemGen *v63; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 int v64; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 int v65; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 char **v66; // edi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 int v67; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 GUIWindow *v68; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 int v69; // edx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 int v70; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 GUIButton *v71; // esi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 const char **v72; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 int v73; // eax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 unsigned int v74; // ecx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 Player *v75; // edx@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 unsigned __int16 v76; // ax@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 GUIWindow *v77; // [sp-18h] [bp-110h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 int v78; // [sp-14h] [bp-10Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 ItemGen *v79; // [sp-10h] [bp-108h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 int v80; // [sp-10h] [bp-108h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 void *v81; // [sp-Ch] [bp-104h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 int v83; // [sp-8h] [bp-100h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 char *v84; // [sp-8h] [bp-100h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 __int64 *v85; // [sp-4h] [bp-FCh]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 unsigned int v86; // [sp-4h] [bp-FCh]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 POINT v87; // [sp+Ch] [bp-ECh]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 POINT v88; // [sp+14h] [bp-E4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 POINT v89; // [sp+1Ch] [bp-DCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 POINT v90; // [sp+24h] [bp-D4h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 POINT v91; // [sp+2Ch] [bp-CCh]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 POINT v92; // [sp+34h] [bp-C4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 POINT v93; // [sp+3Ch] [bp-BCh]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 POINT v94; // [sp+44h] [bp-B4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 POINT v95; // [sp+4Ch] [bp-ACh]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 POINT v96; // [sp+54h] [bp-A4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 POINT v97; // [sp+5Ch] [bp-9Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 POINT a2; // [sp+64h] [bp-94h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 POINT v99; // [sp+6Ch] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 POINT v100; // [sp+74h] [bp-84h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 GUIWindow v101; // [sp+7Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 char *Str; // [sp+D0h] [bp-28h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 __int32 v103; // [sp+D4h] [bp-24h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 int v104; // [sp+D8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 int v105; // [sp+DCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 POINT v106; // [sp+E0h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 Player *_this; // [sp+E8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 int v108; // [sp+ECh] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 const char **v109; // [sp+F0h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 memcpy(&v101, ptr_507BC0, sizeof(v101));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v101.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 v101.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v101.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 v66 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 ++v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 v65 += v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 while ( (signed int)v66 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 v109 = (const char **)((174 - v65) / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1147 result = (char *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1148 v69 = (int)&result[pDialogueWindow->pNumPresenceButton];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1150 v20 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1151 v106.y = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 if ( v20 ^ __OFSUB__((int)result, (int)v69) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 v108 = (int)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 v71 = v68->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 v72 = (const char **)v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 v71->uY = (unsigned int)((char *)v109 + v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 v74 = v71->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 v75 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v71->uHeight = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v70 = v73 + v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v71->uW = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v76 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1168 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v76 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 v101.DrawText2(pFontArrus, 0, v74, v76, *(const char **)v108, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 v68 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 v108 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 ++v106.y;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1175 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 result = (char *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v30 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 v31 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v106.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 v108 = v32 * (100 - _this->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 if ( v108 < v32 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 v108 = v32 / 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1198 v33 = v30->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1199 v34 = v33 + v30->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 if ( (signed int)v33 >= v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 goto LABEL_105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 v35 = v30->GetControl(v33)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v35] && !_this->pActiveSkills[v35] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 v36 = pFontArrus->CalcTextHeight(pSkillNames[v35], &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 v106.y += v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1214 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 LABEL_105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 v7 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 v84 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 v82 = v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 v101.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 v108 = (149 - v106.y) / (signed int)v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 if ( (149 - v106.y) / (signed int)v109 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 v108 = 32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1235 result = (char *)v30->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 v37 = (149 - (signed int)v109 * v108 - v106.y) / 2 - v108 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 v106.y = (LONG)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 v103 = v37;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1239 if ( (signed int)result < (signed int)&result[v30->pNumPresenceButton] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 v109 = (const char **)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 v38 = v30->GetControl(v106.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 v40 = v38->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v40] || _this->pActiveSkills[v40] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 v39->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 v39->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 v39->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 v41 = pSkillNames[v40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 v39->uY = v108 + v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 Str = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 v42 = pFontArrus->CalcTextHeight(v41, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v43 = v39->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 v44 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v39->uHeight = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 v45 = v43 + v42 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v39->uW = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v103 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 v46 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1266 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v44 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 v46 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 v101.DrawText2(pFontArrus, 0, v43, v46, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1270 v47 = v30->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 ++v106.y;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1272 result = (char *)(v30->pNumPresenceButton + v47);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 while ( v106.y < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 v27 = pMouse->GetCursorPos(&v99)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 result = (char *)pMouse->GetCursorPos(&v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 result = (char *)pMouse->GetCursorPos(&v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 result = (char *)(9 * (int)result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 if ( _this->field_1F5[4 * (int)result + 15] & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 v83 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 v81 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1310 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 v28 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 v29 = _this->_490EEE(
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1314 (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5],
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 v28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v5 = (char *)pMerchantsRepairPhrases[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v15 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 v14 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v103 = (174 - v14) / 4;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1348 result = (char *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1349 v18 = (int)&result[pDialogueWindow->pNumPresenceButton];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1351 v20 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1352 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 if ( v20 ^ __OFSUB__((int)result, v18) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 v108 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 v109 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 v21 = v17->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 v22 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 v21->uY = v103 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v24 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v25 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 v21->uHeight = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 v19 = v24 + v23 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 v21->uW = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v26 = v104;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1369 if ( pDialogueWindow->pCurrentPosActiveItem != v25 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 v26 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 v101.DrawText2(pFontArrus, 0, v24, v26, *v109, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 ++v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 _this = (Player *)((char *)_this + 1);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1376 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 while ( (signed int)_this < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 v11 = pMouse->GetCursorPos(&v96)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 result = (char *)pMouse->GetCursorPos(&v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 result = (char *)pMouse->GetCursorPos(&v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 v83 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 v81 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1408 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 v13 = _this->_490EEE(v79, 1, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 v5 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 result = (char *)(dword_F8B19C - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 v2 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 result = (char *)pMouse->GetCursorPos(&v100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 result = (char *)pMouse->GetCursorPos(&v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 v83 = 4;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1445 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1446 if ( !(v4->uAttributes & 1) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 v9 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 v10 = _this->_490EEE(v4, 1, v9, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v5 = (char *)pMerchantsIdentifyPhrases[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 v79 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v6 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 v7 = sub_495461(v5, v6, v79, (char *)v81, v83, v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 v86 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 v84 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v80 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 v78 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v77 = &v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 return v101.DrawText2(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 v49 = word_F8B158[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 v50 = dword_F8B168[(signed int)v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v49 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 v48 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 v48 = (const char **)((char *)v48 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 v109 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 while ( (signed int)v48 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)ptr_507BC0->ptr_1C] + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v52 = word_F8B158[(signed int)v109] + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 v53 = dword_F8B168[(signed int)v109];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 sub_40F92A(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 dword_F8B168[(signed int)v109],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 (int)((char *)v109 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 v109 = (const char **)((char *)v109 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 v108 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 while ( (signed int)v109 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 v106.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 ++v106.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 while ( v55 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v56 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v57 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 Str = (char *)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 if ( v56 && v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 v58 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v58 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 v58 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 sub_4B46A5(v58, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 if ( v106.x )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 v59 = pMouse->GetCursorPos(&v91);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v106.x = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v61 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v62 = 9 * (v60 + 12 * v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v63 = (ItemGen *)&pParty->field_777C[v62];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 if ( !v56 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v110 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v64 = _this->_490EEE(v63, 1, v61, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 v6 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v5 = (char *)pMerchantsBuyPhrases[v64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 v5 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 v83 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v81 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v79 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 result = v101._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 //----- (004B9CC6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 POINT *__cdecl sub_4B9CC6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 POINT *result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 GUIWindow *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 unsigned int v3; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 void *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 signed int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 unsigned int v6; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 unsigned int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 int v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 GUIButton *v11; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 GUIButton *v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 char *v14; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 unsigned int v16; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 int v17; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 int v18; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 unsigned __int16 v19; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 int v20; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 char *v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 int v22; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 char **v23; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 int v24; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 GUIWindow *v25; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 int v26; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 int v27; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 unsigned __int8 v28; // sf@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 GUIButton *v29; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 const char **v30; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 int v31; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 unsigned int v32; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 Player *v33; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 int v34; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 unsigned __int16 v35; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 signed int v36; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 ItemGen *v37; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 char *v38; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 unsigned __int8 v39; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 int v40; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 int v41; // ST08_4@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 signed int v43; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 int v44; // ST08_4@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 int v45; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 Texture *v46; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 unsigned int v47; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 unsigned int v48; // esi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 int v49; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 Texture *v50; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 unsigned int v51; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 unsigned int v52; // esi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 int v53; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 Texture *v54; // ecx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 unsigned int v55; // edi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 unsigned int v56; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 int v57; // edx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 Texture *v58; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 unsigned int v59; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 unsigned int v60; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 int v61; // edx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 signed int v62; // ecx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 SHORT v63; // di@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 bool v64; // eax@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 const char *v65; // ecx@112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 POINT *v66; // esi@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 int v67; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 int v68; // eax@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 int v69; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 ItemGen *v70; // esi@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 int v71; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 int v72; // edi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 char **v73; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 int v74; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 GUIWindow *v75; // ecx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 int v76; // edx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 int v77; // edi@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 GUIButton *v78; // esi@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 const char **v79; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 int v80; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 unsigned int v81; // ecx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 Player *v82; // edx@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 unsigned __int16 v83; // ax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 GUIWindow *v84; // [sp-18h] [bp-F0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 int v85; // [sp-14h] [bp-ECh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 int v86; // [sp-10h] [bp-E8h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 ItemGen *v87; // [sp-10h] [bp-E8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 void *v89; // [sp-Ch] [bp-E4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 char *v90; // [sp-8h] [bp-E0h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 int v91; // [sp-8h] [bp-E0h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 unsigned int v92; // [sp-4h] [bp-DCh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 __int64 *v93; // [sp-4h] [bp-DCh]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 POINT v94; // [sp+Ch] [bp-CCh]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 POINT v95; // [sp+14h] [bp-C4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 POINT v96; // [sp+1Ch] [bp-BCh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 POINT v97; // [sp+24h] [bp-B4h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 POINT v98; // [sp+2Ch] [bp-ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 POINT v99; // [sp+34h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 POINT v100; // [sp+3Ch] [bp-9Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 POINT v101; // [sp+44h] [bp-94h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 POINT v102; // [sp+4Ch] [bp-8Ch]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 POINT a2; // [sp+54h] [bp-84h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 GUIWindow v104; // [sp+5Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 int v105; // [sp+B0h] [bp-28h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 int v106; // [sp+B4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 char *Str; // [sp+B8h] [bp-20h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 int v108; // [sp+BCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 __int32 v109; // [sp+C0h] [bp-18h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 Player *_this; // [sp+C4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 const char **v111; // [sp+C8h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 unsigned int v112; // [sp+CCh] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 int v114; // [sp+D4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 memcpy(&v104, ptr_507BC0, sizeof(v104));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v104.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 v104.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 v104.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 v73 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 v72 += v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 while ( (signed int)v73 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 Str = (char *)((174 - v72) / 4);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1765 result = (POINT *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1766 v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1768 v28 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1769 v112 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 if ( v28 ^ __OFSUB__((int)result, v76) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 v78 = v75->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 v79 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 v78->uY = (unsigned int)&Str[v77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 v81 = v78->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 v82 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 v78->uHeight = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 v77 = v81 + v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 v78->uW = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 v83 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1786 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 v83 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 v104.DrawText2(pFontArrus, 0, v81, v83, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 v75 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1793 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 || (v43 = pMouse->GetCursorPos(&v99)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 result = pMouse->GetCursorPos(&v102),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 || (result = pMouse->GetCursorPos(&v100), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 v91 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 v89 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1820 v87 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 v44 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 v45 = _this->_490EEE(v87, 4, v44, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v38 = (char *)pMerchantsSellPhrases[v45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 || (v36 = pMouse->GetCursorPos(&a2)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 result = pMouse->GetCursorPos(&v101),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 result->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 || (result = pMouse->GetCursorPos(&v97), result->x >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 v91 = 4;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1844 v37 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
1845 if ( !(v37->uAttributes & 1) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 v41 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 v42 = _this->_490EEE(v37, 4, v41, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 v38 = (char *)pMerchantsIdentifyPhrases[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 v38 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 v87 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 v39 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 v21 = sub_495461(v38, v39, v87, (char *)v89, v91, v93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 v90 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 v88 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 v86 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v85 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 v23 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 v24 = pFontArrus->CalcTextHeight(*v23, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 v22 += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 while ( (signed int)v23 < (signed int)&pShopOptions[2] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 Str = (char *)((174 - v22) / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 v25 = pDialogueWindow;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1888 result = (POINT *)pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1889 v26 = (int)((char *)result + pDialogueWindow->pNumPresenceButton);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v27 = (2 * (87 - (174 - v22) / 2) - v22) / 2 - (174 - v22) / 2 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1891 v28 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1892 v112 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 if ( v28 ^ __OFSUB__((int)result, v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 v111 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v29 = v25->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v30 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 v29->uY = (unsigned int)&Str[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 v31 = pFontArrus->CalcTextHeight(*v30, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v32 = v29->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v33 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 v29->uHeight = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 v34 = v31 + v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 v29->uW = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v27 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 v35 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1910 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v33 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 v35 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 v104.DrawText2(pFontArrus, 0, v32, v35, *v111, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 v25 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 ++v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1917 result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 result = (POINT *)(dword_F8B19C - 96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( dword_F8B19C != 96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 v2 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 v4 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 v111 = (const char **)(v5 * (100 - _this->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 if ( (signed int)v111 < v5 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 v111 = (const char **)(v5 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1938 v6 = v2->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1939 v7 = v6 + v2->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 if ( (signed int)v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 v8 = v2->GetControl(v6)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v8] && !_this->pActiveSkills[v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 v9 = pFontArrus->CalcTextHeight(pSkillNames[v8], &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 v112 += v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1954 while ( (signed int)v6 < v2->pNumPresenceButton + v2->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 v104.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 v111 = (const char **)((signed int)(149 - v112) / v114);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 if ( (signed int)(149 - v112) / v114 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 v111 = (const char **)32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1962 result = (POINT *)v2->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 v10 = (signed int)(149 - v114 * (int)v111 - v112) / 2 - (signed int)v111 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 v112 = (unsigned int)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 v105 = v10;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1966 if ( (signed int)result < (signed int)((char *)result + v2->pNumPresenceButton) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 v114 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 v11 = v2->GetControl(v112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 v13 = v11->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v13] || _this->pActiveSkills[v13] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 v12->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 v12->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 v12->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v14 = pSkillNames[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 v12->uY = (unsigned int)((char *)v111 + v105);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 Str = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v15 = pFontArrus->CalcTextHeight(v14, &v104, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v16 = v12->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v17 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 v12->uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 v18 = v16 + v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 v12->uW = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 v105 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 v19 = v106;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1993 if ( pDialogueWindow->pCurrentPosActiveItem != v17 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 v19 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v104.DrawText2(pFontArrus, 0, v16, v19, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1997 v20 = v2->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 ++v112;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
1999 result = (POINT *)(v2->pNumPresenceButton + v20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 while ( (signed int)v112 < (signed int)result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 v21 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 v92 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 v90 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 v88 = v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 v84 = &v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 return (POINT *)v104.DrawText2(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 v46 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 v47 = 152 - v46->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 if ( (signed int)v47 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 v49 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 if ( (signed int)v48 > 457 - v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 v48 = 457 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 if ( (signed int)v48 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v48 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 pRenderer->DrawTextureTransparent(v48, v47, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 v50 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 v51 = 308 - v50->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 if ( (signed int)v51 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 v53 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 if ( (signed int)v52 > 457 - v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 v52 = 457 - v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 if ( (signed int)v52 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v52 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 pRenderer->DrawTextureTransparent(v52, v51, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 v54 = dword_F8B168[v114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 v55 = 152 - v54->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 if ( (signed int)v55 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 v57 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 if ( (signed int)v56 > 457 - v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v56 = 457 - v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 if ( (signed int)v56 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v56 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 pRenderer->DrawTextureTransparent(v56, v55, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v114], v114 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 v58 = dword_F8B168[v114 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v59 = 308 - v58->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 if ( (signed int)v59 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 if ( v114 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 v61 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 if ( (signed int)v60 > 457 - v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v60 = 457 - v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 if ( (signed int)v60 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 v60 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 pRenderer->DrawTextureTransparent(v60, v59, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v114 + 6], v114 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 ++v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 while ( v114 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v109 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 ++v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 while ( v62 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 v63 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 v64 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 Str = (char *)v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 if ( v63 && v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 v65 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 v65 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 v65 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 sub_4B46A5(v65, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 if ( !v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 return (POINT *)v104._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 v66 = pMouse->GetCursorPos(&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 v109 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 v68 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 v69 = 9 * (v67 + 12 * v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 v70 = (ItemGen *)&pParty->field_777C[v69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 if ( !v63 || !Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 v113 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 v71 = _this->_490EEE(v70, 4, v68, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v39 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v38 = (char *)pMerchantsBuyPhrases[v71];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v38 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 v91 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v89 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 v87 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 //----- (004BA928) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 void __cdecl sub_4BA928()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 signed int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 unsigned int v2; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 ItemGen *v3; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 unsigned __int8 v4; // dl@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 char *v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 char *v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 int v7; // ST08_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 signed int v9; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 unsigned int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 char *v11; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 int v12; // ST08_4@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 unsigned __int8 v14; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 char *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 char **v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 char **v18; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 int v19; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 GUIWindow *v20; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 int v21; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 int v22; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 int v23; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 unsigned __int8 v24; // sf@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 GUIButton *v25; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 GUIButton *v26; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 int v27; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 unsigned int v28; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 Player *v29; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 unsigned __int16 v30; // ax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 signed int v31; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 unsigned int v32; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 int v33; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 int v34; // ST08_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 int v35; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 char *v36; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 GUIWindow *v37; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 signed int v38; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 unsigned int v39; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 int v40; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 unsigned int v41; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 int v42; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 int v43; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 GUIButton *v44; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 GUIButton *v45; // esi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 int v46; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 char *v47; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 int v48; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 unsigned int v49; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 int v50; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 int v51; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 unsigned __int16 v52; // ax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 int v53; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 int v54; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 signed int v55; // ebx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 Texture *v56; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 unsigned int v57; // edi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 Texture *v58; // ST1C_4@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 int v59; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 int v60; // edi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 signed int v61; // ebx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 Texture *v62; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 int v63; // edi@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 Texture *v64; // ST1C_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 unsigned int v65; // ST18_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 int v66; // eax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 int v67; // edi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 signed int v68; // ecx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 SHORT v69; // bx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 bool v70; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 const char *v71; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 void *v72; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 POINT *v73; // esi@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 int v74; // ecx@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 int v75; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 int v76; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 ItemGen *v77; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 unsigned __int8 v78; // bl@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 char **v79; // edi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 int v80; // ebx@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 char **v81; // esi@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 int v82; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 GUIWindow *v83; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 int v84; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 int v85; // edx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 int v86; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 GUIButton *v87; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 GUIButton *v88; // esi@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 int v89; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 unsigned int v90; // ecx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 int v91; // edx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 unsigned __int16 v92; // ax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 signed int v93; // edx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 POINT *v94; // edi@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 __int32 v95; // ecx@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 void *v96; // ST14_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 unsigned __int8 v97; // bl@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 ItemGen *v98; // ST10_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 int v99; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 char *v100; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 const char *v101; // ST18_4@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 unsigned __int16 v102; // ST14_2@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 int v103; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 signed int v104; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 Texture *v105; // eax@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 int v106; // ebx@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 Texture *v107; // ST1C_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 unsigned int v108; // ST18_4@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 int v109; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 int v110; // ebx@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 unsigned int v112; // [sp-14h] [bp-118h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 int v113; // [sp-14h] [bp-118h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 ItemGen *v114; // [sp-10h] [bp-114h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 unsigned int v115; // [sp-10h] [bp-114h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 ItemGen *v116; // [sp-10h] [bp-114h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 int v117; // [sp-10h] [bp-114h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 void *v118; // [sp-Ch] [bp-110h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 void *v120; // [sp-Ch] [bp-110h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 char *v121; // [sp-8h] [bp-10Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 int v122; // [sp-8h] [bp-10Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 unsigned int v123; // [sp-4h] [bp-108h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 __int64 *v124; // [sp-4h] [bp-108h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 int v125; // [sp-4h] [bp-108h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v126; // [sp-4h] [bp-108h]@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 int v127; // [sp-4h] [bp-108h]@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 POINT v128; // [sp+Ch] [bp-F8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 POINT v129; // [sp+14h] [bp-F0h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 char v130; // [sp+1Ch] [bp-E8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 POINT a2; // [sp+24h] [bp-E0h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 POINT v132; // [sp+2Ch] [bp-D8h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 POINT v133; // [sp+34h] [bp-D0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 char v134; // [sp+3Ch] [bp-C8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 POINT v135; // [sp+44h] [bp-C0h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 POINT v136; // [sp+4Ch] [bp-B8h]@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 POINT v137; // [sp+54h] [bp-B0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 POINT v138; // [sp+5Ch] [bp-A8h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 POINT v139; // [sp+64h] [bp-A0h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 POINT v140; // [sp+6Ch] [bp-98h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 POINT v141; // [sp+74h] [bp-90h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 POINT v142; // [sp+7Ch] [bp-88h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 POINT v143; // [sp+84h] [bp-80h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 GUIWindow v144; // [sp+8Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 char *Str; // [sp+E0h] [bp-24h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 int v146; // [sp+E4h] [bp-20h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 int v147; // [sp+E8h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 int v148; // [sp+ECh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 __int32 v149; // [sp+F0h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 Player *_this; // [sp+F4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 int v152; // [sp+FCh] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 int v153; // [sp+100h] [bp-4h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 memcpy(&v144, ptr_507BC0, sizeof(v144));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 v144.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 v144.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 v144.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 if ( dword_F8B19C == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 sub_4B46A5(pGlobalTXT_LocalizationStrings[195], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 v149 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 v93 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 ++v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 while ( v93 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 if ( v149 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 v94 = pMouse->GetCursorPos(&v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 v95 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 if ( v149 && v149 != -65536 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 --v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 v96 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 v97 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 v99 = _this->_490EEE(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 (int)ptr_507BC0->ptr_1C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 v100 = sub_495461((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 v101 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 v102 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 v144.DrawText2(pFontArrus, 0, (174 - v103) / 2 + 138, v102, v101, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 v104 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 v105 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 if ( v104 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, dword_F8B168[v104]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 v109 = v153 + v110 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 v106 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v107 = dword_F8B168[v104];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 v108 = 98 - v105->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v127 = v104 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 v109 = v152 + v153 + 640 * v106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], dword_F8B168[v104], v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 ++v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 while ( v104 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 v79 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 v81 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 v82 = pFontArrus->CalcTextHeight(*v81, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 v80 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 while ( (signed int)v81 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 v152 = (174 - v80) / 3;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2489 v84 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2490 v85 = v84 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 v86 = (3 * (58 - v152) - v80) / 2 - v152 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2492 v24 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2493 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 if ( v24 ^ __OFSUB__(v84, v85) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 v87 = v83->GetControl((unsigned int)_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 v88 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 v87->uY = v152 + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 v89 = pFontArrus->CalcTextHeight(*v79, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 v90 = v88->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 v91 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 v88->uHeight = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 v86 = v90 + v89 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 v88->uW = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 v92 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2509 if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 v92 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 v144.DrawText2(pFontArrus, 0, v90, v92, *v79, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 v83 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2517 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 v152 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 v37 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 v38 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 if ( (signed int)_this < v38 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 _this = (Player *)(v38 / 3);
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2532 v39 = v37->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2533 v40 = v37->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 if ( (signed int)v39 < (signed int)(v39 + v40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 v41 = v37->GetControl(v39)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v41] && !v0->pActiveSkills[v41] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 v152 += v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2548 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 if ( v153 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 v144.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 _this = (Player *)((149 - v152) / v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 if ( (149 - v152) / v153 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 _this = (Player *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2557 v152 = v37->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 v146 = v43;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2559 if ( v152 < v152 + v37->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v153 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 v44 = v37->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v45 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 v46 = v44->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v46] || v0->pActiveSkills[v46] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 v45->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 v45->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 v45->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v47 = pSkillNames[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 v45->uY = (unsigned int)((char *)_this + v146);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 Str = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v48 = pFontArrus->CalcTextHeight(v47, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v49 = v45->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 v50 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 v45->uHeight = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 v51 = v49 + v48 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v45->uW = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v146 = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 v52 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2586 if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v52 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 v144.DrawText2(pFontArrus, 0, v49, v52, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2590 v53 = v37->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 ++v152;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2592 v54 = v37->pNumPresenceButton + v53;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 ++v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 while ( v152 < v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 v36 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 v121 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v119 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 v113 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v115 = (174 - pFontArrus->CalcTextHeight(v36, v111, v113, v117)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 v112 = (unsigned int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v144.DrawText2(pFontArrus, v112, v115, v119, v121, v123);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 v56 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 if ( v55 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v60 = 90 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 0x7Eu, dword_F8B168[v55]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v59 = v60 + v153 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v57 = 98 - v56->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v58 = dword_F8B168[v55];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v152 = 86 - ((signed int)v56->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 pRenderer->DrawTextureTransparent(v153 + v152, v57, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 v125 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v59 = v153 + v152 + 640 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], dword_F8B168[v55], v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 while ( v55 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 v153 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 v62 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 if ( v61 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, dword_F8B168[v61]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 v66 = v153 + v67 + 80220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 v63 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 v64 = dword_F8B168[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 v65 = 98 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v126 = v61 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 v66 = v152 + v153 + 640 * v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], dword_F8B168[v61], v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 v153 += 105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 while ( v61 < 8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 v149 = (__int32)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 ++v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 while ( v68 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v69 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 v70 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 Str = (char *)v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 if ( v69 == (short)v11 || (char *)v70 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 v71 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 v71 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 v71 = pGlobalTXT_LocalizationStrings[185];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 sub_4B46A5(v71, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 if ( (char *)v149 != v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 v73 = pMouse->GetCursorPos(&v136);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 if ( !v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v149 = v74 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 v75 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 v76 = 9 * (v74 - 1 + 12 * v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v77 = (ItemGen *)&pParty->field_777C[v76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 v77 = (ItemGen *)&pParty->field_C59C[v76 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 if ( v69 == (short)v11 || Str == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 v78 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v14 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 v124 = (__int64 *)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 v120 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 v116 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v15 = pGlobalTXT_LocalizationStrings[181];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v14 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 v36 = sub_495461(v15, v14, v116, (char *)v120, v122, v124);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 v121 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 v117 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 v113 = (int)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 v111 = &v144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 v72 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 v144._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 || (v31 = pMouse->GetCursorPos(&v135)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 pMouse->GetCursorPos(&v140)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 || pMouse->GetCursorPos(&v138)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 v122 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 v120 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2791 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 v34 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 uPlayerID = uActiveCharacter - 1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2794 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 v15 = (char *)pMerchantsRepairPhrases[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 v16 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 v18 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v19 = pFontArrus->CalcTextHeight(*v18, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 v17 += v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 while ( (signed int)v18 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 v146 = (174 - v17) / 4;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2819 v21 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2820 v22 = v21 + pDialogueWindow->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 v23 = (174 - 4 * (174 - v17) / 4 - v17) / 2 - (174 - v17) / 4 / 2 + 138;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2822 v24 = -pDialogueWindow->pNumPresenceButton < 0;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2823 v152 = pDialogueWindow->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 if ( v24 ^ __OFSUB__(v21, v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 _this = (Player *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v25 = v20->GetControl(v152);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 v25->uY = v146 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v28 = v26->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v29 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v26->uHeight = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v23 = v28 + v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v26->uW = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 v30 = v147;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2839 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 v30 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 v144.DrawText2(pFontArrus, 0, v28, v30, *v16, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 _this = (Player *)((char *)_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 ++v152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
2847 while ( v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 || (v9 = pMouse->GetCursorPos(&v139)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 pMouse->GetCursorPos(&v137)->x <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 || pMouse->GetCursorPos(&v129)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 v122 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 v120 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2869 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v10 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v13 = v0->_490EEE(v116, 2, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v14 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 v15 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 if ( pMouse->GetCursorPos(&v141)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 if ( pMouse->GetCursorPos(&v143)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2893 v3 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
2894 if ( v3->uAttributes & 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 v4 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 v5 = "%24";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 v118 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 v114 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 v7 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v8 = v0->_490EEE(v3, 2, v7, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v4 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 v5 = (char *)pMerchantsIdentifyPhrases[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v6 = sub_495461(v5, v4, v114, (char *)v118, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 v123 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 v121 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v119 = v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 v115 = (174 - pFontArrus->CalcTextHeight(v6, &v144, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 //----- (004BB756) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 signed int __fastcall sub_4BB756(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 unsigned int v1; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 unsigned int v3; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 char *v4; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 int v5; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 int v6; // ST38_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 char *v7; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 int v8; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 int v9; // ST30_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 int v10; // ST44_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 int v11; // ST48_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 int v12; // ST4C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 int v13; // ST50_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 int v14; // ST3C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 int v15; // ST40_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 int v16; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 int v17; // ST38_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 Player *v18; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 int v19; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 SoundID v21; // [sp-20h] [bp-54h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 signed int v22; // [sp-1Ch] [bp-50h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 unsigned int v23; // [sp-18h] [bp-4Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 signed int v24; // [sp-14h] [bp-48h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 signed int v25; // [sp-10h] [bp-44h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 int v26; // [sp-10h] [bp-44h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 int v27; // [sp-Ch] [bp-40h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 unsigned int v28; // [sp-Ch] [bp-40h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 unsigned int v29; // [sp-8h] [bp-3Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 __int16 v30; // [sp-8h] [bp-3Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 int v31; // [sp-4h] [bp-38h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 int v32; // [sp-4h] [bp-38h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 if ( a1 > 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 if ( a1 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 if ( a1 == 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 dword_50C9DC = 195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 ptr_50C9E0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 if ( a1 == 42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 v26 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 if ( a1 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 if ( a1 != 52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 v28 = 133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 v26 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 _42777D_CastSpell_UseWand_ShootArrow(v26, 0, v28, v30, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 pParty->pPartyBuffs[18].Apply(pParty->uTimePlayed + 46080, 3u, 0, v20, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 pParty->pPartyBuffs[18].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 v21 = (SoundID)12040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 pAudioPlayer->PlaySound(v21, v22, v23, v24, v25, v27, v29, v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 if ( a1 == 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 v21 = (SoundID)203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 pParty->pPartyBuffs[7].Apply(pParty->uTimePlayed + 30720, 3u, 1u, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 pParty->pPartyBuffs[7].uFlags |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 v24 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 v21 = (SoundID)11090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 if ( a1 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 v18 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 v18->sHealth = v18->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 while ( (signed int)v18 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 if ( a1 == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 v7 = (char *)&pParty->pPlayers[0].pConditions[15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 v8 = *((int *)v7 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 v9 = *((int *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 v10 = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 v11 = *((int *)v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 v12 = *((int *)v7 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 v13 = *((int *)v7 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 v14 = *((int *)v7 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 v15 = *((int *)v7 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 v16 = *((int *)v7 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 v17 = *((int *)v7 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 memset(v7 - 120, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 *((int *)v7 + 2) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 *((int *)v7 + 3) = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 *(int *)v7 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 *((int *)v7 + 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 *((int *)v7 - 1) = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 *((int *)v7 + 8) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 *((int *)v7 + 9) = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 *((int *)v7 + 4) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 *((int *)v7 - 2) = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 *((int *)v7 + 5) = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 *((int *)v7 + 1585) = ((Player *)(v7 - 120))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 v7 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 while ( (signed int)v7 < (signed int)&pParty->pHirelings[1].evtb );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 if ( a1 == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 v4 = (char *)&pParty->pPlayers[0].pActiveSkills[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 v5 = *((int *)v4 - 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 v6 = *((int *)v4 - 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 memset(v4 - 280, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 *(int *)v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 *((int *)v4 + 1) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 *((int *)v4 + 1545) = ((Player *)(v4 - 280))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 v4 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 while ( (signed int)v4 < (signed int)&pParty->field_777C[22] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 if ( a1 == 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 Party::GiveFood(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 if ( pParty->uNumFoodRations > v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 pParty->uNumFoodRations = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 if ( a1 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 v1 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 if ( pParty->uNumFoodRations >= 0xE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 // 50C9DC: using guessed type int dword_50C9DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 //----- (004BBA85) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3135 const char *sub_4BBA85_bounties()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 signed __int64 v1; // qax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 int i; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 int v4; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 __int16 v5; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 char v6; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 Player *v7; // ebx@16
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3145 const char *result; // eax@19
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 uDialogueType = 83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3149 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 471u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 pGlobalTXT_LocalizationStrings[34],// "Cancel"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3161 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3163 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3164 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 pDialogueWindow->_41D08F(1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 v0 = (int)((char *)ptr_507BC0->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v0 + 1], pParty->field_3C.field_0[2 * v0]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 pParty->field_75A[v0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v1 = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 pParty->field_3C.field_0[2 * v0] = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 pParty->field_3C.field_0[2 * v0 + 1] = HIDWORD(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 for ( i = rand(); ; i = rand() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 v3 = i % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 pParty->field_750[v0] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 if ( (unsigned __int16)v3 < 0x73u || (unsigned __int16)v3 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 if ( ((unsigned __int16)v3 < 0xEBu || (unsigned __int16)v3 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 && ((unsigned __int16)v3 < 0x85u || (unsigned __int16)v3 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 && ((unsigned __int16)v3 < 0x97u || (unsigned __int16)v3 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 && ((unsigned __int16)v3 < 0xC4u || (unsigned __int16)v3 > 0xC6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 v4 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 v5 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 v6 = pParty->field_75A[v4] == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 word_F8B1A0 = pParty->field_750[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v6 = v5 == 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3196 result = pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 if ( v6 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3198 result = pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v5].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 v7 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 v7->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 while ( (signed int)v7 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v4]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 pParty->field_750[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 pParty->field_75A[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3216 result = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 dword_F8B1A4 = (char *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 //----- (004BBCDD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 void __cdecl sub_4BBCDD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 signed int v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 __int16 v2; // cx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 int v3; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 Player *v4; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 GUIButton *v5; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 GUIButton *v6; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 size_t v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 if ( pParty->field_7B5_in_arena_quest )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 if ( pParty->field_7B5_in_arena_quest == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 uDialogueType = 92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 v1 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 v2 = *(short *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 if ( *(short *)v1 == 5 || v2 == 11 || v2 == 19 || (v3 = *((int *)v1 + 159)) != 0 && (v3 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 v1 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 if ( v0 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 uDialogueType = 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 v4 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 ++*((char *)&pParty->field_75A[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 while ( (signed int)v4 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 party_finds_gold(dword_F8B1B4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 pParty->field_7B5_in_arena_quest = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 uDialogueType = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 pParty->vPosition.x = 3849;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3276 pParty->vPosition.y = 5770;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3277 pParty->vPosition.z = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 uDialogueType = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 v5 = pDialogueWindow->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 v6 = v5->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 pAllocator->FreeChunk(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 pDialogueWindow->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 pDialogueWindow->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 pDialogueWindow->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 pGlobalTXT_LocalizationStrings[79],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3316 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x55u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3317 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x56u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3318 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x57u, 0, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3319 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, 0x88u, 0x58u, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 pDialogueWindow->_41D08F(4, 1, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 // F8B1B4: using guessed type int dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 //----- (004BBF61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 size_t v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 int monster_id; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 __int16 v6; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 Actor *v7; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 MonsterInfo *v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 MonsterDesc *v10; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 unsigned __int16 *v11; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 int v12; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 int v13; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 __int16 x_; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 __int16 v15; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 __int16 v16; // [sp+10h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 signed int ya; // [sp+1Ch] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 monster_id = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 v15 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 if ( (signed int)uNumActors < 500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 && ((signed int)pAllocator->uBigBufferSizeAligned >> 10) - ((signed int)pAllocator->uNextFreeOffsetInBigBuffer >> 10) >= 2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 v6 = pIndoor->GetSector(x, y, z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 v4 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 v16 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v7 = &pActors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 v7->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v8 = monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v9 = &pMonsterStats->pInfos[monster_id];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 v10 = &pMonsterList->pMonsters[v8 - 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 strcpy(v7->pActorName, v9->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v7->sCurrentHP = LOWORD(v9->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 memcpy(&v7->pMonsterInfo, v9, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v7->word_000086_some_monster_id = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v7->uActorRadius = v10->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 v7->uActorHeight = v10->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 v7->uMovementSpeed = v10->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 v7->vInitialPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v7->vPosition.x = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 BYTE2(v7->uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v7->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v7->pMonsterInfo.uTreasureLevel = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v7->pMonsterInfo.uTreasureDiceSides = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v7->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v7->pMonsterInfo.uTreasureDropChance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v7->vInitialPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v7->vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 v7->vInitialPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v7->vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v7->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v7->uSectorID = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v7->uGroup = 1;
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
3384 v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v7->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v11 = v10->pSoundSampleIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 ya = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 pSoundList->_4A9A67((signed __int16)*v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 --ya;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 while ( ya );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 LOWORD(v13) = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 //----- (004BC109) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 void __cdecl ArenaFight()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 char *v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 Player *v2; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 int v3; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 signed int v4; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 signed __int64 v5; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 signed int v6; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 char *v7; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 int v8; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 int v9; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 int v10; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 unsigned __int8 v11; // sf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 unsigned __int8 v12; // of@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 signed int v13; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 int v14; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 int v15; // edx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 int v16; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 signed int v17; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 int v18; // edx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 int i; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 int monster_y; // ST18_4@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 int v21; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 signed int v22; // [sp-4h] [bp-144h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 __int16 v23[100]; // [sp+Ch] [bp-134h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 GUIWindow window; // [sp+D4h] [bp-6Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 int v26; // [sp+134h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 int v27; // [sp+138h] [bp-8h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 int num_monsters; // [sp+13Ch] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 pParty->field_7B5_in_arena_quest = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 memcpy(&window, pDialogueWindow, sizeof(window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 window.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 window.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
3443 pRenderer->BeginSceneD3D();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 if ( pRenderer->pRenderD3D )
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 49
diff changeset
3453 pRenderer->FillRectFast(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 pViewport->uViewportZ - pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 pViewport->uViewportW - pViewport->uViewportY + 1,
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 49
diff changeset
3458 pRenderer->uTargetGMask | pRenderer->uTargetBMask);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 352 - v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 pTex,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 (pTex ? pTex->uTextureHeight : 26) - v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 pParty->vPosition.x = 3849;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3473 pParty->vPosition.y = 5770;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3474 pParty->vPosition.z = 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 pParty->uFallStartY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 v2 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v3 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 if ( v3 > v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v26 = v2->GetActualLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 v4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 while ( (signed int)v2 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 num_monsters = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 v5 = (signed __int64)((double)v26 * 1.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 LODWORD(v5) = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 num_monsters = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 v4 /= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 num_monsters = 2 * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 if ( v4 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 if ( v4 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 if ( num_monsters > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 num_monsters = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 if ( v4 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 if ( num_monsters < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 num_monsters = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 v7 = (char *)&pMonsterStats->pInfos[1].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 if ( v7[8] != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 if ( !MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 v8 = (unsigned __int8)*v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 if ( v8 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 if ( v8 <= num_monsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 v23[v6++] = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 v7 += 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 num_monsters = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 if ( v6 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 num_monsters = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 if ( num_monsters > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 v12 = __OFSUB__(v9, num_monsters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 v11 = v9 - num_monsters < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 *((short *)&window.pControlsTail + v9 + 1) = v23[v10 % v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 while ( v11 ^ v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 if ( uDialogueType == 85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 v17 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v22 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 if ( uDialogueType == 86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 v17 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 v22 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 v18 = v16 % v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 v14 = v18 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 if ( uDialogueType == 87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 v15 = rand() % 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 v13 = 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 v14 = v15 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 if ( uDialogueType == 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 v13 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 v14 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v13 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 for ( dword_F8B1B4 = v26 * v13; i < v14; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 monster_y = pMonsterArenaPlacements[i].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 v21 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 _4BBF61_summon_actor((unsigned __int16)monster_ids[v21 % num_monsters], pMonsterArenaPlacements[i].x, monster_y, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 //----- (004BC8D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 Texture *__cdecl sub_4BC8D5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 GUIWindow *v5; // ebp@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 Texture *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 int v7; // [sp+10h] [bp-4h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 v0 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 v1 = (char *)ptr_507BC0->ptr_1C - 139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 if ( v3 < 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 if ( v3 <= 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 v0 = rand() % word_4F0F30[(signed int)v1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 + 345;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 if ( v3 == 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 v4 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 if ( v3 == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 v4 = rand() % 3 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 if ( v3 != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 v4 = rand() % 2 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 if ( v0 == 487 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 v0 = 486;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 v5 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 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
3680 _u->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 *(&dword_F8B164 + v2) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 while ( v2 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 //----- (004BCA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 GUIButton *__cdecl sub_4BCA33()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3695 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 pGlobalTXT_LocalizationStrings[74],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3709 return pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 //----- (004BCACC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 void __fastcall sub_4BCACC_bounties(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 signed int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 Player *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 signed int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 GUIWindow *v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 unsigned int v9; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 int v10; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 int v11; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 int v12; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 __int16 v13; // bp@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 int v14; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 GUIWindow *v15; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 int v16; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 int v17; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 __int16 v20; // ax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 __int16 v21; // ax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 __int16 v22; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 __int16 v23; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 __int16 v24; // ax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 int v25; // esi@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 __int16 v26; // ax@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 char v27; // zf@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 Player *v28; // edi@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 int v29; // eax@204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 void *v30; // esi@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 unsigned __int64 v31; // qax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 signed int v32; // edi@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 int v33; // eax@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 unsigned int v34; // eax@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 Player *v35; // edi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 signed int v36; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 int v37; // ecx@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 int v38; // esi@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 int v39; // edx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 void *v40; // edi@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 unsigned __int64 v41; // qax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 void *v42; // eax@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 signed int v43; // edi@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 int v44; // edx@244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 int v45; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 unsigned int v46; // eax@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 void *v47; // eax@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 signed int v48; // edi@250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 int v49; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 int v50; // eax@256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 unsigned int v51; // eax@257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 void *v52; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 signed int v53; // edi@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 int v54; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 signed int v55; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 int v56; // [sp+14h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 v55 = a1;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
3775 if ( !pDialogueWindow->pNumPresenceButton )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 if ( v2 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v6 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v7 = v6->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v4 += v5++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 while ( v5 < v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 && (signed __int64)v6->uExperience < 1000 * v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 && (v1 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 + pParty->uDaysPlayed % 7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 || dword_F8B198 != 23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 || v55 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3811 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 ptr_5076F4 = pDialogueWindow->CreateButton(
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3813 526,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3814 445,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3815 75,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
3816 33,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 v1);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3825 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 if ( uActiveCharacter != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 dword_F8B19C = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 if ( v3 < 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 v9 = pIcons_LOD->LoadTexture((&off_4F03B8)[4 * v3], TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 dword_F8B164 = &pIcons_LOD->pTextures[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 if ( v3 > 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 if ( v3 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 if ( v3 != 23 && v3 != 30 )
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 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 if ( v3 != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 if ( v3 <= (signed int)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 if ( v3 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 if ( v3 <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 if ( v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 v34 = pIcons_LOD->LoadTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 pItemsTable->pItems[v33].pIconName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 while ( v32 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 sub_4BC8D5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 v31 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 + (signed __int64)((double)(0xA8C000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 if ( v3 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 if ( v55 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 v10 = (int)((char *)v8->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 v56 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 v11 = 8 * v10 + 11325428;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 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
3910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 pParty->field_75A[v12] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 *(_QWORD *)v11 = (signed __int64)((double)(309657600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v14 = rand() % 258;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v15 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 pParty->field_750[v12] = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v16 = (int)((char *)v15->ptr_1C - 102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 v18 = v17 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 v20 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 v21 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 v22 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 v23 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 v24 = pParty->field_750[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 pParty->field_750[v12] = rand() % 258 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 v10 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 v25 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 v26 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 v27 = pParty->field_75A[v25] == v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 word_F8B1A0 = pParty->field_750[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 v27 = v26 == v13;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4078 v29 = (int)pNPCTopics[351].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 if ( v27 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4080 v29 = (int)pNPCTopics[353].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 dword_F8B1A4 = (char *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 if ( v26 != v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 v28 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 v28->SetVariable(VAR_Award, 86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 while ( (signed int)v28 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 pParty->field_750[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 pParty->field_75A[v25] = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 v1 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4100 dword_F8B1A4 = pNPCTopics[352].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 if ( v55 == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 pKeyActionMap->_459E5A(1, 10, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 if ( v55 > 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 switch ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 case 96:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4118 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 sub_4B3703((void *)dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 case 101:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4123 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 dword_F8B19C = 102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 dword_F8B19C = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 dword_F8B19C = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 if ( v55 != 95 && v55 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 if ( v55 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 dword_F8B19C = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 if ( v55 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 dword_F8B19C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 if ( v55 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 if ( v55 > 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 if ( v55 <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 v35 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 if ( v37 < v36 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 v37 = v36 / 3;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4172
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4173 __debugbreak();
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4174 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4175 // or
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4176 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4177 // or
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4178 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4179
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4180 if (false)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4181 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 v38 = (int)(&v35->uIntelligence + v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 if ( !*(short *)v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 if ( pParty->uNumGold < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 if ( dword_F8B198 == 30 || dword_F8B198 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 v39 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 v39 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 Party::TakeGold(v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 *(short *)v38 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 v35->PlaySound(78, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 if ( v55 == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4209 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 dword_F8B19C = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 sub_421B2C_PlaceInInventory_or_DropPickedItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 if ( (signed __int64)__PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 GenerateShopItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 sub_4B8F94();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 v40 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 v41 = pParty->uTimePlayed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 pParty->field_3C.field_50[2 * (int)v40] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 if ( v55 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 //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
4261 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 v49 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 v47 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 //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
4282 while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 if ( _4F063C_smthn_by_2da_uType[v44] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 v3 = dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 v42 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 //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
4304 while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 v54 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 v8 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 v52 = v8->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 //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
4325 while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 //----- (004BD8B5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 signed int __cdecl sub_4BD8B5()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 int v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 int v1; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 unsigned int v2; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 const char *v3; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 pKeyActionMap->_459ED1(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 if ( array_5913D8[6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 if ( dword_F8B19C != 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 && dword_F8B19C != 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 && dword_F8B19C != 97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 && dword_F8B19C != 5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 && dword_F8B19C != 4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 && dword_F8B164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 dword_F8B164->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 v0 = dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 dword_F8B164 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 if ( v0 && v0 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 if ( v0 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 _4B4224_UpdateNPCTopics((int)((char *)array_5913D8[6] - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 if ( v0 != 94 && v0 != 96 && v0 != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 if ( v0 == 3 || v0 == 5 || v0 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 dword_F8B19C = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 sub_4B3AD4(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 if ( v0 != 102 && v0 != 103 && v0 != 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 sub_4B3B42(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 dword_F8B19C = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 sub_4B3A72(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 sub_4BCA33();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 if ( uNumDialogueNPCPortraits != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 ptr_5076F4 = ptr_507BC0->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 if ( uNumDialogueNPCPortraits > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 v3 = byte_591180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 *(&_4E5E50_transui_x + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 *(&_4E5EE0_transui_y + v2 + 6 * v1 - 6),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 0x3Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 0x49u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 0x19Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 v2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 v1 = uNumDialogueNPCPortraits;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 v3 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 while ( (signed int)v2 < uNumDialogueNPCPortraits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 //----- (004BDB56) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 void __cdecl sub_4BDB56_buy_skill____()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 Player *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 signed int v1; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 unsigned int v2; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 int v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 float v4; // ST1C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 signed int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 signed int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 char v7; // zf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 const char *v9; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 signed int v10; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 unsigned int v11; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 int v12; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 void *v13; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 signed int v14; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 unsigned int v15; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 GUIWindow *v16; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 POINT *v17; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 int v18; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 void *v19; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 ItemGen *v20; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 float v21; // ST1C_4@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 signed int v22; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 int v23; // ebx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 int v24; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 int v26; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 Player *v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 POINT *v28; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 int v29; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 void *v30; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 int v31; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 ItemGen *v32; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 float v33; // ST1C_4@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 signed int v34; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 int v35; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 bool v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 unsigned int v37; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 int v38; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 int v39; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 int v40; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 int v41; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 int v42; // esi@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 signed int v43; // ebx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 int v44; // ecx@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 unsigned __int16 *pSkill; // esi@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 signed int v46; // [sp-18h] [bp-CCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 unsigned int v47; // [sp-14h] [bp-C8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 signed int v48; // [sp-10h] [bp-C4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 signed int v49; // [sp-Ch] [bp-C0h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 int v50; // [sp-8h] [bp-BCh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 int v51; // [sp-4h] [bp-B8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 unsigned int v52; // [sp-4h] [bp-B8h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 int v53; // [sp+0h] [bp-B4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 unsigned int v54; // [sp+0h] [bp-B4h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 int v55; // [sp+0h] [bp-B4h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 int v56; // [sp+0h] [bp-B4h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 POINT v57; // [sp+10h] [bp-A4h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 POINT v58; // [sp+18h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 POINT v59; // [sp+20h] [bp-94h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 POINT v60; // [sp+28h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 POINT v61; // [sp+30h] [bp-84h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 POINT v62; // [sp+38h] [bp-7Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 POINT v63; // [sp+40h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 POINT v64; // [sp+48h] [bp-6Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 POINT v65; // [sp+50h] [bp-64h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 POINT v66; // [sp+58h] [bp-5Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 POINT v67; // [sp+60h] [bp-54h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 POINT a2; // [sp+68h] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 POINT v69; // [sp+70h] [bp-44h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 POINT v70; // [sp+78h] [bp-3Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 POINT v71; // [sp+80h] [bp-34h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 POINT v72; // [sp+88h] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 bool v73; // [sp+90h] [bp-24h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 int v74; // [sp+94h] [bp-20h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 int a6; // [sp+98h] [bp-1Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 int a3; // [sp+9Ch] [bp-18h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 Player *v77; // [sp+A0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 unsigned int v79; // [sp+A8h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 int v80; // [sp+ACh] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 ItemGen *_this; // [sp+B0h] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 v77 = pPlayers[uActiveCharacter];
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
4530 if ( pCurrentScreen == 14 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 if ( dword_F8B19C > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 if ( dword_F8B19C < 36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 if ( dword_F8B19C <= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 v42 = dword_F8B19C - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 v44 = v43 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 if ( v44 < v43 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 v44 = v43 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v42] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 pSkill = &v0->pActiveSkills[v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 if ( !*pSkill )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 if ( pParty->uNumGold < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 v13 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 if ( dword_F8B198 == 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 v55 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 Party::TakeGold(v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 *pSkill = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 v51 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 if ( dword_F8B19C != 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 sub_421EA6_OnInventoryLeftClick();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 if ( dword_F8B19C == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 v17 = pMouse->GetCursorPos(&v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 v19 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 //v21 = p2DEvents_minus1__20[13 * (signed int)v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 _this = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 v22 = v20->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 v23 = v0->_4B8142(v22, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 v80 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 if ( pParty->uNumGold < v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 v9 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 v26 = 1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4619 v20->uAttributes |= 1u;
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4620 memcpy(&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v25 + 5], v20, 0x24u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 v54 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 v9 = pGlobalTXT_LocalizationStrings[563]; // "Pack is Full!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 v28 = pMouse->GetCursorPos(&v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 if ( !v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 v30 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 v31 = 9 * (v29 - 1 + 12 * (int)v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 v32 = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 _this = (ItemGen *)&pParty->field_777C[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 _this = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v32 = (ItemGen *)&pParty->field_C59C[v31 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 v34 = v32->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 v80 = v0->_4B8142(v34, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 LOWORD(v35) = GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 v74 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v36 = v0->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 uNumSeconds = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 v73 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 v37 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 a3 = pMapStats->pInfos[v37]._steal_perm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 v38 = GetPartyReputation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 if ( v73 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 if ( !uNumSeconds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 if ( pParty->uNumGold < v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 if ( uNumSeconds != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 if ( uNumSeconds != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 v39 = v0->AddItem(0xFFFFFFFFu, v32->uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4687 v32->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 v7 = v73 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 v40 = (int)((char *)v0 + 36 * v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 memcpy((void *)(v40 + 496), v32, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 if ( (short)v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 v41 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 if ( uNumSeconds == 1 || uNumSeconds == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 *(char *)(v40 + 517) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 dword_F8B1E4 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 viewparams->bRedrawGameUI = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 _this->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 v27 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 v51 = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 v27->PlaySound(v51, v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 v0->PlaySound(15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 if ( dword_F8B19C == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 v14 = pMouse->GetCursorPos(&v71)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 if ( pMouse->GetCursorPos(&v67)->x <= 13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 || pMouse->GetCursorPos(&v65)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 v16 = ptr_507BC0;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4731 if ( sub_4BDAAF((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5], (int)ptr_507BC0->ptr_1C) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 v51 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 v0->PlaySound(79, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 v48 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 pAudioPlayer->PlaySound(SOUND_27, v46, v47, v48, v49, v50, v52, v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 v10 = pMouse->GetCursorPos(&v62)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 v79 = (v10 >> 5) + 14 * ((pMouse->GetCursorPos(&v66)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 if ( pMouse->GetCursorPos(&v58)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 if ( pMouse->GetCursorPos(&v64)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier);
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4766 v12 = (int)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v11 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 if ( !(*(char *)(v12 + 20) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 *(int *)(v12 + 20) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 v0->PlaySound(73, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 v9 = pGlobalTXT_LocalizationStrings[569];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 v51 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 v1 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 v79 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v70)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 if ( pMouse->GetCursorPos(&v60)->x > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 if ( pMouse->GetCursorPos(&v72)->x < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4808 v3 = (int)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
4812 auto _v = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 v5 = _v->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 v6 = v0->_4B81C3(v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 v7 = (*(char *)(v3 + 20) & 2) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 v80 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 _this = (ItemGen *)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 if ( pParty->uNumGold >= v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 dword_F8B1E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 Party::TakeGold(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 v8 = *(int *)(v3 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 LOBYTE(v8) = v8 & 0xFD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 *(int *)(v3 + 20) = v8 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 v0->PlaySound(74, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v9 = pGlobalTXT_LocalizationStrings[570];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 v54 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 ShowStatusBarString(v9, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 v55 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 HousePlaySomeSound((unsigned int)v13, v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 v51 = 79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 v27 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 //----- (004BE386) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 void __fastcall log_error(const char *pMessage)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 FILE *f; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 FILE *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 v1 = pMessage;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 f = fopen("errorlog.txt", "a");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 v3 = f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 if ( f )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 fprintf(f, "%s\n", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 fflush(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 //----- (004BE3BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 FrameTableTxtLine *texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 signed int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 unsigned int v4; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 FrameTableTxtLine *result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 signed int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 static struct FrameTableTxtLine static_stru_F8BA58; // weak
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 static_stru_F8BA58.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 if ( _this && *_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 v2 = (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 v4 = _this - (char *)&unk_F8B668;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 v5 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 if ( v5 != 32 && v5 != 44 && v5 != 9 || v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 if ( v5 == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 if ( v2[v4 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 ++static_stru_F8BA58.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 if ( static_stru_F8BA58.field_0 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 while ( (unsigned int)v2 < (unsigned int)&unk_F8BA50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 memcpy(a2, &static_stru_F8BA58, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 // F8BA58: using guessed type FrameTableTxtLine static_stru_F8BA58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 //----- (004BE485) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 char v5; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 FrameTableTxtLine *result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 unsigned int v7; // [sp+Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 stru_F8B5E8.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 if ( pString && *pString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 v2 = (char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 v7 = pString - (const char *)&unk_F8B1F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 v5 = v2[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 *v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 if ( v5 == ',' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 if ( v5 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 if ( v5 == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 if ( v2[v7 + 1] == 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 *v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 ++stru_F8B5E8.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 if ( stru_F8B5E8.field_0 < 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 if ( (unsigned int)v2 < (unsigned int)&unk_F8B5E0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 memcpy(a2, &stru_F8B5E8, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 // F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 //----- (004BE571) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 int __fastcall sub_4BE571(int a1, int *a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 int i; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 result = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 if ( a3 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 for ( i = 0; i < a3; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 if ( a1 == a2[i] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 if ( i == a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 a2[a3] = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 result = a3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 //----- (004BF91E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 unsigned int __thiscall GameOverMenu(void *ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 unsigned int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 char *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 char *v4; // ST24_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 int v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 char *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 char *v7; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 char *v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 char *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 unsigned int v10; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 MSG Msg; // [sp+88h] [bp-48h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 void *v15; // [sp+A8h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 char *pInString; // [sp+ACh] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 unsigned int v17; // [sp+B0h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 unsigned int v19; // [sp+B8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 int v20; // [sp+BCh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 int i; // [sp+C0h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 v15 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 //RGBTexture::RGBTexture(&this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 BYTE1(dword_6BE364_game_settings_1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 pRenderer->ClearBlack();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 _449B57_test_bit(pParty->_award_bits, 99);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 _this.Load("winbg.pcx", 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 pRenderer->DrawTextureRGB(0, 0, &_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 free(_this.pPixels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 _this.pPixels = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5121 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 pWindow.uFrameX = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 pWindow.uFrameY = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 pWindow.uFrameWidth = 469;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 pWindow.uFrameHeight = 338;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 pWindow.uFrameZ = 543;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 pWindow.uFrameW = 397;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 pFont = LoadFont("endgame.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 99) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 v1 = pGlobalTXT_LocalizationStrings[675];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 result = _449B57_test_bit(pParty->_award_bits, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 if ( !(short)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 v1 = pGlobalTXT_LocalizationStrings[676];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 pInString = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 v23 = pParty->uTimePlayed - 138240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 v17 = v19 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 pWindow.DrawText2(pFont, 1u, 0x23u, 1u, pGlobalTXT_LocalizationStrings[9], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 v3 = pParty->pPlayers[0].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 v23 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 v4 = pClassNames[(unsigned __int8)v3[17]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 v5 = ((Player *)(v3 - 168))->GetBaseLevel();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i, v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 pWindow.DrawText2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 pFont,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 v23 += __PAIR__(*(int *)(i - 4), *(int *)(i - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 i += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 if ( i >= (signed int)&pParty->pPickedItem.uNumCharges )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 v23 = (signed __int64)v23 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 pWindow.DrawText2(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 v7 = pGlobalTXT_LocalizationStrings[56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 if ( v17 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 v7 = pGlobalTXT_LocalizationStrings[57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 v8 = pGlobalTXT_LocalizationStrings[146];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 if ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 v8 = pGlobalTXT_LocalizationStrings[148];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 v9 = pGlobalTXT_LocalizationStrings[245];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 if ( v14 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 v9 = pGlobalTXT_LocalizationStrings[132];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 sprintfex(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 pWindow.DrawText2(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 pRenderer->pBeforePresentFunction();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 pRenderer->_49F1BC("MM7_Win.Pcx");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 pAllocator->FreeChunk(pFont);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 if ( v15 == (void *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 LODWORD(v23) = GetTickCount() + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 while ( (unsigned int)v23 > GetTickCount() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 v10 = PeekMessageA(&Msg, 0, 0, 0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 pMessageQueue_50CBD0->uNumMessages = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 pKeyActionMap->uLastKeyPressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 while ( !pKeyActionMap->uLastKeyPressed );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 if ( (signed int)result < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 pMessageQueue_50CBD0->pMessages[result].eType = (UIMessageType)197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
5267
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 //----- (004C0262) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 void Viewport::SetScreen(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 unsigned int x; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 unsigned int z; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 unsigned int w; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 char no_3d; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 if ( (signed int)uX > (signed int)uZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 z = uZ ^ uX ^ uZ; // swap x and z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 x = z ^ uZ ^ uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 if ( (signed int)uY > (signed int)uW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 w = uW ^ uY ^ uW; // swap y and w
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 y = w ^ uW ^ uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 this->uScreenX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 this->uScreenY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 this->uScreenZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 this->uScreenW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 no_3d = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 this->uScreenWidth = z - x + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 this->uScreenCenterX = (signed int)(z + x) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 if ( no_3d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 v10 = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 this->uScreenHeight = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 this->uScreenCenterY = this->uScreenW - ((unsigned __int64)(this->field_30 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 this->uScreenHeight = w - y + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 this->uScreenCenterY = (signed int)(w + y) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 SetViewport(this->uScreenX, this->uScreenY, this->uScreenZ, this->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 //----- (004C02F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 void Viewport::_4C02F8(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 unsigned int v2; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 v2 = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 this->field_30 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 SetScreen(this->uScreenX, this->uScreenY, this->uScreenZ, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 //----- (004C0312) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 void Viewport::SetViewport(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 unsigned int x; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 unsigned int y; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 unsigned int z; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 unsigned int w; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 x = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 if ( (signed int)uX < (signed int)this->uScreenX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 x = this->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 y = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 if ( (signed int)uY < (signed int)this->uScreenY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 y = this->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 z = uZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 if ( (signed int)uZ > (signed int)this->uScreenZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 z = this->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 w = uW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 if ( (signed int)uW > (signed int)this->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 w = this->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 this->uViewportY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 this->uViewportX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 this->uViewportZ = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 this->uViewportW = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 //----- (004D6FB0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 __int16 v8; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 int v9; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 unsigned __int8 v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 v11 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 v10 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 if ( v10 ^ v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 v7 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 + (*(int *)(v1 + 12) & (v2 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 v8 = *(short *)(*(int *)(v1 + 52) + 2 * v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 *(short *)result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 //----- (004D705A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 int /*__usercall*/ sr_sub_4D705A/*<eax>*/(stru315 *a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 unsigned int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 unsigned int v8; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 __int16 v9; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 unsigned int v10; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 unsigned int v11; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 unsigned __int8 v12; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 unsigned __int8 v13; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 v1 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 v10 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 v11 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 v11 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 v10 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 if ( (signed int)v11 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 v11 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 if ( (signed int)v10 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 v10 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 + (*(int *)(v1 + 12) & (v11 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 + ((*(int *)(v1 + 8) & v10) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 v13 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 v12 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 if ( v12 ^ v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 v8 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v8 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 v7 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 if ( (signed int)v8 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 v8 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 if ( (signed int)v7 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v7 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 v9 = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 + (*(int *)(v1 + 12) & (v8 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 + ((*(int *)(v1 + 8) & v7) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 *(int *)(v1 + 64) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 *(int *)(v1 + 48) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 *(int *)(v1 + 44) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 //----- (004D714C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 int __cdecl sr_sub_4D714C(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 unsigned __int16 v9; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 unsigned int *v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 int v11; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 int v12; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 unsigned __int8 v13; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 unsigned __int8 v14; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 v12 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 *(short *)(result + 2) = v2->field_34_palette[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 v14 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 v13 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 v8 = *((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 + (v2->field_C & (v3 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 + ((v2->field_8 & (unsigned int)v4) >> LOBYTE(v2->field_10)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 v9 = v2->field_34_palette[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 v10 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v11 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 *(short *)result = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 *v10 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 *(v10 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 // 4D714C: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 //----- (004D71F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 int __cdecl sr_sub_4D71F8(stru315 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 stru315 *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 unsigned int *v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 unsigned int v9; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 unsigned __int16 v10; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 unsigned int *v11; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 int v12; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 int v13; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 unsigned int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 unsigned __int8 v15; // sf@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 unsigned __int8 v16; // of@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 v2 = (stru315 *)v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 v3 = v2->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 v4 = v2->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 result = (int)v2->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 if ( !(v2->field_28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 --v2->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 result += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 v6 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 v7 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 --v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 *v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 v13 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 v14 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v14 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 v13 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 if ( (signed int)v14 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 v14 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 if ( v13 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 v13 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 result -= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 *(short *)(result + 2) = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 + (v2->field_C & (v14 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 + ((v2->field_8 & (unsigned int)v13) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 v16 = __OFSUB__(v2->field_28, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 v15 = v2->field_28 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 v2->field_28 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 if ( v15 ^ v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 v8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 if ( v3 < v2->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 v9 = v2->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 if ( v4 < v2->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 v8 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 if ( (signed int)v9 > v2->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 v9 = v2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 if ( v8 > v2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 v8 = v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v3 += v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 v10 = v2->field_34_palette[*((char *)v2->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 + (v2->field_C & (v9 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 + ((v2->field_8 & (unsigned int)v8) >> LOBYTE(v2->field_10)))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v4 += v2->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 v11 = v2->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 v12 = v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 *(short *)result = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 v2->pDepthBuffer -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 *(v11 - 1) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 v2->pColorBuffer = (unsigned __int16 *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 v2->field_30 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 v2->field_2C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 // 4D71F8: inconsistent function type and number of purged bytes
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 //----- (004D72EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 int /*__usercall*/ sr_sub_4D72EC/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 unsigned int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 unsigned int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 unsigned int v10; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 unsigned int v11; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 int v12; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 unsigned __int8 v13; // sf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 unsigned __int8 v14; // of@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 v10 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 v11 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 v10 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 v11 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 if ( (signed int)v10 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 v10 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 if ( (signed int)v11 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 v11 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 v12 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 + (*(int *)(v1 + 12) & (v10 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 + ((*(int *)(v1 + 8) & v11) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52) + 2 * v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 v14 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 v13 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 if ( v13 ^ v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 v7 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 v8 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 if ( (signed int)v2 < *(int *)(v1 + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 v7 = *(int *)(v1 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 if ( (signed int)v3 < *(int *)(v1 + 28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v8 = *(int *)(v1 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 if ( (signed int)v7 > *(int *)(v1 + 24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 v7 = *(int *)(v1 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 if ( (signed int)v8 > *(int *)(v1 + 32) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 v8 = *(int *)(v1 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v9 = *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 + (*(int *)(v1 + 12) & (v7 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 + ((*(int *)(v1 + 8) & v8) >> *(char *)(v1 + 16)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 *(short *)result = *(short *)(*(int *)(v1 + 52) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 //----- (004D73DF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 int /*__usercall*/ sr_sub_4D73DF/*<eax>*/(int a1/*<ebp>*/)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 int v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 unsigned __int8 v9; // sf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 unsigned __int8 v10; // of@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 v1 = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 v2 = *(int *)(v1 + 48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 v3 = *(int *)(v1 + 44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 result = *(int *)(v1 + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 if ( !(*(int *)(v1 + 40) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 --*(int *)(v1 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 result -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 *(int *)(v1 + 60) += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 *(int *)v5 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 v8 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 result += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 if ( *(char *)(*(int *)(v1 + 56) + v8 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 *(short *)(result - 2) = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 v10 = __OFSUB__(*(int *)(v1 + 40), 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 v9 = *(int *)(v1 + 40) - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 *(int *)(v1 + 40) -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 if ( v9 ^ v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v7 = *(int *)(v1 + 12) & (v2 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 v2 += *(int *)(v1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 if ( *(char *)(*(int *)(v1 + 56) + v7 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 *(short *)result = *(short *)(*(int *)(v1 + 52)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 + 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 * *(char *)(*(int *)(v1 + 56)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 + v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 + ((*(int *)(v1 + 8) & v3) >> *(char *)(v1 + 16))));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 v3 += *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 v5 = *(int *)(v1 + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 v6 = *(int *)(v1 + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 *(int *)(v1 + 60) += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 *(int *)(v5 + 4) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 //----- (004D754B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 void __cdecl sr_sub_4D754B(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 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
5827 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 a1->pColorBuffer = v11 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 a1->pDepthBuffer = v12 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 //----- (004D7630) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 void __cdecl sr_sub_4D7630(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 unsigned __int16 *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 unsigned __int16 v7; // bx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 unsigned __int16 *v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 unsigned int *v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 int v11; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 int v12; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873 int v13; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 int v14; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 v14 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 v3 = *((char *)a1->pTextureLOD
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 v4 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 v5 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 if ( v5 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 v5 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 if ( a2->field_8 - v5 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 v6 = a2->field_8 - v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 v3 += v6 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 v4 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v7 = v4[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 v8 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 v9 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 *v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 *v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 a1->pColorBuffer = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 a1->pDepthBuffer = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 v11 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 v12 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 v13 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 a1->field_30 = a1->field_4 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 a1->field_2C = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 v2 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 while ( v14 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 //----- (004D76ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 void __cdecl sr_sub_4D76ED(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 unsigned __int16 v9; // bx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 unsigned __int16 *v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 unsigned int *v12; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 int v15; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 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
5953 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 v7 = (unsigned int)a2->field_14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 v11 = a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 v12 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 *v11 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 *v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 a1->pColorBuffer = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 a1->pDepthBuffer = v12 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 //----- (004D77D2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 void __cdecl sr_sub_4D77D2(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 unsigned __int16 *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 unsigned __int16 *v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 int v6; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994 unsigned __int16 v8; // bx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 unsigned int *v10; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5997 unsigned int *v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 int v13; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000 int v14; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 int v15; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 v3 = a1->pTextureLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 v4 = *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 v5 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 if ( *((char *)v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 + (a1->field_C & ((unsigned int)a1->field_30 >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 + ((unsigned int)(a1->field_2C & a1->field_8) >> a1->field_10)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 v6 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 if ( v6 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 v6 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 if ( a2->field_8 - v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 v7 = a2->field_8 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 v4 += v7 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 v5 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 v8 = v5[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 v9 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 v10 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 *a1->pColorBuffer = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 *v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 v11 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 a1->pDepthBuffer = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 v12 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 v13 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 v14 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 a1->field_30 = a1->field_4 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 a1->field_2C = v14 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 v2 = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 while ( v15 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 //----- (004D789A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 void __cdecl sr_sub_4D789A(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 unsigned __int16 *v6; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 int v7; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 int v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 unsigned __int16 v9; // bx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 int v10; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 unsigned int *v11; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 unsigned int *v12; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 int v13; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 int v15; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 int v16; // [sp-4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 v2 = a1->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 v16 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 v3 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 v4 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 if ( (signed int)v3 >= a1->field_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 v3 = a1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 if ( (signed int)v3 <= a1->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 v3 = a1->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 if ( v4 >= a1->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 v4 = a1->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 if ( v4 <= a1->field_1C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 v4 = a1->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 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
6086 v6 = a1->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 v7 = (unsigned int)a2->field_10 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 if ( a2->field_8 - v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 v8 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 v5 += v8 << 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 v6 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 v9 = v6[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 v10 = a1->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 v11 = a1->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 *a1->pColorBuffer = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 *v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 v12 = a1->pDepthBuffer + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 ++a1->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 a1->pDepthBuffer = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 v13 = a1->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 v14 = a1->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 v15 = a1->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 a1->field_30 = a1->field_4 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 a1->field_2C = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 v2 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 while ( v16 != 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 //----- (00451007) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6125 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
6126 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6127 int a10, int a11)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6128 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6129 int v11; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6130 int result; // eax@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6131 int v13; // edi@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6132 int v14; // ecx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 double v15; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 double v16; // st6@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 float v17; // ST3C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 float v18; // ST38_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 unsigned int v19; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 int v21; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 unsigned int v22; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 unsigned int v23; // eax@29
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6142 unsigned __int16 *v24; // ecx@29
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6143 int v25; // edi@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6144 int v26; // ecx@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 double v27; // st7@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 double v28; // st6@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 float v29; // ST34_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 float v30; // ST30_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 unsigned int v31; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 int v32; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 int v33; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 unsigned int v34; // ecx@50
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6153 unsigned __int16 v35; // ax@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6154 unsigned __int16 *v36; // ecx@54
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6155 int v37; // edi@58
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6156 int v38; // ecx@60
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 double v39; // st7@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 double v40; // st6@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 float v41; // ST34_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 float v42; // ST30_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 unsigned int v43; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 int v44; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 int v45; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 unsigned int v46; // ecx@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 char v47; // al@79
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6166 unsigned __int16 *v48; // ecx@79
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6167 int v49; // edi@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6168 int v50; // ecx@88
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 double v51; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 double v52; // st6@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 float v53; // ST34_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 float v54; // ST30_4@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 unsigned int v55; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 int v56; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 int v57; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 unsigned int v58; // ecx@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 unsigned int v59; // eax@107
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6178 unsigned __int16 *v60; // ecx@107
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6179 int v61; // edi@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6180 int v62; // ecx@113
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 double v63; // st7@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 double v64; // st6@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 float v65; // ST34_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 float v66; // ST30_4@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 unsigned int v67; // esi@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 int v68; // eax@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 int v69; // eax@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 unsigned int v70; // ecx@128
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6189 unsigned __int16 v71; // ax@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6190 unsigned __int16 *v72; // ecx@132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6191 int v73; // edi@136
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6192 int v74; // ecx@138
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 double v75; // st7@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 double v76; // st6@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 float v77; // ST34_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 float v78; // ST30_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 unsigned int v79; // esi@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 int v80; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 int v81; // eax@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 unsigned int v82; // ecx@153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 char v83; // al@157
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6202 unsigned __int16 *v84; // ecx@157
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6203 int v85; // edi@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6204 int v86; // ecx@166
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 double v87; // st7@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 double v88; // st6@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 float v89; // ST34_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 float v90; // ST30_4@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 unsigned int v91; // esi@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 signed int v92; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 int v93; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 int v94; // eax@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 unsigned int v95; // ecx@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 unsigned int v96; // eax@185
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6215 unsigned __int16 *v97; // ecx@185
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6216 int v98; // edi@189
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6217 int v99; // ecx@191
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 double v100; // st7@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 double v101; // st6@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 float v102; // ST34_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 float v103; // ST30_4@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 unsigned int v104; // esi@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 signed int v105; // eax@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 int v106; // eax@196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 int v107; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 unsigned int v108; // ecx@206
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6227 unsigned __int16 v109; // ax@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6228 unsigned __int16 *v110; // ecx@210
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6229 int v111; // edi@214
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6230 int v112; // ecx@216
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 double v113; // st7@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 double v114; // st6@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 float v115; // ST34_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 float v116; // ST30_4@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 unsigned int v117; // esi@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 signed int v118; // eax@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 int v119; // eax@221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 int v120; // eax@223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 unsigned int v121; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 char v122; // al@235
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6241 unsigned __int16 *v123; // ecx@235
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 double v124; // [sp+Ch] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 double v125; // [sp+Ch] [bp-7Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 double v126; // [sp+Ch] [bp-7Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 double v127; // [sp+Ch] [bp-7Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6246 //double v128; // [sp+Ch] [bp-7Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6247 uint _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 double v129; // [sp+Ch] [bp-7Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 double v130; // [sp+Ch] [bp-7Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 double v131; // [sp+Ch] [bp-7Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 double v132; // [sp+Ch] [bp-7Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 double v133; // [sp+14h] [bp-74h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 double v134; // [sp+14h] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 double v135; // [sp+14h] [bp-74h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 double v136; // [sp+14h] [bp-74h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6256 //double v137; // [sp+14h] [bp-74h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6257 uint _v137;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 double v138; // [sp+14h] [bp-74h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 double v139; // [sp+14h] [bp-74h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 double v140; // [sp+14h] [bp-74h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 double v141; // [sp+14h] [bp-74h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 double v142; // [sp+1Ch] [bp-6Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 double v143; // [sp+1Ch] [bp-6Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 double v144; // [sp+1Ch] [bp-6Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 double v145; // [sp+1Ch] [bp-6Ch]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6266 //double v146; // [sp+1Ch] [bp-6Ch]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6267 uint _v146;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 double v147; // [sp+1Ch] [bp-6Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 double v148; // [sp+1Ch] [bp-6Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 double v149; // [sp+1Ch] [bp-6Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 double v150; // [sp+1Ch] [bp-6Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 double v151; // [sp+24h] [bp-64h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 double v152; // [sp+24h] [bp-64h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 double v153; // [sp+24h] [bp-64h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 double v154; // [sp+24h] [bp-64h]@90
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6276 //double v155; // [sp+24h] [bp-64h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6277 uint _v155;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 double v156; // [sp+24h] [bp-64h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 double v157; // [sp+24h] [bp-64h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 double v158; // [sp+24h] [bp-64h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 double v159; // [sp+24h] [bp-64h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 int v160; // [sp+3Ch] [bp-4Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 int v161; // [sp+40h] [bp-48h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 int v162; // [sp+44h] [bp-44h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 int v163; // [sp+44h] [bp-44h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 int v164; // [sp+44h] [bp-44h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 int v165; // [sp+44h] [bp-44h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 int v166; // [sp+44h] [bp-44h]@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 int v167; // [sp+44h] [bp-44h]@169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 int v168; // [sp+44h] [bp-44h]@194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 int v169; // [sp+44h] [bp-44h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 int v170; // [sp+48h] [bp-40h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 int v171; // [sp+48h] [bp-40h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 int v172; // [sp+48h] [bp-40h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 int v173; // [sp+48h] [bp-40h]@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 int v174; // [sp+48h] [bp-40h]@141
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6297 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 int *v176; // [sp+50h] [bp-38h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 int *v177; // [sp+50h] [bp-38h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 int *v178; // [sp+50h] [bp-38h]@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 int *v179; // [sp+50h] [bp-38h]@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 int *v180; // [sp+50h] [bp-38h]@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 int *v181; // [sp+50h] [bp-38h]@143
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6304 char *v182; // [sp+50h] [bp-38h]@169
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6305 char *v183; // [sp+50h] [bp-38h]@194
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6306 char *v184; // [sp+50h] [bp-38h]@219
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6307 unsigned __int16 *v185; // [sp+54h] [bp-34h]@38
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6308 unsigned __int16 *v186; // [sp+54h] [bp-34h]@63
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6309 unsigned __int16 *v187; // [sp+54h] [bp-34h]@91
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6310 unsigned __int16 *v188; // [sp+54h] [bp-34h]@116
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6311 unsigned __int16 *v189; // [sp+54h] [bp-34h]@141
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 signed int v190; // [sp+54h] [bp-34h]@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 signed int v191; // [sp+54h] [bp-34h]@195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 signed int v192; // [sp+54h] [bp-34h]@220
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6315 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6316 unsigned __int16 *v194; // [sp+5Ch] [bp-2Ch]@32
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6317 unsigned __int16 *v195; // [sp+5Ch] [bp-2Ch]@57
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6318 unsigned __int16 *v196; // [sp+5Ch] [bp-2Ch]@85
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6319 unsigned __int16 *v197; // [sp+5Ch] [bp-2Ch]@110
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6320 unsigned __int16 *v198; // [sp+5Ch] [bp-2Ch]@135
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6321 unsigned __int16 *v199; // [sp+5Ch] [bp-2Ch]@163
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6322 unsigned __int16 *v200; // [sp+5Ch] [bp-2Ch]@188
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6323 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6324 //stru350 *v202; // [sp+60h] [bp-28h]@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6325 int v203; // [sp+64h] [bp-24h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6326 int v204; // [sp+64h] [bp-24h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6327 int v205; // [sp+64h] [bp-24h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6328 int v206; // [sp+64h] [bp-24h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6329 int v207; // [sp+64h] [bp-24h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6330 int v208; // [sp+64h] [bp-24h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6331 int v209; // [sp+64h] [bp-24h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6332 int v210; // [sp+64h] [bp-24h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6333 int v211; // [sp+64h] [bp-24h]@218
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 float v212; // [sp+6Ch] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 float v213; // [sp+6Ch] [bp-1Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 float v214; // [sp+6Ch] [bp-1Ch]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 float v215; // [sp+6Ch] [bp-1Ch]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 float v216; // [sp+6Ch] [bp-1Ch]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 float v217; // [sp+6Ch] [bp-1Ch]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 float v218; // [sp+6Ch] [bp-1Ch]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 float v219; // [sp+6Ch] [bp-1Ch]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 float v220; // [sp+6Ch] [bp-1Ch]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 float v221; // [sp+70h] [bp-18h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 float v222; // [sp+70h] [bp-18h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 float v223; // [sp+70h] [bp-18h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 float v224; // [sp+70h] [bp-18h]@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 float v225; // [sp+70h] [bp-18h]@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 float v226; // [sp+70h] [bp-18h]@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 float v227; // [sp+70h] [bp-18h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 float v228; // [sp+70h] [bp-18h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 float v229; // [sp+70h] [bp-18h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 signed int v230; // [sp+74h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 signed int v231; // [sp+78h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 signed int v232; // [sp+78h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 signed int v233; // [sp+78h] [bp-10h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 signed int v234; // [sp+78h] [bp-10h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 signed int v235; // [sp+78h] [bp-10h]@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 signed int v236; // [sp+78h] [bp-10h]@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 signed int v237; // [sp+78h] [bp-10h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 signed int v238; // [sp+78h] [bp-10h]@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 signed int v239; // [sp+78h] [bp-10h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 __int64 v240; // [sp+7Ch] [bp-Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 __int64 v241; // [sp+7Ch] [bp-Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 __int64 v242; // [sp+7Ch] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 __int64 v243; // [sp+7Ch] [bp-Ch]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 __int64 v244; // [sp+7Ch] [bp-Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 __int64 v245; // [sp+7Ch] [bp-Ch]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 unsigned int v246; // [sp+7Ch] [bp-Ch]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 unsigned int v247; // [sp+7Ch] [bp-Ch]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 unsigned int v248; // [sp+7Ch] [bp-Ch]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 unsigned int v249; // [sp+80h] [bp-8h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 unsigned int v250; // [sp+80h] [bp-8h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 unsigned int v251; // [sp+80h] [bp-8h]@218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 unsigned int v252; // [sp+84h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 unsigned int v253; // [sp+84h] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 unsigned int v254; // [sp+84h] [bp-4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 unsigned int v255; // [sp+84h] [bp-4h]@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 unsigned int v256; // [sp+84h] [bp-4h]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 unsigned int v257; // [sp+84h] [bp-4h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 unsigned int v258; // [sp+84h] [bp-4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 unsigned int v259; // [sp+84h] [bp-4h]@193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 unsigned int v260; // [sp+84h] [bp-4h]@218
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6383 signed int a6a; // [sp+A0h] [bp+18h]@10
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6384 float a6s; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6385 float a6t; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6386 unsigned int a6b; // [sp+A0h] [bp+18h]@12
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6387 signed int a6c; // [sp+A0h] [bp+18h]@35
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6388 float a6u; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6389 float a6v; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6390 unsigned int a6d; // [sp+A0h] [bp+18h]@37
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6391 signed int a6e; // [sp+A0h] [bp+18h]@60
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6392 float a6w; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6393 float a6x; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6394 unsigned int a6f; // [sp+A0h] [bp+18h]@62
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6395 signed int a6g; // [sp+A0h] [bp+18h]@88
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6396 float a6y; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6397 float a6z; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6398 unsigned int a6h; // [sp+A0h] [bp+18h]@90
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6399 signed int a6i; // [sp+A0h] [bp+18h]@113
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6400 float a6ba; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6401 float a6bb; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6402 unsigned int a6j; // [sp+A0h] [bp+18h]@115
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6403 signed int a6k; // [sp+A0h] [bp+18h]@138
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6404 float a6bc; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6405 float a6bd; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6406 unsigned int a6l; // [sp+A0h] [bp+18h]@140
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6407 signed int a6m; // [sp+A0h] [bp+18h]@166
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6408 float a6be; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6409 float a6bf; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6410 unsigned int a6n; // [sp+A0h] [bp+18h]@168
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6411 signed int a6o; // [sp+A0h] [bp+18h]@191
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6412 float a6bg; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6413 float a6bh; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6414 unsigned int a6p; // [sp+A0h] [bp+18h]@193
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6415 signed int a6q; // [sp+A0h] [bp+18h]@216
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6416 float a6bi; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6417 float a6bj; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6418 unsigned int a6r; // [sp+A0h] [bp+18h]@218
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6419 int a9a; // [sp+ACh] [bp+24h]@8
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6420 int a9b; // [sp+ACh] [bp+24h]@33
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6421 int a9c; // [sp+ACh] [bp+24h]@86
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6422 int a9d; // [sp+ACh] [bp+24h]@111
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6423 int a9e; // [sp+ACh] [bp+24h]@164
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6424 int a9f; // [sp+ACh] [bp+24h]@189
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 v11 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6427 result = this->field_0.field_C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6428 //v202 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 if ( result != 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6436 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6441 if ( result != 32 || (result = (int)pDst, v193 = pDst, v231 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6443 v13 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6444 a9a = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 v14 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6448 a6a = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6449 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 LABEL_30:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6452 v193 = (unsigned __int16 *)((char *)v193 + a9a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 ++v231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 result = v231;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6455 if ( v231 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6459 v221 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6460 v212 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6461 v15 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6462 v16 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6465 a6s = (double)a6a / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6466 v151 = floorf(a6s + 0.5f);//a6s + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v203 = v14 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6468 a6t = (double)(v14 + 1) / v221 * v212;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6469 v142 = floorf(a6t + 0.5f);//a6t + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 v17 = (double)v231 / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6471 v133 = floorf(v17 + 0.5f);//v17 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 v18 = (double)(v231 + 1) / v15 * v16;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6473 v124 = floorf(v18 + 0.5f);//v18 + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 v252 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6476 a6b = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v240 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 if ( SLODWORD(v133) < SLODWORD(v124) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 v22 = (unsigned int)v240 / ((LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6484 a6b /= v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 v252 /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 HIDWORD(v240) /= v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 if ( v22 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 v22 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6490 v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 v24 = v193;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6492 v193 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6493 *(_DWORD *)v24 = v23;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 v14 = v203;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6495 a6a = v203;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6496 if ( v203 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 v160 = LODWORD(v124) - LODWORD(v133);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6500 v175 = &pSrc[2 * (LODWORD(v151) + srcPitch * LODWORD(v133))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 while ( SLODWORD(v151) >= SLODWORD(v142) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 LABEL_24:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6504 v175 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 --v160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 if ( !v160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 v176 = (int *)v175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 v161 = LODWORD(v142) - LODWORD(v151);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 v20 = *v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 v13 = v20 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6519 v21 = _450FB1(v20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 LODWORD(v240) = v13 + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 ++v176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 --v161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 if ( !v161 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 LODWORD(v240) = ((unsigned int)v21 >> 24) + v240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 LABEL_22:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6535 a6b += BYTE2(v21);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 v252 += BYTE1(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 HIDWORD(v240) += (unsigned __int8)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6540 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6541 v194 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v232 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6543 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6545 v25 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6546 a9b = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 v26 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6550 a6c = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6551 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 LABEL_55:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6554 v194 = (unsigned __int16 *)((char *)v194 + a9b);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 ++v232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 result = v232;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6557 if ( v232 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6561 v222 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6562 v213 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6563 v27 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6564 v28 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6567 a6u = (double)a6c / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6568 v125 = a6u + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 v204 = v26 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6570 a6v = (double)(v26 + 1) / v222 * v213;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6571 v134 = a6v + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 v29 = (double)v232 / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 v143 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 v30 = (double)(v232 + 1) / v27 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 v152 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 v31 = (LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 v253 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6578 a6d = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 v241 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 if ( SLODWORD(v143) < SLODWORD(v152) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 v34 = (unsigned int)v241 / ((LODWORD(v152) - LODWORD(v143)) * (LODWORD(v134) - LODWORD(v125)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 if ( v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6586 a6d /= v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 v253 /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 HIDWORD(v241) /= v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 if ( v34 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 v34 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6592 v35 = _450F55(HIDWORD(v241) | ((v253 | ((a6d | (v34 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 v36 = v194;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6594 ++v194;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6595 *v36 = v35;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 v26 = v204;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6597 a6c = v204;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6598 if ( v204 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 v170 = LODWORD(v152) - LODWORD(v143);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6602 v185 = &pSrc[2 * (LODWORD(v125) + srcPitch * LODWORD(v143))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 while ( SLODWORD(v125) >= SLODWORD(v134) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 LABEL_49:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6606 v185 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 --v170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 if ( !v170 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 v177 = (int *)v185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 v162 = LODWORD(v134) - LODWORD(v125);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 v32 = *v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 v25 = v32 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6621 v33 = _450FB1(v32);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 LODWORD(v241) = v25 + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 ++v177;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 --v162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 if ( !v162 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 LODWORD(v241) = ((unsigned int)v33 >> 24) + v241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 LABEL_47:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6637 a6d += BYTE2(v33);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 v253 += BYTE1(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 HIDWORD(v241) += (unsigned __int8)v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6642 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6643 v195 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 v233 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6645 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6647 v37 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 v38 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6651 a6e = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6652 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 LABEL_80:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6655 v195 = (unsigned __int16 *)((char *)v195 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 ++v233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 result = v233;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6658 if ( v233 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6662 v223 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6663 v214 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6664 v39 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6665 v40 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6668 a6w = (double)a6e / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6669 v126 = a6w + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 v205 = v38 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6671 a6x = (double)(v38 + 1) / v223 * v214;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6672 v135 = a6x + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 v41 = (double)v233 / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 v144 = v41 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 v42 = (double)(v233 + 1) / v39 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 v153 = v42 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 v43 = (LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 v254 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6679 a6f = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 v242 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 if ( SLODWORD(v144) < SLODWORD(v153) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 LABEL_75:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 v46 = (unsigned int)v242 / ((LODWORD(v153) - LODWORD(v144)) * (LODWORD(v135) - LODWORD(v126)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6687 a6f /= v43;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 v254 /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 HIDWORD(v242) /= v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 if ( v46 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 v46 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6693 v47 = _450F55(HIDWORD(v242) | ((v254 | ((a6f | (v46 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6694 v48 = v195;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6695 v195 = (unsigned __int16 *)((char *)v195 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6696 *(_BYTE *)v48 = v47;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 v38 = v205;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6698 a6e = v205;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6699 if ( v205 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 v171 = LODWORD(v153) - LODWORD(v144);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6703 v186 = &pSrc[2 * (LODWORD(v126) + srcPitch * LODWORD(v144))];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 while ( SLODWORD(v126) >= SLODWORD(v135) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 LABEL_74:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6707 v186 += 2 * srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 --v171;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 if ( !v171 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 goto LABEL_75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 v178 = (int *)v186;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 v163 = LODWORD(v135) - LODWORD(v126);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 v44 = *v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 v37 = v44 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6722 v45 = _450FB1(v44);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 LODWORD(v242) = v37 + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 --v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 ++v178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 --v163;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 if ( !v163 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 LODWORD(v242) = ((unsigned int)v45 >> 24) + v242;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 LABEL_72:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6738 a6f += BYTE2(v45);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 v254 += BYTE1(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 HIDWORD(v242) += (unsigned __int8)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6743 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 if ( result != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 if ( result != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6748 if ( result != 32 || (result = (int)pDst, v196 = pDst, v234 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6750 v49 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6751 a9c = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 v50 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6755 a6g = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6756 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 LABEL_108:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6759 v196 = (unsigned __int16 *)((char *)v196 + a9c);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 ++v234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 result = v234;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6762 if ( v234 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6766 v224 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6767 v215 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6768 v51 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6769 v52 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6772 a6y = (double)a6g / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6773 v127 = a6y + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 v206 = v50 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6775 a6z = (double)(v50 + 1) / v224 * v215;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6776 v136 = a6z + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 v53 = (double)v234 / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 v145 = v53 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 v54 = (double)(v234 + 1) / v51 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 v154 = v54 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 v55 = (LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 v255 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6783 a6h = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v243 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 if ( SLODWORD(v145) < SLODWORD(v154) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 v58 = (unsigned int)v243 / ((LODWORD(v154) - LODWORD(v145)) * (LODWORD(v136) - LODWORD(v127)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6791 a6h /= v55;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 v255 /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 HIDWORD(v243) /= v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 if ( v58 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 v58 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6797 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 v60 = v196;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6799 v196 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6800 *(_DWORD *)v60 = v59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 v50 = v206;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6802 a6g = v206;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6803 if ( v206 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 v172 = LODWORD(v154) - LODWORD(v145);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6807 v187 = &pSrc[LODWORD(v127) + srcPitch * LODWORD(v145)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 while ( SLODWORD(v127) >= SLODWORD(v136) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 LABEL_102:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6811 v187 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 --v172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 if ( !v172 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 v179 = (int *)v187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 v164 = LODWORD(v136) - LODWORD(v127);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6820 v56 = *(_WORD *)v179;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 v49 = v56 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6826 v57 = _450FB1(v56);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 LODWORD(v243) = v49 + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 --v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 v179 = (int *)((char *)v179 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 --v164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 if ( !v164 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 LODWORD(v243) = ((unsigned int)v57 >> 24) + v243;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 LABEL_100:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6842 a6h += BYTE2(v57);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 v255 += BYTE1(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 HIDWORD(v243) += (unsigned __int8)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6847 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6848 v197 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 v235 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6850 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6852 v61 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6853 a9d = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 v62 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6857 a6i = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6858 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 LABEL_133:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6861 v197 = (unsigned __int16 *)((char *)v197 + a9d);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 ++v235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 result = v235;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6864 if ( v235 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6868 v225 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6869 v216 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6870 v63 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6871 v64 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6874 a6ba = (double)a6i / v225 * v216;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6875 _v128 = floorf(a6ba + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6876 //v128 = a6ba + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 v207 = v62 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6878 a6bb = (double)(v62 + 1) / v225 * v216;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6879 //v137 = a6bb + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6880 _v137 = floorf(a6bb + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 v65 = (double)v235 / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6882 //v146 = v65 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6883 _v146 = floorf(v65 + 0.5f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v66 = (double)(v235 + 1) / v63 * v64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6885 //v155 = v66 + 6.7553994e15;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6886 _v155 = floorf(v66 + 0.5f);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6887 //v67 = (LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6888 v67 = (_v155 - _v146) * (_v137 - _v128);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 v256 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6890 a6j = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 v244 = 0i64;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6892 //if ( SLODWORD(v146) < SLODWORD(v155) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6893 if (_v146 < _v155)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 LABEL_128:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6896 //v70 = (unsigned int)v244 / ((LODWORD(v155) - LODWORD(v146)) * (LODWORD(v137) - LODWORD(v128)));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6897 v70 = (unsigned int)v244 / ((_v155 - _v146) * (_v137 - _v128));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 if ( v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6900 a6j /= v67;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 v256 /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 HIDWORD(v244) /= v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 if ( v70 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 v70 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6906 v71 = _450F55(HIDWORD(v244) | ((v256 | ((a6j | (v70 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v72 = v197;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6908 ++v197;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6909 *v72 = v71;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 v62 = v207;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6911 a6i = v207;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6912 if ( v207 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 goto LABEL_133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6915 //v173 = LODWORD(v155) - LODWORD(v146);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6916 v173 = _v155 - _v146;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6917 //v188 = &pSrc[LODWORD(v128) + srcPitch * LODWORD(v146)];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6918 v188 = &pSrc[_v128 + srcPitch * _v146];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6919 //while ( SLODWORD(v128) >= SLODWORD(v137) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6920 while (_v128 >= _v137)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 LABEL_127:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6923 v188 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 --v173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 if ( !v173 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v180 = (int *)v188;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6929 //v165 = LODWORD(v137) - LODWORD(v128);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6930 v165 = _v137 - _v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6933 v68 = *(_WORD *)v180;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 v61 = v68 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6939 v69 = _450FB1(v68);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 LODWORD(v244) = v61 + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 if ( v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v180 = (int *)((char *)v180 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 --v165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 if ( !v165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 goto LABEL_127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 LODWORD(v244) = ((unsigned int)v69 >> 24) + v244;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 LABEL_125:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6955 a6j += BYTE2(v69);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 v256 += BYTE1(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 HIDWORD(v244) += (unsigned __int8)v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6960 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6961 v198 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 v236 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6963 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6965 v73 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 v74 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6969 a6k = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6970 if ( dstWidth > v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 LABEL_158:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6973 v198 = (unsigned __int16 *)((char *)v198 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 ++v236;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 result = v236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6976 if ( v236 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6980 v226 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6981 v217 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6982 v75 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6983 v76 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6986 a6bc = (double)a6k / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6987 v129 = a6bc + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 v208 = v74 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6989 a6bd = (double)(v74 + 1) / v226 * v217;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6990 v138 = a6bd + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 v77 = (double)v236 / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 v147 = v77 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 v78 = (double)(v236 + 1) / v75 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v156 = v78 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 v257 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 v79 = (LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6997 a6l = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v245 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 if ( SLODWORD(v147) < SLODWORD(v156) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 LABEL_153:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 v82 = (unsigned int)v245 / ((LODWORD(v156) - LODWORD(v147)) * (LODWORD(v138) - LODWORD(v129)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 if ( v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7005 a6l /= v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 v257 /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 HIDWORD(v245) /= v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 if ( v82 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 v82 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7011 v83 = _450F55(HIDWORD(v245) | ((v257 | ((a6l | (v82 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7012 v84 = v198;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7013 v198 = (unsigned __int16 *)((char *)v198 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7014 *(_BYTE *)v84 = v83;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 v74 = v208;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7016 a6k = v208;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7017 if ( v208 >= dstWidth )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 goto LABEL_158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 v174 = LODWORD(v156) - LODWORD(v147);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7021 v189 = &pSrc[LODWORD(v129) + srcPitch * LODWORD(v147)];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 while ( SLODWORD(v129) >= SLODWORD(v138) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 LABEL_152:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7025 v189 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 --v174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 if ( !v174 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 goto LABEL_153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 v166 = LODWORD(v138) - LODWORD(v129);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 v181 = (int *)v189;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7034 v80 = *(_WORD *)v181;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 v73 = v80 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7040 v81 = _450FB1(v80);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 if ( !v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 LODWORD(v245) = v73 + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 --v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 v181 = (int *)((char *)v181 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 --v166;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 if ( !v166 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 LODWORD(v245) = ((unsigned int)v81 >> 24) + v245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 LABEL_150:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7056 a6l += BYTE2(v81);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 v257 += BYTE1(v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 HIDWORD(v245) += (unsigned __int8)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7061 result = this->field_20.field_C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 if ( result == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7064 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7065 v201 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 v239 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7067 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7069 v111 = dstWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 v112 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7073 a6q = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7074 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 goto LABEL_236;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7076 v229 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7077 v220 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7078 v113 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7079 v114 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7082 a6bi = (double)a6q / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7083 v132 = a6bi + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 v211 = v112 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7085 a6bj = (double)(v112 + 1) / v229 * v220;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7086 v141 = a6bj + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 v115 = (double)v239 / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 v150 = v115 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 v116 = (double)(v239 + 1) / v113 * v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 v159 = v116 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 v251 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 v260 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7094 a6r = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 v248 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 if ( SLODWORD(v150) >= SLODWORD(v159) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 goto LABEL_231;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 v169 = LODWORD(v159) - LODWORD(v150);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7099 v184 = (char *)pSrc + srcPitch * LODWORD(v150);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 v118 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 v192 = LODWORD(v132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 while ( v118 < SLODWORD(v141) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7106 v119 = (unsigned __int8)v184[v192];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 v111 = v119 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7112 v120 = _450FB1(v119);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 v248 += v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 if ( !v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 --v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 goto LABEL_228;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 v248 += (unsigned int)v120 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7127 a6r += BYTE2(v120);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 v260 += BYTE1(v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 v251 += (unsigned __int8)v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 LABEL_228:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 ++v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 v118 = v192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7134 v184 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 --v169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 while ( v169 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 LABEL_231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 if ( v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7142 a6r /= v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 v260 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 v251 /= v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 if ( v121 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 v121 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7148 v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7149 v123 = v201;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7150 v201 = (unsigned __int16 *)((char *)v201 + 1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7151 *(_BYTE *)v123 = v122;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 v112 = v211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7153 a6q = v211;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7154 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7155 while ( v211 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 LABEL_236:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7157 v201 = (unsigned __int16 *)((char *)v201 + dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 ++v239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 result = v239;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7160 if ( v239 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 if ( result == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7167 result = (int)pDst;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7168 v200 = pDst;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 v238 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7170 if ( dstHeight <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7172 v98 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7173 a9f = 2 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 v99 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7177 a6o = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7178 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 goto LABEL_211;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7180 v228 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7181 v219 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7182 v100 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7183 v101 = (double)srcHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7186 a6bg = (double)a6o / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7187 v131 = a6bg + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v210 = v99 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7189 a6bh = (double)(v99 + 1) / v228 * v219;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7190 v140 = a6bh + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v102 = (double)v238 / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v149 = v102 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 v103 = (double)(v238 + 1) / v100 * v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v158 = v103 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 v250 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 v104 = (LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v259 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7198 a6p = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v247 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 if ( SLODWORD(v149) >= SLODWORD(v158) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 goto LABEL_206;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 v168 = LODWORD(v158) - LODWORD(v149);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7203 v183 = (char *)pSrc + srcPitch * LODWORD(v149);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 v105 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 v191 = LODWORD(v131);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 while ( v105 < SLODWORD(v140) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7210 v106 = (unsigned __int8)v183[v191];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 v98 = v106 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7216 v107 = _450FB1(v106);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 v247 += v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 if ( !v98 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 --v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 goto LABEL_203;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v247 += (unsigned int)v107 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7231 a6p += BYTE2(v107);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 v259 += BYTE1(v107);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 v250 += (unsigned __int8)v107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 LABEL_203:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 ++v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 v105 = v191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7238 v183 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 --v168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 while ( v168 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 LABEL_206:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 v108 = v247 / ((LODWORD(v158) - LODWORD(v149)) * (LODWORD(v140) - LODWORD(v131)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 if ( v104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7246 a6p /= v104;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 v259 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 v250 /= v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 if ( v108 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 v108 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7252 v109 = _450F55(v250 | ((v259 | ((a6p | (v108 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 v110 = v200;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7254 ++v200;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7255 *v110 = v109;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 v99 = v210;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7257 a6o = v210;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7258 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7259 while ( v210 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 LABEL_211:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7261 v200 = (unsigned __int16 *)((char *)v200 + a9f);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 ++v238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 result = v238;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7264 if ( v238 >= dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7269 if ( result != 32 || (result = (int)pDst, v199 = pDst, v237 = 0, dstHeight <= 0) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 return result;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7271 v85 = dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7272 a9e = 4 * (dstPitch - dstWidth);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 v86 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7276 a6m = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7277 if ( dstWidth <= v11 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 goto LABEL_186;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7279 v227 = (double)dstWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7280 v218 = (double)srcWidth;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7281 v87 = (double)dstHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7282 v88 = (double)srcHeight;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7283 do
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7284 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7285 a6be = (double)a6m / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7286 v130 = a6be + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v209 = v86 + 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7288 a6bf = (double)(v86 + 1) / v227 * v218;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7289 v139 = a6bf + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v89 = (double)v237 / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 v148 = v89 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 v90 = (double)(v237 + 1) / v87 * v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 v157 = v90 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 v249 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 v91 = (LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 v258 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7297 a6n = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 v246 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 if ( SLODWORD(v148) >= SLODWORD(v157) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 v167 = LODWORD(v157) - LODWORD(v148);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7302 v182 = (char *)pSrc + srcPitch * LODWORD(v148);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 v92 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 v190 = LODWORD(v130);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 while ( v92 < SLODWORD(v139) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7309 v93 = (unsigned __int8)v182[v190];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 if ( a10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 v230 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 v85 = v93 != a11 ? 0xFF : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7315 v94 = _450FB1(v93);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 if ( v230 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 v246 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 v230 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 if ( !v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 --v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 goto LABEL_178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 v246 += (unsigned int)v94 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7330 a6n += BYTE2(v94);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 v258 += BYTE1(v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 v249 += (unsigned __int8)v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 LABEL_178:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 ++v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 v92 = v190;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7337 v182 += srcPitch;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 --v167;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 while ( v167 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 v95 = v246 / ((LODWORD(v157) - LODWORD(v148)) * (LODWORD(v139) - LODWORD(v130)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 if ( v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7345 a6n /= v91;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 v258 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 v249 /= v91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 if ( v95 != 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 v95 &= 0x7FFFFFFFu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7351 v96 = _450F55(v249 | ((v258 | ((a6n | (v95 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 v97 = v199;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7353 v199 += 2;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7354 *(_DWORD *)v97 = v96;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 v86 = v209;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7356 a6m = v209;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7357 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7358 while ( v209 < dstWidth );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 LABEL_186:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7360 v199 = (unsigned __int16 *)((char *)v199 + a9e);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 ++v237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 result = v237;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7363 if ( v237 < dstHeight )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371
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
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7376
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
7377
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 //----- (0044E1EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 int TextureFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 TextureFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 const void *v5; // ST0C_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 void *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 FILE *v7; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 signed int v9; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 int v11; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 int v12; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 signed int j; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 TextureFrame *v15; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 int v16; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 int k; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 FrameTableTxtLine v20; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 int v21; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 char *Str1; // [sp+280h] [bp-84h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 char *Str; // [sp+284h] [bp-80h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 int v24; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 int v25; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 int Argsa; // [sp+30Ch] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 Abortf("CTextureFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 v25 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 if ( v21 < 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 Abortf("CTextureFrameTable::load, too few arguments, %s line %i.", Args, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 v4 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 v5 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 v2->uNumTextures = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 v2->pTextures = (TextureFrame *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 Abortf("CTextureFrameTable::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 v2->uNumTextures = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 fseek(v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 memcpy(&v21, texture_frame_table_txt_parser(&Buf, &v20), 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 if ( v21 && *Str1 != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 strcpy(v2->pTextures[v2->uNumTextures].pTextureName, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 v2->pTextures[v2->uNumTextures].uAnimTime = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 for ( v2->pTextures[v2->uNumTextures].uFlags = 0; v9 < v21; ++v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 if ( !_strcmpi((&Str1)[4 * v9], "New") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 v10 = (int)&v2->pTextures[v2->uNumTextures].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 *(char *)v10 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 ++v2->uNumTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 if ( (signed int)(v2->uNumTextures - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 v13 = (int)&v2->pTextures[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 if ( !(*(char *)(v13 + 38) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 *(char *)(v13 + 18) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 while ( v11 < (signed int)(v2->uNumTextures - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 for ( j = 0; j < (signed int)v2->uNumTextures; *(short *)(Argsa + 16) = v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 v15 = v2->pTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 Argsa = (int)&v15[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 v16 = *(short *)(Argsa + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 if ( *(char *)(Argsa + 18) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 for ( k = (int)&v15[j]; *(char *)(k + 18) & 1; k += 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 v16 += *(short *)(k + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 LOWORD(v16) = v15[j].uAnimTime + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496
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 //----- (0044F57C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 void *__fastcall SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *a2, int a3, int a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 MapInfo *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 SpawnPointMM7 *v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 char v8; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 int v9; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 int v11; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v12; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int v13; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 int v14; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int v15; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 int v16; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 int v17; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 int v18; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 int v19; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 int v20; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 Actor *v22; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 int v23; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 signed int v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 int v25; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 unsigned __int16 v26; // ax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 MonsterDesc *v27; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 signed int v28; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 __int16 v29; // cx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 __int16 v30; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 __int16 v31; // ax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 int v32; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 int v33; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 int v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 int v36; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 int v37; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 int v38; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 int v39; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 std::string v40; // [sp-18h] [bp-100h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 void *v41; // [sp-14h] [bp-FCh]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 void *v42; // [sp-10h] [bp-F8h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 size_t v43; // [sp-Ch] [bp-F4h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 const char *v44; // [sp-8h] [bp-F0h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 char *v45; // [sp-4h] [bp-ECh]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 char Str; // [sp+Ch] [bp-DCh]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 char Str2; // [sp+2Ch] [bp-BCh]@29
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7549 unsigned int uFaceID; // [sp+A4h] [bp-44h]@52
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 void *Src; // [sp+A8h] [bp-40h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 int v50; // [sp+ACh] [bp-3Ch]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 char Source; // [sp+B0h] [bp-38h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 int v52; // [sp+D0h] [bp-18h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 void *v53; // [sp+D4h] [bp-14h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 int v54; // [sp+D8h] [bp-10h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 int v55; // [sp+DCh] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 int v56; // [sp+E0h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 int v57; // [sp+E4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 v5 = pMapInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 result = (void *)pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 result = (void *)(uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 v8 = (a2->uAttributes & 1) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 result = (void *)(a2->uAttributes & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 v8 = (char)result == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 if ( !v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 result = (void *)(a2->uIndex - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 v56 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 switch ( (int)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 v9 = pMapInfo->uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 v11 = v5->uEncounterMonster1AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v45 = v5->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 v12 = v10 % (v11 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 v13 = v5->field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 v9 = pMapInfo->uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 v14 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 v15 = v5->uEncounterMonster2AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 v45 = v5->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 v12 = v14 % (v15 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 v13 = v5->field_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 v9 = pMapInfo->uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 v17 = v5->uEncounterMonster3AtMost;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 v45 = v5->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 v12 = v16 % (v17 - v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 v13 = v5->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 v57 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 v56 = v9 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 result = strcpy(&Source, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 v45 = pMapInfo->pEncounterMonster1Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 v45 = pMapInfo->pEncounterMonster2Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 v45 = pMapInfo->pEncounterMonster3Texture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 result = (void *)sprintfex(&Source, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 if ( Source == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 v57 += a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 if ( v57 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 strcpy(&Str2, &Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 v56 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v18 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 result = (void *)(v56 + uNumActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 if ( (signed int)(v56 + uNumActors) >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 v19 = v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 v20 = v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 v21 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 v55 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 a4 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 a3 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 v54 = pIndoor->GetSector(v19, v20, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 result = (void *)((((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 v52 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 if ( v18 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 v22 = &pActors[uNumActors];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 pActors[uNumActors].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 v23 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 v24 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 v25 = (unsigned __int16)word_4E8152[3 * v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 if ( v23 >= v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 if ( v23 < v25 + (unsigned __int16)word_4E8152[3 * v57 + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 v24 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 if ( v24 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 v44 = "%s A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 if ( v24 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 v44 = "%s B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 if ( v24 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 v45 = &Source;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 v44 = "%s C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 sprintfex(&Str2, v44, v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 v26 = pMonsterList->GetMonsterByName(&Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 v50 = (signed __int16)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 v45 = &Str2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 if ( (signed __int16)v26 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 sprintfex(&Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 MessageBoxA(nullptr, &Str, nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 ExitProcess(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 v27 = &pMonsterList->pMonsters[(signed __int16)v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 v28 = pMonsterStats->_4563FF(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 v28 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 Src = (char *)&pMonsterStats + 88 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 strcpy(v22->pActorName, *(const char **)Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 v43 = 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 v42 = Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 v29 = *((short *)Src + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 v41 = &v22->pMonsterInfo;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 v22->sCurrentHP = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 memcpy(v41, v42, v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 v22->word_000086_some_monster_id = v50 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 v22->uActorRadius = v27->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 v22->uActorHeight = v27->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 v22->uMovementSpeed = v27->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 v30 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 v22->vInitialPosition.x = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 v22->vPosition.x = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 v31 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 v22->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 v22->vInitialPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 v22->vPosition.y = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 v22->vInitialPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 v22->vPosition.z = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 v22->uSectorID = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 v22->uGroup = v6->uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 v22->PrepareSprites((char)v45);
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
7753 v22->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 v32 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 v33 = v32 % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v34 = stru_5C6E00->SinCos(v32 % 2048);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 a4 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 a3 = (unsigned __int64)(v34 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 v55 = a3 + v6->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 v35 = stru_5C6E00->SinCos(v33 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 a4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 a3 = (unsigned __int64)(v35 * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 a4 = a3 + v6->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 v36 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 a3 = v6->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 v37 = pIndoor->GetSector(v55, a4, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 if ( v37 == v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7771 v38 = _46CEC3_get_floor_level(v55, a4, a3, v37, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 v39 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 if ( v38 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 if ( abs(v38 - a3) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 a3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v22->uAttributes |= 0x080000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 v53 = (char *)v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 result = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 while ( (signed int)v53 < v56 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 //----- (0044FA4C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 signed int v3; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 char *v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 signed int result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 Actor *v6; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 char *v7; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 MonsterDesc *v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 unsigned __int16 v9; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 int v10; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 int v11; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 int v12; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 const char *v15; // [sp-4h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 unsigned __int16 v16; // [sp+0h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 int v17; // [sp+4h] [bp-1Ch]@1
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7816 unsigned int uFaceID; // [sp+8h] [bp-18h]@16
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 int v19; // [sp+Ch] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 size_t v20; // [sp+10h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 int v21; // [sp+14h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 int v22; // [sp+18h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 unsigned int v23; // [sp+1Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 v16 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 v17 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 if ( a2 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 v15 = "Elemental Light C";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 if ( a2 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 v15 = "Elemental Light B";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v15 = "Elemental Light A";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 v23 = (signed __int16)pMonsterList->GetMonsterByName(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 v20 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 while ( *(short *)v4 != Removed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 if ( v3 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v20 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v21 = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7855 v22 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7857 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 v6 = &pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 v7 = (char *)&pMonsterStats->pInfos[v23 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 v6->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v8 = &pMonsterList->pMonsters[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 strcpy(v6->pActorName, *(const char **)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v6->sCurrentHP = *((short *)v7 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 memcpy(&v6->pMonsterInfo, v7, 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 v6->word_000086_some_monster_id = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 v6->uActorRadius = v8->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 v6->uActorHeight = v8->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 v9 = v8->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 v6->pMonsterInfo.uTreasureDiceRolls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 v6->pMonsterInfo.uTreasureType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 v6->pMonsterInfo.uExp = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 v6->uMovementSpeed = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 v10 = rand() % 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(v10) * (signed __int64)v19) >> 16) + pParty->vPosition.x;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7876 uFaceID = stru_5C6E00->SinCos(v10 - stru_5C6E00->uIntegerHalfPi);
8453114181af intermediate
Nomad
parents: 68
diff changeset
7877 v23 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7878 v12 = pParty->vPosition.y;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7879 v13 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 v6->vInitialPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v14 = v13 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 LOWORD(v12) = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 v6->vInitialPosition.z = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 v6->vPosition.z = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 LOWORD(v12) = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 v6->vPosition.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 v6->vInitialPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 v6->vPosition.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 v6->uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 v6->uSectorID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 v6->PrepareSprites(0);
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
7892 v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 v6->uAlly = 9999;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 v6->uGroup = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 v6->uCurrentActionTime = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
7896 v6->uAIState = Summoned;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 v6->uCurrentActionLength = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 v6->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7900 || (v22 = pParty->vPosition.z,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
7901 result = pIndoor->GetSector(v11, v14, pParty->vPosition.z),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 result == v21)
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
7903 && (result = _46CEC3_get_floor_level(v11, v14, v22, result, &uFaceID), result != -30000)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 && (result = abs(result - v22), result <= 1024) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 if ( v20 == uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 ++uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 v6->uSummonerID = 8 * v17 | 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 result = v6->pActorBuffs[2].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 pParty->uTimePlayed + (signed __int64)((double)(a3 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 v17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 //----- (0044FFD8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 MapInfo *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 SpawnPointMM7 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 signed int v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 signed __int64 v12; // qtt@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 signed int v15; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 unsigned __int16 v16; // dx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 char *v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 unsigned __int16 v18; // ax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 int v19; // ST0C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 int v20; // ST08_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 int v21; // ST04_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 int v22; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 signed int v23; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 unsigned __int16 v24; // dx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 char *v25; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 unsigned __int16 v26; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 int v27; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 int v28; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 int v29; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 __int16 v30; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 int v32; // [sp+7Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 int v33; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 int v34; // [sp+84h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 v4 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 v5 = v4 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 v6 = 2 * (v2->field_2F + 7 * v3->uIndex) - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 v7 = (unsigned __int8)byte_4E8168[v6 + 16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 v8 = (unsigned __int8)byte_4E8168[v6 + 17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 v32 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 v9 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 v10 = v8 - v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 v12 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 result = v9 / v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 v13 = v33 + (unsigned __int64)(v12 % v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 if ( v13 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 if ( v32 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 if ( v32 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 v19 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 v20 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 v21 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 v22 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 if ( v3->uIndex == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v14 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 if ( v3->uIndex != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 if ( v3->uIndex == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 v14 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 if ( v3->uIndex != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 if ( v3->uIndex == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 v14 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 if ( v3->uIndex != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v18 = 0;
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 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 while ( v16 != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 if ( v15 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 v18 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
8032 a1a.stru_24.uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 a1a.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 a1a.stru_24.uAdditionalValue = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 v14 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 a1a.stru_24.uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 v14 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 a1a.stru_24.uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 v14 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 a1a.stru_24.uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 result = a1a.stru_24.GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 while ( v24 != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 if ( v23 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 v26 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 a1a.uObjectDescID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 a1a.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 v27 = v3->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 v28 = v3->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 v29 = v3->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 a1a.vPosition.y = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 a1a.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 a1a.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 a1a.uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 a1a.vPosition.z = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 a1a.vPosition.x = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 a1a.field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 a1a.field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 a1a.field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v30 = pIndoor->GetSector(v28, v27, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 a1a.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 a1a.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 a1a.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 a1a.uSectorID = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 return a1a.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 //----- (00450218) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 void __cdecl sub_450218_prolly_generate_chests_loot()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 Chest *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 MapInfo *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 ItemGen *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 signed int v8; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 int v10; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 int v11; // ebp@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 signed int v13; // ebp@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 ItemGen *v14; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 signed int v15; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 signed __int64 v16; // qtt@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 int v17; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 signed int v18; // [sp+10h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 int v19; // [sp+14h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 MapInfo *v20; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 Chest *v21; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 int v22; // [sp+20h] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 signed int v23; // [sp+24h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 v18 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 v0 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 v1 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 v2 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 v21 = pChests;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 v20 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 v3 = v1->mm7__vector_pItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 v23 = 140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 if ( (v3->uItemID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 v4 = rand() % 5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 v5 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 v6 = (unsigned __int8)byte_4E8168[2 * (v2->field_2F + 7 * abs((int)v3->uItemID)) + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 v7 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 v8 = v6 - v5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 v9 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 v19 = v5 + v7 % v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 if ( v9 < 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 if ( v18 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 if ( v18 < 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 v3->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 v10 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 if ( v19 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 v10 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 if ( v19 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 v10 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 v3->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 v10 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 LABEL_23:
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
8191 v3->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 v3->uAdditionalValue = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 v11 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 if ( v11 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 v22 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 if ( v12 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 v14 = &v21->mm7__vector_pItems[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 while ( v14->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 if ( v13 >= 140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 v16 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v15 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v18 = v16 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 if ( v15 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 if ( v15 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 pItemsTable->GenerateItem(v19, 0, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v14->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 if ( v19 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 v17 = rand() % 51 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 if ( v19 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 v17 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 v14->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 if ( v19 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 v17 = rand() % 301 + 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 if ( v19 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v17 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 v14->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 if ( v19 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 if ( v19 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 v17 = rand() % 3001 + 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 v14->uItemID = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v14->uAdditionalValue = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 v12 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 --v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 v17 = rand() % 1001 + 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 v10 = rand() % 501 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 v3->uItemID = 198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 v10 = rand() % 101 + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 v3->uItemID = 197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 pItemsTable->GenerateItem(v9, 0, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v3->GenerateArtifact();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 v2 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 --v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 while ( v23 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 v1 = v21 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 while ( (signed int)v21 < (signed int)&uNumChests );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 //----- (00450521) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 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
8299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 signed int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 unsigned __int16 v9; // cx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 char *v10; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 unsigned __int16 v11; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 LayingItem a1; // [sp+8h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 v6 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 pItemsTable->GenerateItem(v6, v7, &a1.stru_24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 a1.uItemType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 v10 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 while ( v9 != *(short *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 v10 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 if ( v8 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 a1.uObjectDescID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 a1.vPosition.y = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 a1.vPosition.x = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 a1.vPosition.z = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 a1.uFacing = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 a1.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 a1.uSectorID = pIndoor->GetSector(a3, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 return a1.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 //----- (0045063B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 int __fastcall sub_45063B(MapInfo *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 Actor *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 signed __int64 v4; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 int v6; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 int v9; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 int v12; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 int v13; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 int v14; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 int v16; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 int v17; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 int v20; // [sp+24h] [bp-20h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 MapInfo *v21; // [sp+28h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 int v22; // [sp+2Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 int v23; // [sp+30h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 int v24; // [sp+34h] [bp-10h]@1
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8371 unsigned int uFaceID; // [sp+38h] [bp-Ch]@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 int v26; // [sp+3Ch] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 int v27; // [sp+40h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 v24 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 v3 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 v22 = v3->pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 v4 = (signed __int64)((double)v22 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 if ( (int)v4 != 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 if ( v2 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v22 = 0;
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8398 uFaceID = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8401 ++uFaceID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 v6 = rand() % 1024 + 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 v20 = stru_5C6E00->SinCos(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 v20 = stru_5C6E00->SinCos(v7 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 v23 = (unsigned __int64)(v20 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 v19.uIndex = v24;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8411 v19.vPosition.y = v23 + pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8412 v19.vPosition.z = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 v19.vPosition.z = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 v19.vPosition.x,
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8417 v23 + pParty->vPosition.y,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8418 pParty->vPosition.z,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 &v26,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 &v27,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 v9 = abs(v19.vPosition.y - pOutdoor->pBModels[v8].vBoundingCenter.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v10 = abs(v19.vPosition.x - pOutdoor->pBModels[v8].vBoundingCenter.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 if ( sub_4621DA(v10, v9, 0) < pOutdoor->pBModels[v8].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 if ( v23 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 LABEL_16:
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8440 v11 = uFaceID == 100;
8453114181af intermediate
Nomad
parents: 68
diff changeset
8441 if ( uFaceID >= 100 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8445 v11 = uFaceID == 100;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 v26 = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8453 v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 v12 = rand() % 512 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 v13 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 v15 = stru_5C6E00->SinCos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 v20 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 v23 = (unsigned __int64)(v15 * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 v19.vPosition.x = pParty->vPosition.x + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 v16 = stru_5C6E00->SinCos(v14 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 v20 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 v23 = (unsigned __int64)(v16 * (signed __int64)v12) >> 16;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8467 v19.vPosition.y = v23 + pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8468 v19.vPosition.z = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 v19.uIndex = v24;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8470 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 if ( v17 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 {
71
8453114181af intermediate
Nomad
parents: 68
diff changeset
8473 v18 = _46CEC3_get_floor_level(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 v19.vPosition.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 if ( v18 != -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
8477 if ( abs(v18 - pParty->vPosition.z) <= 1024 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 while ( v26 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 v11 = v26 == 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 SpawnEncounter(v21, &v19, 0, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 result = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 //----- (00450929) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 int LevelDecoration::GetGlobalEvent()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 LevelDecoration *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 signed int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 int v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 int v4; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 int v9; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 int v12; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 int v13; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 v2 = v1->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 if ( v2 > 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 switch ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 case 209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 result = rand() % 7 + 183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 case 210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 result = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 case 211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 result = 151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 case 212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 result = 152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 case 213:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 result = 153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 case 214:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 result = 154;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 case 215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 result = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 case 216:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 result = 156;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 case 217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 result = 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 case 218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 result = 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 case 219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 result = 159;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 result = 160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 case 221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 result = 161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 if ( v2 == 208 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 result = rand() % 7 + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 if ( v2 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 v9 = v2 - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 return rand() % 6 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 v10 = v9 - 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 return 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 v11 = v10 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 if ( !v11 || (v12 = v11 - 3) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 return 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 v13 = v12 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 return rand() % 7 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 if ( v13 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 return rand() % 7 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 if ( v2 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 return 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 v3 = v2 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 return 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 v4 = v3 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 return 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 v5 = v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 return rand() % 4 + 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 v6 = v5 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 return 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 v7 = v6 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 return 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 if ( v7 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 return 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 //----- (00450AAA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 void *__cdecl RespawnGlobalDecorations()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 LevelDecoration *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 result = memset(stru_5E4C90.field_4B, 0, 0x7Du);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 v3 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 if ( !v3->field_16_event_id )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 result = (void *)v3->IsInteractive();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 if ( v0 < 124 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 v3->field_1C = v0 + 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 stru_5E4C90.field_4B[v0++] = v3->GetGlobalEvent();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 while ( v2 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 //----- (00450B0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 bool __fastcall SpawnActor(unsigned int uMonsterID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 MonsterDesc *v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 MonsterInfo *v4; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 Vec3_int_ v5; // ST08_12@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 unsigned int v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 Actor *v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 Actor actor; // [sp+4h] [bp-350h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 v1 = uMonsterID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 if ( uNumActors == 499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 v3 = &pMonsterList->pMonsters[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 v4 = &pMonsterStats->pInfos[v1 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 memset(&actor, 0, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 strcpy(actor.pActorName, v4->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 actor.sCurrentHP = LOWORD(v4->uHP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 actor.word_000086_some_monster_id = v1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 actor.uActorRadius = v3->uMonsterRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 actor.uActorHeight = v3->uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 actor.uMovementSpeed = v3->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 v5 = pParty->vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 actor.vInitialPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 actor.vPosition.x = pOut.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 actor.uTetherDistance = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 actor.vInitialPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 actor.vPosition.y = LOWORD(pOut.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 actor.vInitialPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 actor.vPosition.z = LOWORD(pOut.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 pSprites_LOD->DeleteSomeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 pPaletteManager->ResetNonTestLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 v6 = uNumActors - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 if ( dword_5C6DF8 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 dword_5C6DF8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 v6 = uNumActors++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 v7 = &pActors[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 memcpy(v7, &actor, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 v7->PrepareSprites(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 // 5C6DF8: using guessed type int dword_5C6DF8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 //----- (00450DA3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 int __cdecl GetAlertStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 result = pOutdoor->ddm.field_C_alert;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 //----- (00450DDE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 stru350 *stru350::_450DDE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8733 _450DF1(&stru_4E82A4, &stru_4E82A4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 return this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8737
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 //----- (00450DF1) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8739 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8740 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8741 //stru350 *v3; // esi@1
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8742 //void *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 unsigned int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 int v6; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 int v7; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 unsigned int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 int v9; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 int v10; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 int v11; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 int v12; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 unsigned int v13; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 int v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 unsigned int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 int v18; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 char v19; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 unsigned int v20; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 int v21; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 unsigned int v23; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 int v24; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 int v25; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 int v26; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 int v27; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 unsigned int v28; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 int v29; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 int v30; // ebx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 int v31; // ecx@35
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8770 int v32; // edi@35
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 int v33; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 unsigned int i; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 int v35; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 unsigned int v36; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 int v37; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 int v38; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8778 //v3 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8779 memcpy(&field_0, p1, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8780 memcpy(&field_20, p2, sizeof(stru355));
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8781 //result = memcpy(&v3->field_20, p2, 0x20u);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8782 //LOBYTE(result) = 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8783 if (field_0.field_4 & 1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8784 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8785 v5 = field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 while ( !(v5 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 v5 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 while ( v5 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8799 field_40 = 32 - v7 - v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8800 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8801 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8802 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8803 field_40 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8804 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8805 v8 = field_0.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 while ( !(v8 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 v8 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 while ( v8 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 v11 = 24 - v10 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8821 field_48 = v11;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8822 v13 = field_0.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 while ( !(v13 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 v13 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 while ( v13 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 v15 = 16 - v14;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8836 v16 = field_0.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8837 field_50 = v15 - v12;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 while ( !(v16 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 v16 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 while ( v16 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8851 v19 = (field_20.field_4 & 1) == 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8852 field_58 = v17 - v18 + 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8855 field_44 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8856 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8857 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8858 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8859 v20 = field_20.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 while ( !(v20 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 v20 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 while ( v20 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8873 field_44 = 32 - v22 - v21;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8874 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8875 v23 = field_20.field_10;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 while ( !(v23 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 v23 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 while ( v23 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 v26 = 24 - v25 - v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8891 field_4C = v26;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8892 v28 = field_20.field_14;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 while ( !(v28 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 v28 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 while ( v28 & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 v31 = 16 - v29 - v27;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8907 v32 = field_20.field_18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8908 field_54 = v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 for ( i = v32; !(i & 1); i >>= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 i >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 while ( i & 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 v35 = 32 - v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 v36 = v32;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8920 field_5C = v35 - v30;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 while ( !(v36 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 v36 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 while ( v36 & 1 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8934 field_5C = v37 - v38 + 8;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8935 return true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8936 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8937
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 //----- (00450F55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 unsigned int stru350::_450F55(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8944 int v2 = a2 & stru_4E82A4.field_1C;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8945 if (field_20.field_4 & 1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 v2 = (unsigned int)v2 >> this->field_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8947 return v2 & field_20.field_1C |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8948 field_20.field_10 & ((a2 & (unsigned int)stru_4E82A4.field_10) >> field_4C) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8949 field_20.field_14 & ((a2 & (unsigned int)stru_4E82A4.field_14) >> field_54) |
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8950 field_20.field_18 & ((a2 & (unsigned int)stru_4E82A4.field_18) >> field_5C);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8951 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 //----- (00450FB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 int stru350::_450FB1(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8956 int v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8957 int v4 = field_0.field_4 & 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8959 v2 = a2 & field_0.field_1C;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 if ( v4 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8961 v2 <<= field_40;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
8962 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
8963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 //----- (00452442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 int v4; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 __int16 v5; // ST14_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 __int16 v6; // dx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 __int16 v8; // ST10_2@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 unsigned __int16 v10; // dh@1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 int v12; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 __int16 a3a; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 v5 = a2 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 v6 = (unsigned __int16)a4 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 v8 = a1 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 a3a = (unsigned __int16)a3 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 LOWORD(v7) = a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 LOWORD(v7) = a3a & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 LOWORD(v9) = v9 & 0x1C00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 v11 = v7 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 LOWORD(v7) = v5 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 v12 = v7 + v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 LOWORD(v7) = v8 & 0xE0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 return ((v8 & 7) + (v5 & 7) + (a3a & 7) + (v6 & 7)) | (v7 + v12) | ((v8 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 + (v5 & 0x1C00)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 + v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 //----- (0045281E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 // Calculates atan2(y/x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 // return value: angle in integer format (multiplier of Pi/1024)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 unsigned int stru193_math::Atan2(int x, int y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9006 signed int quadrant;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9007 __int64 dividend;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9008 int quotient;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9009 int lowIdx;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9010 int highIdx;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9011 int angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9012
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9013 auto X = x;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9014 auto Y = y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9015
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9016 if ( abs(X) < 65536 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9017 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9018 if ( (abs(Y) >> 15) >= abs(X) )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9019 X = 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9020 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9021
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9022 if ( !X )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9023 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9024 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9025 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9026 return uIntegerHalfPi; //Pi/2
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9027 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9028 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9029 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9030 return uIntegerHalfPi + uIntegerPi; //3*(Pi/2)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9031 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9032 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9033
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9034 if ( Y )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9035 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9036 if ( X < 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9037 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9038 X = -X;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9039 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9040 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9041 quadrant = 4;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9042 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9043 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9044 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9045 quadrant = 3;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9046 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9050 if ( Y > 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9051 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9052 quadrant = 1;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9053 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9054 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9055 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9056 quadrant = 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9057 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9058 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9059
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9060 if ( Y < 0 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9061 Y = -Y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9062
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9063 LODWORD(dividend) = Y << 16;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9064 HIDWORD(dividend) = Y >> 16;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9065 quotient = dividend / X;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9066
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9067 //looks like binary search
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9068 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9069 int i;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9070 highIdx = uIntegerHalfPi;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9071 lowIdx = 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9072
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9073 for (i = 0; i < 6; ++i)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9074 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9075 if (quotient <= pTanTable[(lowIdx + highIdx) / 2])
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9076 highIdx = (lowIdx + highIdx) / 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9077 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9078 lowIdx = (lowIdx + highIdx) / 2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9079 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9080 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9081
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9082 angle = lowIdx + 1;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9083 while ( angle < (highIdx - 1) && quotient >= pTanTable[angle] )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9084 ++angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9085
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9086 switch (quadrant)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9087 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9088 case 1: //X > 0, Y > 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9089 return angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9090
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9091 case 2: //X > 0, Y < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9092 return uIntegerDoublePi - angle; //2*Pi - angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9093
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9094 case 3: //X > 0, Y < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9095 return uIntegerPi + angle; //Pi + angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9096
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9097 case 4: //X < 0, Y > 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9098 return uIntegerPi - angle; //Pi - angle
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9099 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9100
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9101 //should newer get here
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9102 return 0;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9103 }
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9104
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9105 if ( X < 0 ) //Y == 0, X < 0
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9106 return uIntegerPi;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9107
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
9108 return 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 //----- (00452969) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 stru193_math::stru193_math()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 stru193_math *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 double v3; // ST18_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 signed int v7; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 this->uIntegerDoublePi = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 this->uIntegerPi = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 this->uIntegerHalfPi = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 this->uDoublePiMask = 2047;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 this->uPiMask = 1023;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 this->uHalfPiMask = 511;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 this->pTanTable[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 this->pCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 this->pInvCosTable[0] = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 v2 = (char *)&this->pInvCosTable[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 v3 = (double)v7 * 3.141592653589793 * 0.0009765625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 *((int *)v2 - 1040) = (signed __int64)(tan(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 *((int *)v2 - 520) = (signed __int64)(cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 *(int *)v2 = (signed __int64)(1.0 / cos(v3) * (double)v1->pCosTable[0] + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 while ( v7 < (signed int)v1->uIntegerHalfPi );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 v4 = v1->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 if ( v4 < 520 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 v5 = (int)&v1->pCosTable[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 v6 = 520 - v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 *(int *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 *(int *)(v5 + 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 *(int *)(v5 - 2080) = 0xEFFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 v5 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 //----- (00452A9E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 signed int __fastcall sub_452A9E(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 int v2; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 signed int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 if ( a1 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 v4 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 result *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 v2 = ((unsigned int)v3 >> 30) | 4 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 v5 = 2 * result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 v3 *= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 if ( v2 >= (unsigned int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 v2 -= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 if ( a1 - result * result >= (unsigned int)(result - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 //----- (00452AE2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 int __fastcall MakeColorMaskFromBitDepth(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 signed __int64 v1; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 v1 = 4294967296i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 if ( a1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 LODWORD(v1) = HIDWORD(v1) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 HIDWORD(v1) *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 --a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 while ( a1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 //----- (00452AF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 void *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 unsigned __int16 *v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 unsigned int i; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 v4 = a1 | (a1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 *pPixels = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 v3 = pPixels + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 --uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 for ( i = uNumPixels & 1; i; --i ) // leftover pixels
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 *v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 //----- (00452B2E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 unsigned int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 v2 = uDiceSides;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 if ( uDiceSides )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 if ( (signed int)uNumDice > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 v5 = uNumDice;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 v3 += rand() % v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 //----- (00452B95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 void __cdecl SetSomeItemsNames()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 memset(&stru_5E4C50, 0, sizeof(stru_5E4C50));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 //----- (00452C30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 char *RemoveQuotes(char *Str)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 if ( *Str == '"' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 Str[strlen(Str) - 1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 v1 = Str + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 //----- (00452C49) --------------------------------------------------------
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
9314 void InitializeGameText()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 //char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 char *v1; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 int v2; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 //char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 //v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 if (pGlobalTXT_Raw)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 pAllocator->FreeChunk(pGlobalTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 pGlobalTXT_Raw = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 pGlobalTXT_Raw = (char *)pEvents_LOD->LoadRaw("global.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 strtok(pGlobalTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 strtok(nullptr, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 v1 = strtok(nullptr, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 for (uint i = 0; i < 677; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 char *p = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 while (*++p != '\t' && *p);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 pGlobalTXT_LocalizationStrings[i] = RemoveQuotes(p + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 aMonthNames[2] = pGlobalTXT_LocalizationStrings[417];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 pSomeItemsNames[10] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 aMonthNames[3] = pGlobalTXT_LocalizationStrings[418];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 pSomeItemsNames[11] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 aMonthNames[4] = pGlobalTXT_LocalizationStrings[419];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 pSomeItemsNames[12] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 aMonthNames[5] = pGlobalTXT_LocalizationStrings[420];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 pSomeItemsNames[13] = pGlobalTXT_LocalizationStrings[143];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 aMonthNames[6] = pGlobalTXT_LocalizationStrings[421];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 aCharacterConditionNames[0] = pGlobalTXT_LocalizationStrings[52];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 aMonthNames[7] = pGlobalTXT_LocalizationStrings[422];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 aCharacterConditionNames[1] = pGlobalTXT_LocalizationStrings[241];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 aMonthNames[8] = pGlobalTXT_LocalizationStrings[423];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 aCharacterConditionNames[2] = pGlobalTXT_LocalizationStrings[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 aMonthNames[9] = pGlobalTXT_LocalizationStrings[424];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 aCharacterConditionNames[3] = pGlobalTXT_LocalizationStrings[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 aMonthNames[10] = pGlobalTXT_LocalizationStrings[425];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 aCharacterConditionNames[4] = pGlobalTXT_LocalizationStrings[69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 aMonthNames[11] = pGlobalTXT_LocalizationStrings[426];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 aCharacterConditionNames[5] = pGlobalTXT_LocalizationStrings[117];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 pSomeItemsNames[0] = pGlobalTXT_LocalizationStrings[568];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 aCharacterConditionNames[6] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 aCharacterConditionNames[8] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 aCharacterConditionNames[10] = pGlobalTXT_LocalizationStrings[166];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 pSomeItemsNames[5] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 aCharacterConditionNames[12] = pGlobalTXT_LocalizationStrings[162];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 pSomeItemsNames[6] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 aCharacterConditionNames[13] = pGlobalTXT_LocalizationStrings[231];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 pSomeItemsNames[7] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 aCharacterConditionNames[14] = pGlobalTXT_LocalizationStrings[58];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 pSomeItemsNames[8] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 aCharacterConditionNames[15] = pGlobalTXT_LocalizationStrings[220];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 pSomeItemsNames[1] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 pSomeItemsNames[2] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 pSomeItemsNames[3] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 pSomeItemsNames[4] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 pSomeItemsNames[9] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 aCharacterConditionNames[7] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 aCharacterConditionNames[9] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 aCharacterConditionNames[11] = pGlobalTXT_LocalizationStrings[65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 aCharacterConditionNames[16] = pGlobalTXT_LocalizationStrings[76];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 pClassNames[9] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 pClassNames[10] = pGlobalTXT_LocalizationStrings[432];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 pClassNames[11] = pGlobalTXT_LocalizationStrings[27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 pClassNames[12] = pGlobalTXT_LocalizationStrings[262];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 pClassNames[13] = pGlobalTXT_LocalizationStrings[263];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 pClassNames[14] = pGlobalTXT_LocalizationStrings[264];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 pClassNames[15] = pGlobalTXT_LocalizationStrings[28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 pClassNames[16] = pGlobalTXT_LocalizationStrings[265];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 pClassNames[17] = pGlobalTXT_LocalizationStrings[267];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 pClassNames[18] = pGlobalTXT_LocalizationStrings[119];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 pClassNames[19] = pGlobalTXT_LocalizationStrings[124];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 pClassNames[20] = pGlobalTXT_LocalizationStrings[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 pClassNames[21] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 pClassNames[22] = pGlobalTXT_LocalizationStrings[33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 aCharacterConditionNames[17] = pGlobalTXT_LocalizationStrings[601];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 pClassNames[23] = pGlobalTXT_LocalizationStrings[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 aCharacterConditionNames[18] = pGlobalTXT_LocalizationStrings[98];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 pClassNames[24] = pGlobalTXT_LocalizationStrings[256];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 pClassNames[0] = pGlobalTXT_LocalizationStrings[253];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 pClassNames[25] = pGlobalTXT_LocalizationStrings[257];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 pClassNames[1] = pGlobalTXT_LocalizationStrings[254];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 pClassNames[26] = pGlobalTXT_LocalizationStrings[44];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 pClassNames[2] = pGlobalTXT_LocalizationStrings[255];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 pClassNames[27] = pGlobalTXT_LocalizationStrings[46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 pClassNames[3] = pGlobalTXT_LocalizationStrings[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 pClassNames[28] = pGlobalTXT_LocalizationStrings[268];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 pClassNames[4] = pGlobalTXT_LocalizationStrings[307];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 pClassNames[29] = pGlobalTXT_LocalizationStrings[269];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 pClassNames[5] = pGlobalTXT_LocalizationStrings[114];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 pClassNames[30] = pGlobalTXT_LocalizationStrings[270];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 pClassNames[6] = pGlobalTXT_LocalizationStrings[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 pClassNames[31] = pGlobalTXT_LocalizationStrings[48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 pClassNames[7] = pGlobalTXT_LocalizationStrings[13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 pClassNames[32] = pGlobalTXT_LocalizationStrings[259];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 pClassNames[8] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 pClassNames[33] = pGlobalTXT_LocalizationStrings[260];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 pClassNames[34] = pGlobalTXT_LocalizationStrings[261];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 pClassNames[35] = pGlobalTXT_LocalizationStrings[49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 pSkillNames[0] = pGlobalTXT_LocalizationStrings[271];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 pSkillNames[1] = pGlobalTXT_LocalizationStrings[272];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 pSkillNames[2] = pGlobalTXT_LocalizationStrings[273];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 pSkillNames[3] = pGlobalTXT_LocalizationStrings[274];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 pSkillNames[4] = pGlobalTXT_LocalizationStrings[275];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 pSkillNames[5] = pGlobalTXT_LocalizationStrings[276];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 pSkillNames[6] = pGlobalTXT_LocalizationStrings[277];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 pSkillNames[7] = pGlobalTXT_LocalizationStrings[278];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 pSkillNames[23] = pGlobalTXT_LocalizationStrings[294];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 pSkillNames[9] = pGlobalTXT_LocalizationStrings[280];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 pSkillNames[24] = pGlobalTXT_LocalizationStrings[295];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 pSkillNames[10] = pGlobalTXT_LocalizationStrings[281];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 pSkillNames[25] = pGlobalTXT_LocalizationStrings[296];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 pSkillNames[11] = pGlobalTXT_LocalizationStrings[282];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 pSkillNames[26] = pGlobalTXT_LocalizationStrings[297];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 pSkillNames[12] = pGlobalTXT_LocalizationStrings[283];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 pSkillNames[27] = pGlobalTXT_LocalizationStrings[298];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 pSkillNames[13] = pGlobalTXT_LocalizationStrings[284];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 pSkillNames[28] = pGlobalTXT_LocalizationStrings[299];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 pSkillNames[14] = pGlobalTXT_LocalizationStrings[285];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 pSkillNames[29] = pGlobalTXT_LocalizationStrings[300];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 pSkillNames[15] = pGlobalTXT_LocalizationStrings[286];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 pSkillNames[30] = pGlobalTXT_LocalizationStrings[50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 pSkillNames[16] = pGlobalTXT_LocalizationStrings[289];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 pSkillNames[31] = pGlobalTXT_LocalizationStrings[77];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 aDayNames[0] = pGlobalTXT_LocalizationStrings[145];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 pSkillNames[17] = pGlobalTXT_LocalizationStrings[290];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 pSkillNames[32] = pGlobalTXT_LocalizationStrings[88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 aDayNames[1] = pGlobalTXT_LocalizationStrings[230];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 pSkillNames[18] = pGlobalTXT_LocalizationStrings[291];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 pSkillNames[33] = pGlobalTXT_LocalizationStrings[89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 aDayNames[2] = pGlobalTXT_LocalizationStrings[243];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 pSkillNames[19] = pGlobalTXT_LocalizationStrings[287];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 pSkillNames[34] = pGlobalTXT_LocalizationStrings[90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 aDayNames[3] = pGlobalTXT_LocalizationStrings[227];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 pSkillNames[20] = pGlobalTXT_LocalizationStrings[288];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 pSkillNames[35] = pGlobalTXT_LocalizationStrings[95];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 aDayNames[4] = pGlobalTXT_LocalizationStrings[91];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 pSkillNames[21] = pGlobalTXT_LocalizationStrings[292];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 pSkillNames[36] = pGlobalTXT_LocalizationStrings[301];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 aDayNames[5] = pGlobalTXT_LocalizationStrings[188];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 pSkillNames[8] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 pSkillNames[22] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 pSkillNames[37] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 aDayNames[6] = pGlobalTXT_LocalizationStrings[222];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 aNPCProfessionNames[0] = pGlobalTXT_LocalizationStrings[153];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 aNPCProfessionNames[1] = pGlobalTXT_LocalizationStrings[308];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 aNPCProfessionNames[2] = pGlobalTXT_LocalizationStrings[309];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 aNPCProfessionNames[3] = pGlobalTXT_LocalizationStrings[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 aNPCProfessionNames[4] = pGlobalTXT_LocalizationStrings[306];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 aNPCProfessionNames[5] = pGlobalTXT_LocalizationStrings[310];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 aNPCProfessionNames[6] = pGlobalTXT_LocalizationStrings[311];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 aNPCProfessionNames[7] = pGlobalTXT_LocalizationStrings[312];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 aSpellSchoolNames[0] = pGlobalTXT_LocalizationStrings[87];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 aNPCProfessionNames[8] = pGlobalTXT_LocalizationStrings[313];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 aSpellSchoolNames[1] = pGlobalTXT_LocalizationStrings[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 aNPCProfessionNames[9] = pGlobalTXT_LocalizationStrings[314];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 aNPCProfessionNames[21] = pGlobalTXT_LocalizationStrings[293];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 aNPCProfessionNames[10] = pGlobalTXT_LocalizationStrings[105];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 aSpellSchoolNames[2] = pGlobalTXT_LocalizationStrings[240];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 aNPCProfessionNames[11] = pGlobalTXT_LocalizationStrings[315];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 aNPCProfessionNames[22] = pGlobalTXT_LocalizationStrings[324];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 aNPCProfessionNames[12] = pGlobalTXT_LocalizationStrings[316];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 aSpellSchoolNames[3] = pGlobalTXT_LocalizationStrings[70];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 aNPCProfessionNames[13] = pGlobalTXT_LocalizationStrings[317];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 aNPCProfessionNames[23] = pGlobalTXT_LocalizationStrings[498];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 aSpellSchoolNames[4] = pGlobalTXT_LocalizationStrings[214];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 aNPCProfessionNames[14] = pGlobalTXT_LocalizationStrings[115];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 aNPCProfessionNames[24] = pGlobalTXT_LocalizationStrings[525];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 aSpellSchoolNames[5] = pGlobalTXT_LocalizationStrings[142];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 aNPCProfessionNames[15] = pGlobalTXT_LocalizationStrings[318];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 aNPCProfessionNames[25] = pGlobalTXT_LocalizationStrings[327];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 aSpellSchoolNames[6] = pGlobalTXT_LocalizationStrings[29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 aNPCProfessionNames[16] = pGlobalTXT_LocalizationStrings[319];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 aNPCProfessionNames[26] = pGlobalTXT_LocalizationStrings[328];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 aSpellSchoolNames[7] = pGlobalTXT_LocalizationStrings[133];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 aNPCProfessionNames[17] = pGlobalTXT_LocalizationStrings[320];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 aNPCProfessionNames[27] = pGlobalTXT_LocalizationStrings[329];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 aSpellSchoolNames[8] = pGlobalTXT_LocalizationStrings[54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 aNPCProfessionNames[18] = pGlobalTXT_LocalizationStrings[321];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 aNPCProfessionNames[28] = pGlobalTXT_LocalizationStrings[330];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 aAMPMNames[0] = pGlobalTXT_LocalizationStrings[472];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 aNPCProfessionNames[19] = pGlobalTXT_LocalizationStrings[322];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 aNPCProfessionNames[29] = pGlobalTXT_LocalizationStrings[331];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 aAMPMNames[1] = pGlobalTXT_LocalizationStrings[473];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 aNPCProfessionNames[20] = pGlobalTXT_LocalizationStrings[323];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 aNPCProfessionNames[30] = pGlobalTXT_LocalizationStrings[332];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 aNPCProfessionNames[31] = pGlobalTXT_LocalizationStrings[333];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 aNPCProfessionNames[32] = pGlobalTXT_LocalizationStrings[334];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 aNPCProfessionNames[33] = pGlobalTXT_LocalizationStrings[335];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 aNPCProfessionNames[34] = pGlobalTXT_LocalizationStrings[336];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 aNPCProfessionNames[35] = pGlobalTXT_LocalizationStrings[337];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 aNPCProfessionNames[36] = pGlobalTXT_LocalizationStrings[338];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 aNPCProfessionNames[37] = pGlobalTXT_LocalizationStrings[339];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 aNPCProfessionNames[38] = pGlobalTXT_LocalizationStrings[340];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 aNPCProfessionNames[39] = pGlobalTXT_LocalizationStrings[341];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 aNPCProfessionNames[40] = pGlobalTXT_LocalizationStrings[342];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 aNPCProfessionNames[56] = pGlobalTXT_LocalizationStrings[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 aNPCProfessionNames[41] = pGlobalTXT_LocalizationStrings[343];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 aNPCProfessionNames[57] = pGlobalTXT_LocalizationStrings[600];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 aNPCProfessionNames[42] = pGlobalTXT_LocalizationStrings[596];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 aNPCProfessionNames[58] = pGlobalTXT_LocalizationStrings[370];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 aNPCProfessionNames[43] = pGlobalTXT_LocalizationStrings[345];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 aMoonPhaseNames[0] = pGlobalTXT_LocalizationStrings[150];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 aNPCProfessionNames[44] = pGlobalTXT_LocalizationStrings[346];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 aMoonPhaseNames[1] = pGlobalTXT_LocalizationStrings[171];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 aNPCProfessionNames[45] = pGlobalTXT_LocalizationStrings[347];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 aNPCProfessionNames[46] = pGlobalTXT_LocalizationStrings[348];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 aNPCProfessionNames[47] = pGlobalTXT_LocalizationStrings[349];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 aNPCProfessionNames[48] = pGlobalTXT_LocalizationStrings[350];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 aAttributeNames[0] = pGlobalTXT_LocalizationStrings[144];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 aNPCProfessionNames[49] = pGlobalTXT_LocalizationStrings[597];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 aAttributeNames[1] = pGlobalTXT_LocalizationStrings[116];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 aNPCProfessionNames[50] = pGlobalTXT_LocalizationStrings[352];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 aAttributeNames[2] = pGlobalTXT_LocalizationStrings[163];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 aNPCProfessionNames[51] = pGlobalTXT_LocalizationStrings[353];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 aAttributeNames[3] = pGlobalTXT_LocalizationStrings[75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 aNPCProfessionNames[52] = pGlobalTXT_LocalizationStrings[598];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 aAttributeNames[4] = pGlobalTXT_LocalizationStrings[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 aNPCProfessionNames[53] = pGlobalTXT_LocalizationStrings[344];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 aAttributeNames[5] = pGlobalTXT_LocalizationStrings[211];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 aNPCProfessionNames[54] = pGlobalTXT_LocalizationStrings[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 aAttributeNames[6] = pGlobalTXT_LocalizationStrings[136];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 aNPCProfessionNames[55] = pGlobalTXT_LocalizationStrings[599];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 aSpellNames[14] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 aSpellNames[33] = pGlobalTXT_LocalizationStrings[279];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 aSpellNames[9] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 aSpellNames[34] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 aSpellNames[0] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 aSpellNames[10] = pGlobalTXT_LocalizationStrings[218];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 aSpellNames[20] = pGlobalTXT_LocalizationStrings[202];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 aSpellNames[35] = pGlobalTXT_LocalizationStrings[235];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 aSpellNames[11] = pGlobalTXT_LocalizationStrings[217];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 aSpellNames[21] = pGlobalTXT_LocalizationStrings[443];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 aSpellNames[36] = pGlobalTXT_LocalizationStrings[246];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 aSpellNames[12] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 aSpellNames[24] = pGlobalTXT_LocalizationStrings[221];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 aSpellNames[37] = pGlobalTXT_LocalizationStrings[247];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 aSpellNames[13] = pGlobalTXT_LocalizationStrings[462];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 aSpellNames[26] = pGlobalTXT_LocalizationStrings[228];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 aSpellNames[38] = pGlobalTXT_LocalizationStrings[248];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 aSpellNames[15] = pGlobalTXT_LocalizationStrings[442];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 aSpellNames[28] = pGlobalTXT_LocalizationStrings[440];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 aSpellNames[39] = pGlobalTXT_LocalizationStrings[674];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 aSpellNames[16] = pGlobalTXT_LocalizationStrings[452];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 aSpellNames[29] = pGlobalTXT_LocalizationStrings[213];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 aSpellNames[40] = pGlobalTXT_LocalizationStrings[249];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 aSpellNames[2] = pGlobalTXT_LocalizationStrings[219];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 aSpellNames[17] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 aSpellNames[30] = pGlobalTXT_LocalizationStrings[229];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 aSpellNames[41] = pGlobalTXT_LocalizationStrings[258];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 aSpellNames[5] = pGlobalTXT_LocalizationStrings[454];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 aSpellNames[3] = pGlobalTXT_LocalizationStrings[215];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 aSpellNames[7] = pGlobalTXT_LocalizationStrings[455];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 aSpellNames[18] = pGlobalTXT_LocalizationStrings[456];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 aSpellNames[31] = pGlobalTXT_LocalizationStrings[233];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 aSpellNames[42] = pGlobalTXT_LocalizationStrings[194];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 aSpellNames[6] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 aSpellNames[25] = pGlobalTXT_LocalizationStrings[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 aSpellNames[1] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 aSpellNames[4] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 aSpellNames[8] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 aSpellNames[19] = pGlobalTXT_LocalizationStrings[453];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 aSpellNames[22] = pGlobalTXT_LocalizationStrings[204];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 aSpellNames[23] = pGlobalTXT_LocalizationStrings[208];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 aSpellNames[27] = pGlobalTXT_LocalizationStrings[441];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 aSpellNames[32] = pGlobalTXT_LocalizationStrings[234];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 aSpellNames[43] = pGlobalTXT_LocalizationStrings[657];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 //----- (00453E6D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 void StorylineText::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 StorylineText *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 char *v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 char v4; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 char *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 int v6; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 int v7; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 int v8; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 char *v9; // [sp+14h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 int Str; // [sp+18h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 if ( pHistoryTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 pAllocator->FreeChunk(pHistoryTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 pHistoryTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 strtok(pHistoryTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 Str = (int)&v2->field_4[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 v9 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 v8 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 v3 = strtok(v1, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 if ( *v3 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 v4 = v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 while ( v4 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 v6 = (int)&v3[(int)v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 if ( v3[(int)v5] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 *(char *)v6 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 if ( v5 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 if ( v9 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 *(char **)(Str - 8) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 if ( v9 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 *(char *)Str = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 if ( v9 - 2 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 *(char * *)(Str - 4) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 v3 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 while ( (signed int)(v9 - 1) <= 3 && (char *)v8 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 Str += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 //----- (00453F62) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 void MapStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 MapStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 unsigned int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 char *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 char v5; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 size_t v7; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 size_t v8; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 size_t v9; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 size_t v10; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 size_t v11; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 size_t v12; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 char Str[32]; // [sp+Ch] [bp-34h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 char *v14; // [sp+2Ch] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 int v15; // [sp+30h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 int v16; // [sp+34h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 unsigned int v17; // [sp+38h] [bp-8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 MapStats *v18; // [sp+3Ch] [bp-4h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 if ( pMapStatsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 pAllocator->FreeChunk(pMapStatsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 pMapStatsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 strtok(pMapStatsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 v1->uNumMaps = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 v3 = strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 v14 = &v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 switch ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v1->pInfos[v2].pName = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v1->pInfos[v2].pFilename = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 v1->pInfos[v2].uNumResets = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v1->pInfos[v2].uFirstVisitedAt = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 v1->pInfos[v2]._per = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v1->pInfos[v2].uRespawnIntervalDays = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 v1->pInfos[v2]._alert_days = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v1->pInfos[v2]._steal_perm = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v1->pInfos[v2].field_2D = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v1->pInfos[v2].field_2E = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v1->pInfos[v2].field_2F = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v1->pInfos[v2].field_30 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v1->pInfos[v2].field_31 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 v1->pInfos[v2].field_32 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v1->pInfos[v2].field_33 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v1->pInfos[v2].pEncounterMonster1Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v1->pInfos[v2].field_34 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 v18->pInfos[0].uEncounterMonster1AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 v7 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 if ( v17 >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 v18->pInfos[0].uEncounterMonster1AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 v8 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 if ( v17 == v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 v18->pInfos[0].uEncounterMonster1AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 v18->pInfos[0].uEncounterMonster1AtMost = v18->pInfos[0].uEncounterMonster1AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 v1->pInfos[v2].pEncounterMonster2Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 v1->pInfos[v2].field_37 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 v18->pInfos[0].uEncounterMonster2AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 v9 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 if ( v17 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 v18->pInfos[0].uEncounterMonster2AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 if ( v17 == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 v18->pInfos[0].uEncounterMonster2AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 v18->pInfos[0].uEncounterMonster2AtMost = v18->pInfos[0].uEncounterMonster2AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 v1->pInfos[v2].pEncounterMonster3Texture = (char *)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 v1->pInfos[v2].field_3A = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 v18 = (MapStats *)((char *)v1 + 68 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 v18->pInfos[0].uEncounterMonster3AtLeast = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 strcpy(Str, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 if ( strlen(Str) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 while ( Str[v17] != 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 v11 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 if ( v17 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 Str[v17] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 v18->pInfos[0].uEncounterMonster3AtLeast = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 v12 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 if ( v17 == v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 v18->pInfos[0].uEncounterMonster3AtMost = atoi(&v4[v17 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 v18->pInfos[0].uEncounterMonster3AtMost = v18->pInfos[0].uEncounterMonster3AtLeast;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 v1->pInfos[v2].uRedbookTrackID = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 if ( strcmp(v4, "GENERIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 if ( strcmp(v4, "PADDEDCELL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 if ( strcmp(v4, "ROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 if ( strcmp(v4, "BATHROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 if ( strcmp(v4, "LIVINGROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 if ( strcmp(v4, "STONEROOM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 if ( strcmp(v4, "AUDITORIUM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 if ( strcmp(v4, "CONCERTHALL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 if ( strcmp(v4, "CAVE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 if ( strcmp(v4, "ARENA") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 if ( strcmp(v4, "HANGAR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 if ( strcmp(v4, "CARPETEDHALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 if ( strcmp(v4, "HALLWAY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 if ( strcmp(v4, "STONECORRIDOR") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 if ( strcmp(v4, "ALLEY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 if ( strcmp(v4, "FOREST") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 if ( strcmp(v4, "CITY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 if ( strcmp(v4, "MOUNTAINS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 if ( strcmp(v4, "QUARRY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 if ( strcmp(v4, "PLAIN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 if ( strcmp(v4, "PARKINGLOT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 if ( strcmp(v4, "SEWERPIPE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 if ( strcmp(v4, "UNDERWATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 if ( strcmp(v4, "DRUGGED") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 if ( strcmp(v4, "DIZZY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 if ( strcmp(v4, "PSYCHOTIC") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 v1->pInfos[v2].uEAXEnv = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 v1->pInfos[v2].uEAXEnv = 25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 v1->pInfos[v2].uEAXEnv = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v1->pInfos[v2].uEAXEnv = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 v1->pInfos[v2].uEAXEnv = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 v1->pInfos[v2].uEAXEnv = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 v1->pInfos[v2].uEAXEnv = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 v1->pInfos[v2].uEAXEnv = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 v1->pInfos[v2].uEAXEnv = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 v1->pInfos[v2].uEAXEnv = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 v1->pInfos[v2].uEAXEnv = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 v1->pInfos[v2].uEAXEnv = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 v1->pInfos[v2].uEAXEnv = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 v1->pInfos[v2].uEAXEnv = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 v1->pInfos[v2].uEAXEnv = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 v1->pInfos[v2].uEAXEnv = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 v1->pInfos[v2].uEAXEnv = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 v1->pInfos[v2].uEAXEnv = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 v1->pInfos[v2].uEAXEnv = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 v1->pInfos[v2].uEAXEnv = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 v1->pInfos[v2].uEAXEnv = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 v1->pInfos[v2].uEAXEnv = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 v1->pInfos[v2].uEAXEnv = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 v1->pInfos[v2].uEAXEnv = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 v1->pInfos[v2].uEAXEnv = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 v1->pInfos[v2].uEAXEnv = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 v1->pInfos[v2].uEAXEnv = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 break;
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 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 v4 = v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 while ( v16 - 1 <= 29 && !v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 while ( (signed int)v2 < 77 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 v1->uNumMaps = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 // 453F62: using guessed type char Str[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 //----- (004547A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 unsigned int MapStats::GetMapInfo(const char *Str2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 MapStats *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 unsigned int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 if ( (signed int)this->uNumMaps <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 v4 = (const char **)&this->pInfos[1].pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 while ( !*v4 || _strcmpi(*v4, Str2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 v4 += 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 if ( (signed int)v3 >= (signed int)v2->uNumMaps )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 //----- (004547E4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 void FactionTable::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 char *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 signed int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 int v4; // ebp@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 int v7; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 signed int v8; // [sp+4h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 signed int v9; // [sp+8h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 FactionTable *v10; // [sp+Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 v10 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 if ( pHostileTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 pHostileTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 strtok(pHostileTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v2 = strtok(v1, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v9 = (signed int)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 v4 = (int)((char *)&v10[-7] + v8 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v5 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v5 = v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 v7 = (int)&v2[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 if ( v2[(int)v6] == (char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 *(char *)v7 = (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 if ( v6 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 if ( v3 >= 1 && v3 <= 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 *(char *)v4 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 v4 += 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 v2 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 while ( v3 - 1 <= 90 && (char *)v9 == v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 while ( v8 < 89 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 if ( pHostileTXT_Raw != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 pHostileTXT_Raw = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 //----- (004548E2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 std::string v5; // [sp-18h] [bp-28h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 const char *v6; // [sp-8h] [bp-18h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 signed int v7; // [sp-4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 std::string *v8; // [sp+8h] [bp-8h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 int a3; // [sp+Fh] [bp-1h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 v2 = (int)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 result = (int)a1->pProperties[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 if ( !_strcmpi((const char *)result, "Dispel") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 v7 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 ++*(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v7 = 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 v7 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 v7 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 v7 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 v7 = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 v7 = 95;
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), "Sparks") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 v7 = 78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 v7 = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 v7 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 v7 = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 v7 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 if ( !_strcmpi(*(const char **)(v2 + 4), off_4E876C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 v7 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 v7 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 v7 = 97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 v7 = 82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 v7 = 57;
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), "Blades") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 v7 = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 sprintfex(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 v7 = 73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 v7 = 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 v7 = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 v7 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 v7 = 89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 v7 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 v7 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 v7 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 v7 = 81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 v7 = 93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 v7 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 v7 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 v7 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 v7 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 v7 = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 v7 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 v7 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 *(int *)v3 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 //----- (00454CB4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 int __thiscall ParseAttackType(unsigned __int8 *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 unsigned __int8 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 int v3; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 int v4; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 return 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 if ( tolower(*a1) == 'f' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 if ( tolower(*v1) == 'a' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 if ( tolower(*v1) == 'w' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 if ( tolower(*v1) == 'e' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 tolower(v1[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 return 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 if ( tolower(*v1) == 's' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 return 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 if ( tolower(*v1) == 'm' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 v3 = -(tolower(v1[1]) != 'i');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 LOBYTE(v3) = v3 & 0xFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 result = v3 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 if ( tolower(*v1) == 'l' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 return 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 v4 = -(tolower(*v1) != 'd');
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 LOBYTE(v4) = v4 & 0xFA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 result = v4 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 //----- (00454D7D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 signed int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 int *v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 size_t v10; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 int v11; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 signed int v12; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 v5 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 *(char *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 *(char *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 v10 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 if ( (signed int)v10 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 LOBYTE(v8) = *v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 if ( (unsigned __int8)*v5 >= 0x30u && (unsigned __int8)v8 <= 0x39u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 *(char *)v4 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 LOBYTE(v8) = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 *(char *)a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 v7 = (int *)&v5[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 if ( tolower((unsigned __int8)v5[v6]) == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 *(char *)v11 = atoi(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 *(char *)a3 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 *(char *)v7 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 v8 = tolower(*(char *)v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 if ( v8 == 43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 LOBYTE(v8) = atoi(&v5[v6 + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 *(char *)a4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 while ( v6 < (signed int)v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 v4 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 return v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 //----- (00454E3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 int __fastcall ParseMissleAttackType(const char *Str1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 const char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 int v4; // [sp-4h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 v1 = Str1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 if ( _strcmpi(Str1, "ARROW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 if ( _strcmpi(v1, "ARROWF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 if ( _strcmpi(v1, "FIRE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 if ( _strcmpi(v1, off_4E887C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 if ( _strcmpi(v1, "WATER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 if ( _strcmpi(v1, "EARTH") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 if ( _strcmpi(v1, "SPIRIT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 if ( _strcmpi(v1, "MIND") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 if ( _strcmpi(v1, "BODY") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 if ( _strcmpi(v1, "LIGHT") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 if ( _strcmpi(v1, "DARK") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 if ( _strcmpi(v1, "ENER") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 v4 = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 v4 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 v4 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 v4 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 v4 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 v4 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 v4 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 v4 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 v4 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 v4 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 //----- (00458244) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 unsigned int __fastcall SkillToMastery(unsigned __int16 a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 result = 1; // Normal
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 if ( HIBYTE(a1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 result = 4; // Grandmaster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 if ( (a1 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 if ( a1 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 result = 2; // Expert
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 result = 3; // Master
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 //----- (0045828B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 unsigned int __fastcall GetSpellColor(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 unsigned __int16 v1; // dx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 unsigned __int16 v2; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 unsigned __int16 v4; // [sp-4h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 if ( a1 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 if ( a1 < 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 goto LABEL_31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 if ( a1 < 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 v4 = 155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 if ( a1 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v4 = 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 v2 = 192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 LABEL_31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 if ( a1 < 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 if ( a1 < 67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 v1 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 v2 = 235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 if ( a1 < 56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 v2 = 225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 if ( a1 < 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 v4 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 v1 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 if ( a1 < 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 v1 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 if ( a1 < 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 v1 = 85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 if ( a1 >= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 v1 = 212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 v2 = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v2, v1, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 //----- (004583B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 LevelDecoration::LevelDecoration()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 this->field_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 this->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 this->vPosition.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 this->vPosition.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 this->vPosition.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 this->uDecorationDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 this->field_16_event_id = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 this->uCog = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 //----- (00458600) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 void DecorationList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 DecorationList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 v2 = fopen("data\\ddeclist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 Abortf("Unable to save ddeclist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 fwrite(v1->pDecorations, 0x54u, v1->uNumDecorations, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 //----- (0045864C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 void DecorationList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 uNumDecorations = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 pDecorations = (DecorationDesc *)pAllocator->AllocNamedChunk(pDecorations,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 84 * uNumDecorations, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 memcpy(pDecorations, (char *)pSerialized + 4, 84 * uNumDecorations);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 //----- (00458693) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 void DecorationList::InitializeDecorationSprite(unsigned int uDecID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 pSpriteFrameTable->InitializeSprite(this->pDecorations[uDecID].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 //----- (004586B0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 bool DecorationList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 DecorationList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 unsigned int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 FILE *v6; // ST18_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 unsigned __int16 v8; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 const char *v9; // ST20_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 const char *v10; // ST18_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 __int16 v11; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 const char *v12; // ST14_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 unsigned __int16 v13; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 const char *v14; // ST10_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 __int16 v15; // ax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 const char *v16; // ST0C_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 unsigned __int8 v17; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 const char *v18; // ST08_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 unsigned __int8 v19; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 const char *v20; // ST04_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 unsigned __int8 v21; // al@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 const char *v22; // ST00_4@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 unsigned __int8 v23; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 char v24; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 unsigned __int8 v25; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 int j; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 const char *v27; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 int v28; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 int v30; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 int v31; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 int v32; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 int v33; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 int v34; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 int v35; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 FrameTableTxtLine v37; // [sp+Ch] [bp-460h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 FrameTableTxtLine v38; // [sp+88h] [bp-3E4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 char Dest; // [sp+104h] [bp-368h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 char Buf; // [sp+17Ch] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 FrameTableTxtLine v41; // [sp+370h] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 FrameTableTxtLine v42; // [sp+3ECh] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 FILE *File; // [sp+468h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 unsigned int Argsa; // [sp+474h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 Abortf("DecorationDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 memcpy(&v42, frame_table_txt_parser(&Buf, &v41), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 v4 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v2->uNumDecorations = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v5 = pAllocator->AllocNamedChunk(v2->pDecorations, 84 * v4, "Dec Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v2->pDecorations = (DecorationDesc *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 Abortf("DecorationDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v2->uNumDecorations = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 memcpy(&v42, frame_table_txt_parser(&Buf, &v38), sizeof(v42));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 strcpy(v2->pDecorations[v2->uNumDecorations].pName, v42.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v8 = pSpriteFrameTable->FastFindSprite(v2->pDecorations[v2->uNumDecorations].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v9 = v42.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v2->pDecorations[v2->uNumDecorations].uSpriteID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 strcpy(v2->pDecorations[v2->uNumDecorations].field_20, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v10 = v42.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v2->pDecorations[v2->uNumDecorations].uType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v12 = v42.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v2->pDecorations[v2->uNumDecorations].uRadius = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v14 = v42.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v2->pDecorations[v2->uNumDecorations].uDecorationHeight = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 v16 = v42.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 v2->pDecorations[v2->uNumDecorations].uLightRadius = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 v18 = v42.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v2->pDecorations[v2->uNumDecorations].uColoredLightRed = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v20 = v42.pProperties[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v2->pDecorations[v2->uNumDecorations].uColoredLightGreen = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v21 = atoi(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 v22 = v42.pProperties[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 v2->pDecorations[v2->uNumDecorations].uColoredLightBlue = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 v2->pDecorations[v2->uNumDecorations].uSoundID = atoi(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 v25 = __OFSUB__(v42.field_0, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 v23 = v42.field_0 == 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 v24 = v42.field_0 - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 v2->pDecorations[v2->uNumDecorations].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 if ( !((unsigned __int8)(v24 ^ v25) | v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 strcpy(&Dest, v42.pProperties[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 memcpy(&v41, frame_table_txt_parser(&Dest, &v37), sizeof(v41));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 for ( j = 0; j < v41.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 v27 = v41.pProperties[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 if ( _strcmpi(v41.pProperties[j], off_4E8CB8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 if ( _strcmpi(v27, "Invisible") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 if ( _strcmpi(v27, "FS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 if ( _strcmpi(v27, "FM") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 if ( _strcmpi(v27, "FF") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 if ( _strcmpi(v27, "Marker") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 if ( _strcmpi(v27, "LoopSlow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 if ( _strcmpi(v27, "EmitFire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 if ( _strcmpi(v27, "Dawn") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 if ( !_strcmpi(v27, "Dusk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 HIBYTE(v2->pDecorations[v2->uNumDecorations].uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 v35 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 *(char *)v35 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 v34 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 *(char *)v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 v33 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 *(char *)v33 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 v32 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 *(char *)v32 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 v31 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 *(char *)v31 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 v30 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 *(char *)v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 v29 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 *(char *)v29 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 v28 = (int)&v2->pDecorations[v2->uNumDecorations].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 *(char *)v28 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 ++v2->uNumDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 }
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 //----- (00459064) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 void ObjectList::InitializeSprites()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 for (uint i = 0; i < uNumObjects; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 pSpriteFrameTable->InitializeSprite(pObjects[i].uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 //----- (00459090) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 void ObjectList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 ObjectList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 v2 = fopen("data\\dobjlist.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 Abortf("Unable to save dobjlist.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 fwrite(v1->pObjects, 0x38u, v1->uNumObjects, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 //----- (004590DC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 void ObjectList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 uNumObjects = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 pObjects = (ObjectDesc *)pAllocator->AllocNamedChunk(pObjects, 56 * uNumObjects, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 memcpy(pObjects, (char *)pSerialized + 4, 56 * uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 //----- (00459123) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 bool ObjectList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 ObjectList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 __int32 v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 void *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 FILE *v7; // ST0C_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 char *i; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 unsigned __int16 v9; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 const char *v10; // ST20_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 __int16 v11; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 const char *v12; // ST1C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 __int16 v13; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 const char *v14; // ST18_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 __int16 v15; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 const char *v16; // ST14_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 __int16 v17; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 const char *v18; // ST10_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 __int16 v19; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 const char *v20; // ST0C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 int v21; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 const char *v22; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 int v23; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 int v24; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 int v26; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 int v27; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 int v28; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 int v29; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 int v30; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 int v31; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 const char *v32; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 const char *v33; // ST20_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 int v34; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 char v35; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 const char *v36; // ST1C_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 char v37; // al@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 const char *v38; // ST18_4@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 FrameTableTxtLine v40; // [sp+8h] [bp-460h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 FrameTableTxtLine v41; // [sp+84h] [bp-3E4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 char Dest; // [sp+100h] [bp-368h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 char Buf; // [sp+178h] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 FrameTableTxtLine v44; // [sp+36Ch] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 FrameTableTxtLine v45; // [sp+3E8h] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 FILE *File; // [sp+464h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 unsigned int Argsa; // [sp+470h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 int Argsb; // [sp+470h] [bp+8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 pAllocator->FreeChunk(this->pObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v2->pObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 v2->uNumObjects = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 v4 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 File = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 Abortf("ObjectDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 if ( fgets(&Buf, 490, v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 if ( v45.field_0 && *v45.pProperties[0] != '/' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 v5 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v2->uNumObjects = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v6 = pAllocator->AllocNamedChunk(v2->pObjects, 56 * v5, "Obj Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 v2->pObjects = (ObjectDesc *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 if ( v6 == (void *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 Abortf("ObjectDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 memset(v6, v3, 56 * v2->uNumObjects);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v7 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v2->uNumObjects = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 fseek(v7, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 if ( v45.field_0 && *v45.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v10 = v45.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v2->pObjects[v2->uNumObjects].uSpriteID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 v11 = atoi(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 v12 = v45.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 v2->pObjects[v2->uNumObjects].uObjectID = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v13 = atoi(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v14 = v45.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 v2->pObjects[v2->uNumObjects].uRadius = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 v15 = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 v16 = v45.pProperties[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 v2->pObjects[v2->uNumObjects].uHeight = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 v17 = atoi(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 v18 = v45.pProperties[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 v2->pObjects[v2->uNumObjects].uLifetime = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 v19 = atoi(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 v20 = v45.pProperties[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 v2->pObjects[v2->uNumObjects].uSpeed = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 strcpy(&Dest, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 if ( v45.field_0 > 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 for ( Argsb = 0; Argsb < v44.field_0; ++Argsb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 v21 = Argsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 v22 = v44.pProperties[Argsb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 if ( !_strcmpi(v44.pProperties[Argsb], "NoDraw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 v23 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 *(char *)v23 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 if ( !_strcmpi(v22, "Lifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 v24 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 *(char *)v24 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 if ( !_strcmpi(v22, "FTLifetime") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 v25 = (int)&v2->pObjects[v2->uNumObjects];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 *(short *)(v25 + 42) = 8 * pSpriteFrameTable->pSpriteSFrames[*(short *)(v25 + 40)].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 v26 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 *(char *)v26 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 v27 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 *(char *)v27 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 if ( !_strcmpi(v22, "NoPickup") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 v28 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 *(char *)v28 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 if ( !_strcmpi(v22, "NoGravity") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 v29 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 *(char *)v29 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 if ( !_strcmpi(v22, "FlagOnIntercept") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 v30 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 *(char *)v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 if ( !_strcmpi(v22, "Bounce") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 v31 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 *(char *)v31 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 v32 = v45.pProperties[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 if ( !_strcmpi(v45.pProperties[v21], "Fire") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 if ( !_strcmpi(v32, "Lines") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 HIBYTE(v2->pObjects[v2->uNumObjects].uFlags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 if ( !_strcmpi(v44.pProperties[v21], "bits") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 v33 = v44.pProperties[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 v34 = (int)&v2->pObjects[v2->uNumObjects].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 *(char *)(v34 + 1) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 v35 = atoi(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 v36 = v44.pProperties[v21 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 v2->pObjects[v2->uNumObjects].uParticleTrailColorR = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 v37 = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 v38 = v44.pProperties[v21 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 v2->pObjects[v2->uNumObjects].uParticleTrailColorG = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 v2->pObjects[v2->uNumObjects].uParticleTrailColorB = atoi(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 ++v2->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 //----- (0045E03A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 unsigned __int16 *__fastcall MakeScreenshot(signed int width, signed int height)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 unsigned __int16 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 int v4; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 unsigned __int8 v5; // cf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 unsigned int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 unsigned __int16 *v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 int j; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 unsigned __int16 *v9; // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 LONG v11; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 signed __int64 v12; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 unsigned int v13; // ST10_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 HRESULT v14; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 int v15; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 signed __int64 v16; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 signed int v17; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 unsigned __int16 *v18; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 int k; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 DDSURFACEDESC2 Dst; // [sp+4h] [bp-A0h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 unsigned __int16 *pPixels; // [sp+80h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 float v23; // [sp+84h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 unsigned __int16 *_this; // [sp+88h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 float v25; // [sp+8Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 unsigned int v26; // [sp+90h] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 int v27; // [sp+94h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 int v28; // [sp+98h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 int i; // [sp+9Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 int v30; // [sp+A0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 v30 = width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v2 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 v27 = height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 v23 = 452.0 / (double)width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v25 = 336.0 / (double)height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 pPixels = (unsigned __int16 *)operator new(2 * height * width);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v3 = pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 {
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
11278 pRenderer->BeginSceneD3D();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 v9 = (unsigned __int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 v11 = Dst.lPitch >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 for ( i = 0; i < v27; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 v28 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 if ( v30 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 v26 = v11 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 v12 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 *v3 = v9[v26 + (int)v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 v13 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 v4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 v5 = v30 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 v6 = (unsigned int)v30 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v7 = &v3[2 * v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 for ( j = v5; j; --j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 *v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 pIndoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 pOutdoor->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 _this = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 v26 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 if ( pRenderer->pTargetSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 v15 = v26 * (unsigned __int64)(signed __int64)((double)i * v25 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 v16 = (signed __int64)((double)v28++ * v23 + 8.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 *v3 = _this[v15 + (int)v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 while ( v28 < v30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 while ( i < v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 memset(v3, 0, 4 * ((unsigned int)v30 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 v18 = &v3[2 * ((unsigned int)v30 >> 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 for ( k = v30 & 1; k; --k )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 v3 += v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 --v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 while ( v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 return pPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 //----- (0045E26C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 void __thiscall SaveScreenshot(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 unsigned __int16 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 v1 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 v2 = MakeScreenshot(92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 pRenderer->SavePCXImage(v1, (char *)v2, 92, 68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11420
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11421
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 //----- (004601B7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11423 void GameUI_MainMenu_DoDrawLoad(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 unsigned __int16 v1; // bx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 unsigned int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 unsigned int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 unsigned int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 unsigned int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 unsigned int v7; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 signed __int64 v8; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 unsigned int v9; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 unsigned __int64 v10; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 __int64 v11; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 char v12; // di@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 unsigned __int64 v13; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 unsigned int v14; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 __int64 v15; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 int v16; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 signed int v17; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 const char *v18; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 int v19; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 const char *v20; // ST18_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 int v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 const char *v22; // ST14_4@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 int v23; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 const char *v24; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 int v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 GUIWindow Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 /*unsigned int Dst; // [sp+Ch] [bp-78h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 unsigned int v27; // [sp+10h] [bp-74h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 int v28; // [sp+14h] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 int v29; // [sp+18h] [bp-6Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 unsigned int v30; // [sp+1Ch] [bp-68h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 unsigned int v31; // [sp+20h] [bp-64h]@8*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 __int64 v32; // [sp+60h] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 int v33; // [sp+68h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 unsigned int v34; // [sp+70h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 __int64 v35; // [sp+74h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 int v36; // [sp+7Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 int a4; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 a4 = a1;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11466 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11467 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOAD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 8u,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11474 (Texture *)(uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 v2 = uTextureID_save_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 v3 = uTextureID_LS_saveU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 v2 = uTextureID_load_up;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 v3 = uTextureID_LS_loadU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 pRenderer->DrawTextureIndexed(0xF1u, 0x12Eu, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 pRenderer->DrawTextureIndexed(0x12u, 0x8Bu, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 0x15Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 0x12Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 (Texture *)(uTextureID_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 memset(&Dst, 0, 0x54u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 Dst.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v4 = pGUIWindow_CurrentMenu->uFrameY - LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 Dst.uFrameWidth = 220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 v4 += 157;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 Dst.uFrameY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 v5 = LOBYTE(pFontSmallnum->uFontHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 Dst.uFrameZ = Dst.uFrameX + 219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 Dst.uFrameHeight = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 Dst.uFrameW = v5 + v4 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 v6 = uLoadGameUI_SelectedSlot;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11506 if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 pRenderer->DrawTextureRGB(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 pGUIWindow_CurrentMenu->uFrameX + 276,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 pGUIWindow_CurrentMenu->uFrameY + 171,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 pSavegameThumbnails + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 v6 = uLoadGameUI_SelectedSlot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11514 v7 = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[v7].pName, 3u);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11516 v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11517 HIDWORD(v32) = (unsigned __int64)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 v8 /= 60i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 v10 = (unsigned int)v8 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 v34 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 v11 = (unsigned int)(v10 / 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 LODWORD(v13) = (unsigned int)v11 >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 HIDWORD(v13) = HIDWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 v33 = v13 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 v36 = v13 / 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 v15 = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 v14 = (unsigned __int64)(v35 % 24) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 LODWORD(v35) = v35 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 HIDWORD(v15) = v34 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 v36 += 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 v16 = v12 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 Dst.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 HIDWORD(v35) = (v14 & 0x80000000u) == 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 && ((signed int)v14 > 0 || (unsigned int)v15 >= 0xC)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 && (signed int)v14 <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 0x18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 0xC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 if ( !(v14 | (unsigned int)v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 v17 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 LODWORD(v15) = v15 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 v34 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 LABEL_23:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11558 auto _d = aDayNames[HIDWORD(v15) % 7];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11559 auto _a = aAMPMNames[HIDWORD(v35)];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11560 auto _m = aMonthNames[v33];
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11561 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
11562 sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d",
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11563 _d,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 v17,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11565 (int)v32,
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11566 _a,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 7 * v16 + HIDWORD(v15) % 7 + 1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11568 _m,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 Dst.DrawText2(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 v1 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 if ( pGUIWindow_CurrentMenu->field_40 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11590 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 v18 = pGlobalTXT_LocalizationStrings[135];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 v19 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[135]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, v18, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 v20 = (const char *)(&pSavegameHeader + uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 v21 = pFontSmallnum->AlignText_Center(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 0xBAu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106u, 0, v20, 185, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 v22 = pGlobalTXT_LocalizationStrings[165];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 v23 = pFontSmallnum->AlignText_Center(0xBAu, pGlobalTXT_LocalizationStrings[165]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, v22, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 v34 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 v34 = uNumSavegameFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 a4 = 199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 v36 = dword_6A0C9C;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11612 v24 = (const char *)(&pSavegameHeader[dword_6A0C9C]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 if ( v36 >= (signed int)v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11617 short clr;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11618 HIDWORD(v35) = clr = (v36 == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 v1,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11621 0x64) : 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 if ( pGUIWindow_CurrentMenu->field_40 != 1 || v36 != uLoadGameUI_SelectedSlot )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11624 pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1Bu, a4, clr, v24, 185, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 v25 = pGUIWindow_CurrentMenu->DrawTextInRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 0x1Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 a4,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11632 clr,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 (const char *)pKeyActionMap->pPressedKeysBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 175,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 a4 += 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 v24 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 while ( a4 < 346 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 // 6A0C9C: using guessed type int dword_6A0C9C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 //----- (004606F7) --------------------------------------------------------
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11649 void __cdecl GameUI_MainMenu_DrawLoad()
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11650 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11651 GameUI_MainMenu_DoDrawLoad(0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 //----- (004606FE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 void __cdecl sub_4606FE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
11657 GameUI_MainMenu_DoDrawLoad(1);
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 //----- (00460706) --------------------------------------------------------
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11661 void TryLoadLevelFromLOD()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 FILE *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 FILE *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 __int32 v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 char Ext[256]; // [sp+4h] [bp-40Ch]@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11667 char Dir[256]; // [sp+104h] [bp-30Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 char Filename[256]; // [sp+204h] [bp-20Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 char a1[260]; // [sp+304h] [bp-10Ch]@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11670 char Drive[4]; // [sp+408h] [bp-8h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 int DstBuf; // [sp+40Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 strcpy(a1, pCurrentMapName);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11674 _splitpath(a1, Drive, Dir, Filename, Ext);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
11675 sprintf(a1, "levels\\%s%s", Filename, ".lod");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 v0 = fopen(a1, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 fseek(v0, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v2 = ftell(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 rewind(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 ptr_6A0D08 = pAllocator->AllocNamedChunk(ptr_6A0D08, v2, "LevelLod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 fread(ptr_6A0D08, v2, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 fseek(v1, v2 - 6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 DstBuf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 fread(&DstBuf, 4u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 fread(&_6A0D10_txt_lod_loading__unused, 2u, 1u, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 _6A0D0C_txt_lod_loading = (int)((char *)ptr_6A0D08 + DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 fclose(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 //----- (0046080D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 void __cdecl sub_46080D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 pAllocator->FreeChunk(ptr_6A0D08);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 ptr_6A0D08 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 _6A0D0C_txt_lod_loading = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 //----- (0046082C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 bool Initialize_GamesLOD_NewLOD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11705 pGames_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11706 pGames_LOD->AllocSubIndicesAndIO(300, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 if (pGames_LOD->LoadFile("data\\games.lod", 1))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11709 pNew_LOD = new LODWriteableFile;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11710 pNew_LOD->AllocSubIndicesAndIO(300, 0x186A0u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 //----- (0046086A) --------------------------------------------------------
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11721 bool Autosave()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 int v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 int v2; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 FILE *v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 unsigned int v9; // [sp+16Ch] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 void *pSave; // [sp+170h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 unsigned int v11; // [sp+174h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 if ( pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 v0 = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11738 pSave = pAllocator->AllocNamedChunk(0, 0xF4240, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 pNew_LOD->CloseWriteFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 remove("data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 this_.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 strcpy(this_.array_000004, "MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 strcpy(this_.array_000054, "newmaps for MMVII");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 this_.dword_0000A4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 this_.dword_0000A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 a3.dword_000018 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 a3.word_00001E = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
11748 strcpy(a3.pFilename, "current");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 pNew_LOD->_461492(&this_, &a3, "data\\new.lod");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 if ( pNew_LOD->LoadFile("data\\new.lod", 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 pNew_LOD->CreateTempFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 pNew_LOD->uNumSubIndices = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 pDir.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 v1 = (signed int)pGames_LOD->uNumSubIndices / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 if ( (signed int)pGames_LOD->uNumSubIndices / 2 < (signed int)pGames_LOD->uNumSubIndices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 v2 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 v11 = 32 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 v9 = pGames_LOD->uNumSubIndices - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 memcpy(&pDir, (char *)pGames_LOD->pSubIndices + v2, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 v3 = pGames_LOD->FindContainer((const char *)pGames_LOD->pSubIndices + v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 fread(pSave, pGames_LOD->pSubIndices[v11 / 0x20].uDataSize, 1u, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 pNew_LOD->AppendDirectory(&pDir, pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 v11 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 v2 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 v7.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 strcpy(pSavegameHeader->pLocationName, "out01.odm");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 strcpy((char *)&v7, "header.bin");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 v7.uDataSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 pNew_LOD->AppendDirectory(&v7, &pSavegameHeader);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 pNew_LOD->Save();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 pParty->vPrevPosition.y = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 pParty->vPrevPosition.x = 12552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 pParty->vPosition.x = 12552;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
11784 pParty->vPosition.z = v0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 pParty->uFallStartY = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 pParty->sPrevRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 pParty->sRotationX = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 pParty->vPrevPosition.z = 1816;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
11789 pParty->vPosition.y = 1816;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 pParty->sPrevRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 pParty->sRotationY = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 SaveGame(1, (__int16 *)1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 pAllocator->FreeChunk(pSave);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 //----- (004610AA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 OutdoorCamera *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 v2 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 pGameLoadingUI_ProgressBar->Reset(0x1Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 pSoundList->_4A9D79(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 uCurrentlyLoadedLevelType = (LEVEL_TYPE)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 ODM_LoadAndInitialize(pCurrentMapName, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 TeleportToStartingPoint(uLevel_StartingPointType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 viewparams->_443365();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 PlayLevelMusic();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 //----- (00461103) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 void __cdecl sub_461103()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11822 //GUIProgressBar *v0; // ebx@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11823 //signed int v1; // ebp@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11824 //char *v2; // esi@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 __int16 v3; // cx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 int v4; // edx@8
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11827 //size_t v5; // edi@14
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 signed int v6; // esi@14
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11829 //char *v7; // edx@15
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 signed int v8; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 int v9; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 MonsterInfo *v10; // ebx@23
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11833 //int *v11; // esi@23
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 int v12; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 int v13; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 __int16 v14; // ax@41
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11837 //signed int v15; // [sp+10h] [bp-4Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11838 //signed int v16; // [sp+10h] [bp-4Ch]@14
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 signed int v17; // [sp+14h] [bp-48h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 signed int v18; // [sp+14h] [bp-48h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 int v19; // [sp+18h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 signed int v20; // [sp+18h] [bp-44h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 int v21[16]; // [sp+1Ch] [bp-40h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 sub_450218_prolly_generate_chests_loot();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11846 //v0 = pGameLoadingUI_ProgressBar;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 pParty->field_7B5_in_arena_quest = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11850 //v1 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 dword_5C6DF8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 pNPCStats->field_17FC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 v19 = pMapStats->GetMapInfo(pCurrentMapName);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11854
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11855 //v15 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11856 for (uint i = 0; i < uNumActors; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11857 //if ( (signed int)uNumActors > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11858 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11859 auto pActor = pActors + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11860 //v2 = (char *)&pActors[0].uNPC_ID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11861 //do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11862 //{
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11863 v3 = pActor->pMonsterInfo.uID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11864 v17 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 if ( v3 >= 115 && v3 <= 186 || v3 >= 232 && v3 <= 249 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 v17 = 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11867 //v1 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 v4 = (v3 - 1) % 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 if ( 2 == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11871 if ( pActor->uNPC_ID && pActor->uNPC_ID < 5000 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11872 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11878 if ( v4 != 0 || pActor->uNPC_ID )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11879 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11883 if ( pActor->uNPC_ID > 0 && pActor->uNPC_ID < 5000 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11884 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->array_13EF4[pNPCStats->field_17FC0], v3, 0, v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 v14 = LOWORD(pNPCStats->field_17FC0) + 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 ++pNPCStats->field_17FC0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11890 pActor->uNPC_ID = v14;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11891 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 LABEL_12:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11894 pActor->uNPC_ID = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11895 //LABEL_13:
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11896 //++v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11897 //v2 += 836;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11898 //}
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11899 //while ( v15 < (signed int)uNumActors );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11900 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11901
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 pGameLoadingUI_ProgressBar->Progress();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11903
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11904 //v5 = uNumActors;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11907 //v16 = v1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11908
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11909 for (uint i = 0; i < uNumActors; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11910 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11911 auto pActor = pActors + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11912 //v7 = (char *)&pActors[0].pMonsterInfo;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11913 //do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11914 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 v8 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11916 if ( v6 > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11920 if ( v21[v8] == pActor->pMonsterInfo.uID - 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 while ( v8 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11926
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 if ( v8 == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11929 v21[v6++] = pActor->pMonsterInfo.uID - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 v20 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 if ( v6 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11934 //++v16;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11935 //v7 += 836;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11936 //}
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11937 //while ( v16 < (signed int)v5 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11938 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11939
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 pGameLoadingUI_ProgressBar->Progress();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11941
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11942 if ( v6 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11943 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11944 int _v0 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11947 v9 = v21[_v0];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 v18 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v10 = &pMonsterStats->pInfos[v9 + 1];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11950 //v11 = (int *)pMonsterList->pMonsters[v9].pSoundSampleIDs;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11951 auto v11 = &pMonsterList->pMonsters[v9];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11954 pSoundList->_4A9A67(v11->pSoundSampleIDs[4 - v18], 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11955 //v11 = (int *)((char *)v11 + 2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 do
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11961 v13 = pSoundList->_4A9A67(v12++ + word_4EE088_sound_ids[v10->uSpell1ID], 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 while ( v13 );
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11963 ++_v0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11964 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11965 while ( _v0 < v6 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11966 //v0 = pGameLoadingUI_ProgressBar;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11967 //v1 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11968 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11969
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11970 pGameLoadingUI_ProgressBar->Progress();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11971
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 if ( dword_6BE368_debug_settings_2 & 4 )
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11973 uNumActors = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 if ( dword_6BE368_debug_settings_2 & 8 )
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11975 uNumLevelDecorations = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 sub_4613C4();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11977
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11978 pGameLoadingUI_ProgressBar->Progress();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11979
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11980 pIndoorCamera->pos.y = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11981 pIndoorCamera->pos.x = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 pIndoorCamera->pos.z = 100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11983 pIndoorCamera->sRotationY = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11984 pIndoorCamera->sRotationX = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 viewparams->bRedrawGameUI = 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11986 uLevel_StartingPointType = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 pSprites_LOD->_461397();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 pPaletteManager->LockTestAll();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11989 if ( pParty->pPickedItem.uItemID != 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
11992
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 //----- (004613C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 int __cdecl sub_4613C4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 unsigned __int16 v0; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 size_t v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 LevelDecoration *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 _6836C8_num_decorations_6807E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 v0 = pDecorationList->GetDecorIdByName("Event Trigger");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 v1 = uNumLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 v2 = (signed __int16)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 v4 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 if ( v4->uDecorationDescID == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 v5 = _6836C8_num_decorations_6807E8++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 _6807E8_level_decorations_ids[v5] = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 while ( result < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 //----- (004621DA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 int __fastcall sub_4621DA(signed int a1, signed int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 signed int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 signed int v5; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 signed int v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 if ( a1 < a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 a1 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 a2 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 v4 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 if ( a1 < a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 a1 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 v4 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 if ( a2 < v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 v6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 v4 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 return (11 * a2 >> 5) + a1 + (v4 >> 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12071
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12072
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12073
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 //----- (0046271C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 void __cdecl crt_init_globals_46271C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 ofn.lStructSize = 0x4Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 ofn.hwndOwner = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 ofn.hInstance = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 ofn.lpstrFilter = "Indoor BLV Files (*.blv)";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 ofn.lpstrCustomFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 ofn.nMaxCustFilter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 ofn.nFilterIndex = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 ofn.lpstrFile = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 ofn.nMaxFile = 260;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 ofn.nMaxFileTitle = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 ofn.lpstrInitialDir = "levels";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 ofn.lpstrTitle = "Might and Magic® VII - Load Which Level?";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 ofn.Flags = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 ofn.nFileOffset = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 ofn.nFileExtension = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 ofn.lpstrDefExt = "blv";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 ofn.lCustData = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 ofn.lpfnHook = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 ofn.lpTemplateName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 ofn.lpstrFileTitle = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 //----- (004627B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 void __cdecl MainMenu_Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 GUIButton *v8; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 unsigned int v9; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 int v10; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 int v11; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 unsigned int v12; // [sp-18h] [bp-54h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 Texture *v13; // [sp-14h] [bp-50h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 GUIButton *v14; // [sp+0h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 GUIWindow *v15; // [sp+4h] [bp-38h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12114 pCurrentScreen = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12115 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12125 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12126
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12127 auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12128 //v0 = pIcons_LOD->LoadTexture("title_new", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12129 //v1 = (Texture *)(v0 != -1 ? &pIcons_LOD->pTextures[v0] : 0);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12130 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12131 pNew->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12132 pNew->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12133 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12134 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12135 UIMSG_MainMenu_ShowPartyCreationWnd,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12136 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12137 78,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12138 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12139 pNew,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12140 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12141 //v2 = pIcons_LOD->LoadTexture("title_load", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12142 //v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12143 auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12144 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12145 pLoad->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12146 pLoad->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12147 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12148 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12149 UIMSG_MainMenu_ShowLoadWindow,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12150 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12151 76,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12152 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12153 pLoad,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12154 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12155 //v4 = pIcons_LOD->LoadTexture("title_cred", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12156 //v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12157 auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12158 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12159 pCredits->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12160 pCredits->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12161 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12162 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12163 UIMSG_ShowCredits,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12164 2,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12165 67,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12166 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12167 pCredits,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12168 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12169 //v6 = pIcons_LOD->LoadTexture("title_exit", TEXTURE_16BIT_PALETTE);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12170 //v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12171 auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12172 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12173 pExit->uTextureWidth,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12174 pExit->uTextureHeight,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12175 1,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12176 0,
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12177 UIMSG_ExitToWindows,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12178 3,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12179 0,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12180 "",
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12181 pExit,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12182 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12183
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12184 pTexture_PCX.Release();
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12185 pTexture_PCX.Load("title.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12186 SetCurrentMenuID(MENU_MAIN);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 SetForegroundWindow(hWnd);
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
12188 SendMessageW(hWnd, WM_ACTIVATEAPP, 1, 0);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12189 while (GetCurrentMenuID() == MENU_MAIN ||
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12190 GetCurrentMenuID() == MENU_SAVELOAD)
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12191 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12192 POINT pt;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12193 pMouse->GetCursorPos(&pt);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12194 //uMouseX = pMouse->GetCursorPos(&v18)->x;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12195 //uMouseY = pMouse->GetCursorPos(&v19)->y;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12196 v15 = pWindow_MainMenu;
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12197 if ( GetCurrentMenuID() == MENU_SAVELOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12199 if ( pCurrentScreen != 12 )
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12200 {
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12201 pTexture_PCX.Release();
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12202 pTexture_PCX.Load("lsave640.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12203 pGUIWindow2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12204 pCurrentScreen = 12;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 GameUI_DrawLoadMenu(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 v15 = pGUIWindow_CurrentMenu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12209
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12210 MSG msg;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12211 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12212 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12213 if (msg.message == WM_QUIT)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 Game_DeinitializeAndTerminate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12215 TranslateMessage(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12216 DispatchMessageA(&msg);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12217 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12218 if (dword_6BE364_game_settings_1 & 0x0100)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 pRenderer->BeginScene();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12225 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12226 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 GUI_UpdateWindows();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12230 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 pAsyncMouse->_46B736_consume_click_lists(1);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12232 if (GetCurrentMenuID() != MENU_MAIN)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 LABEL_45:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12235 if (GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 pGUIWindow_CurrentMenu = 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12240 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 if ( !ptr_507BDC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 v8 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 v14 = v15->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12254 if ( pt.x >= (signed int)v8->uX
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12255 && pt.x <= (signed int)v8->uZ
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12256 && pt.y >= (signed int)v8->uY
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12257 && pt.y <= (signed int)v8->uW
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12258 && v15 == pWindow_MainMenu )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 v9 = v8->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v10 = v9 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 v11 = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 if ( v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 goto LABEL_44;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12271 v13 = pExit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 v12 = 337;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12276 v13 = pCredits;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v12 = 282;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12282 v13 = pLoad;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 v12 = 227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12288 v13 = pNew;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 v12 = 172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 pRenderer->DrawTextureIndexed(495u, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 v8 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 v14 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 v8 = v8->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 pRenderer->Present();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12312 pTexture_PCX.Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 if ( pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12318 pWindow_MainMenu->Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 //----- (004637EB) --------------------------------------------------------
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12326 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 unsigned int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 Render *v5; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 HANDLE v6; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 Keyboard *v7; // eax@33
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12332 //HDC v9; // edi@41
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 HDC v10; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 int v11; // esi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 char v12; // zf@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 signed int v13; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 int v14; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 int v15; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 int v16; // eax@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 int v17; // eax@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 int v18; // eax@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 int v19; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 int v20; // eax@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 int v21; // eax@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 int v22; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 int v23; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 int v24; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 int v25; // eax@171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 int v26; // eax@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 char v27; // al@174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 bool v28; // ebx@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 char v29; // dl@209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 char v30; // cl@210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 bool v31; // ebx@211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 void *v32; // ebx@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 float v33; // ST04_4@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 float v34; // ST04_4@254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 HWND v35; // [sp+8h] [bp-64h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 UINT v36; // [sp+Ch] [bp-60h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 WPARAM v37; // [sp+10h] [bp-5Ch]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 LPARAM v38; // [sp+14h] [bp-58h]@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 int pXY[2]; // [sp+64h] [bp-8h]@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 int a2; // [sp+7Ch] [bp+10h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12366 switch (Msg)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12367 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12368 case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12369 };
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 if ( Msg > WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 switch ( Msg )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 case WM_DEVICECHANGE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 if ( wParam == 0x8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 case WM_SIZING:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 case WM_LBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12388 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 LABEL_210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 goto LABEL_263;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
12400 if (GetCurrentMenuID() != MENU_CREATEPARTY)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 goto LABEL_229;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 case WM_RBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 goto LABEL_240;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12407 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 case WM_LBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 goto LABEL_218;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12416 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 pArcomageGame->stru1.field_0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 case WM_RBUTTONUP:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 if ( pAsyncMouse != v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 back_to_game();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12431 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 pArcomageGame->stru1.field_0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 goto LABEL_262;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 case WM_LBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12440 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 pArcomageGame->stru1.field_0 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 if ( uCurrentMenuID != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 goto LABEL_230;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 LABEL_229:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 sub_41CD4F(0x29u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 LABEL_230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 if ( pGame != (Game *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 if ( pAsyncMouse != (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, v28, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 if ( pAsyncMouse == (void *)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 UI_OnMouseLeftClick(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 case WM_RBUTTONDBLCLK:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 pVideoPlayer->bStopBeforeSchedule = 1;
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12478 if (!pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12480 if (pGame)
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12481 {
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12482 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 v33 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &stru_F93E30, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 }
82
f9a33f75bae3 Qick Record
Nomad
parents: 76
diff changeset
12487 if (!pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12494 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 pArcomageGame->stru1.field_0 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 case WM_MBUTTONDOWN:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 if ( pGame && !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 v34 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &a3, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 if ( !pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 sub_417871(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 case WM_MOUSEMOVE:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12516 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 pXY[0] = (unsigned __int16)lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 pXY[1] = lParam >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 ArcomageGame::OnMouseMove((POINT *)pXY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 ArcomageGame::OnMouseClick(0, wParam & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 v29 = (wParam >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 LABEL_262:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 v30 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 LABEL_263:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 ArcomageGame::OnMouseClick(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12530 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 if ( Msg == WM_SYSCOMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 if ( wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 if ( Msg > WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 if ( Msg == WM_WINDOWPOSCHANGED )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12547 if (pVideoPlayer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12548 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12549 if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12550 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12551 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12552 return DefWindowProcA(hWnd, Msg, wParam, v4);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
12553 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 if ( Msg != WM_KEYFIRST )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 if ( Msg == WM_KEYUP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 if ( wParam == VK_CONTROL )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 dword_507B98_ctrl_pressed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 if ( Msg == WM_CHAR )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 if ( !pKeyActionMap->_459F10(wParam) && !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 GUI_HandleHotkey(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 if ( Msg != WM_COMMAND )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 if ( wParam != 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 if ( wParam == 103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 pRenderer->SavePCXScreenshot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 if ( wParam == 104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 pArcomageGame->field_F6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 if ( wParam != 40001 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 v36 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v35 = ::hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 LABEL_104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 SendMessageA(v35, v36, v37, v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 if ( dword_506E68 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 pKeyActionMap->_459F10(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 if ( !pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 if ( pVideoPlayer->pVideoFrame.pPixels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 pVideoPlayer->bStopBeforeSchedule = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 if ( wParam != 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 if ( wParam == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 dword_507B98_ctrl_pressed = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 v12 = ptr_507BC0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 if ( wParam <= 0x24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 if ( wParam > 0x28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 if ( wParam != 115 || pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 v37 = 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 LABEL_126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 v36 = 273;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 v35 = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 goto LABEL_104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12645 if ( pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
12646 && pCurrentScreen != 21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 if ( !viewparams->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 sub_41CD4F(wParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 pArcomageGame->stru1.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 if ( (signed int)(unsigned __int16)v13 > 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 if ( v13 > 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 v24 = v13 - 91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 LOBYTE(pArcomageGame->stru1.field_8) = 123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 if ( !v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 LOBYTE(pArcomageGame->stru1.field_8) = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 LOBYTE(pArcomageGame->stru1.field_8) = 125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 if ( v26 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 LOBYTE(pArcomageGame->stru1.field_8) = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 if ( v13 == 61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 LOBYTE(pArcomageGame->stru1.field_8) = 43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 v21 = v13 - 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 LOBYTE(pArcomageGame->stru1.field_8) = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 LOBYTE(pArcomageGame->stru1.field_8) = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 v23 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 LOBYTE(pArcomageGame->stru1.field_8) = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 if ( v23 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 LOBYTE(pArcomageGame->stru1.field_8) = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 if ( (unsigned __int16)v13 == 54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 LOBYTE(pArcomageGame->stru1.field_8) = 94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 if ( v13 > 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 v18 = v13 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 LOBYTE(pArcomageGame->stru1.field_8) = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 LOBYTE(pArcomageGame->stru1.field_8) = 35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 LOBYTE(pArcomageGame->stru1.field_8) = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 LOBYTE(pArcomageGame->stru1.field_8) = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 if ( v13 == 49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 LOBYTE(pArcomageGame->stru1.field_8) = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 v14 = v13 - 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 LOBYTE(pArcomageGame->stru1.field_8) = 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 v15 = v14 - 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 LOBYTE(pArcomageGame->stru1.field_8) = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 v16 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 LOBYTE(pArcomageGame->stru1.field_8) = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 LOBYTE(pArcomageGame->stru1.field_8) = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 LOBYTE(pArcomageGame->stru1.field_8) = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 if ( wParam == 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 pArcomageGame->field_F5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 pArcomageGame->field_F4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 pArcomageGame->uGameResult = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 pArcomageGame->field_B0 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 if ( wParam != 114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 SendMessageA(hWnd, 0x111u, 0x68u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 v37 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 goto LABEL_126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 LOBYTE(pArcomageGame->stru1.field_8) = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 if ( Msg == WM_ACTIVATEAPP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 if ( wParam && (GetForegroundWindow() == hWnd || GetForegroundWindow() == hInsertCDWindow) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 dword_4E98BC_bApplicationActive = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 v10 = GetDC(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 a2 = GetDeviceCaps(v10, BITSPIXEL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 v11 = GetDeviceCaps(v10, PLANES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 ReleaseDC(0, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 if ( a2 != 16 || v11 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 Abortf(pGlobalTXT_LocalizationStrings[62]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12831 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 if ( BYTE1(dword_6BE364_game_settings_1) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 BYTE1(dword_6BE364_game_settings_1) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 if ( BYTE1(dword_6BE364_game_settings_1) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 if ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 pRenderer->RestoreFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 pRenderer->_4A184C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 if ( !(dword_6BE364_game_settings_1 & 0x100) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 pVideoPlayer->bStopBeforeSchedule = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12868 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 dword_6BE364_game_settings_1 |= 0x100u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 if ( pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 BYTE1(dword_6BE364_game_settings_1) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 if ( pMiscTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 BYTE1(dword_6BE364_game_settings_1) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 if ( pGame && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 }
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12891 if (Msg == WM_CREATE)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12892 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12893 auto hDC = GetDC(hWnd);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12894 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12895 if (GetDeviceCaps(hDC, BITSPIXEL) < 8)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12896 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12897 ReleaseDC(hWnd, hDC);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12898 Log::Warning(L"You must be running in 256 color mode or higher.");
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12899 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
12900 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12901 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
12902 ReleaseDC(hWnd, hDC);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 if ( Msg == WM_DESTROY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 v6 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 SetPriorityClass(v6, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 if ( pGame )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 v7 = pGame->pKeyboardInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 if ( LOBYTE(v7->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 pAsyncKeyboard->_45B3A4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12918 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 pAsyncMouse->_46B1DD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 PostQuitMessage(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 if ( Msg == WM_SETFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 if ( ::hWnd == (HWND)wParam )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 dword_4E98BC_bApplicationActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 ClipCursor(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12931 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 _def_wnd_proc:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 v4 = lParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 if ( Msg != WM_KILLFOCUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 if ( Msg == WM_PAINT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 if ( !GetUpdateRect(hWnd, 0, 0) || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 BeginPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 if ( pArcomageGame->bGameInProgress )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 pArcomageGame->field_F9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 v5 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 EndPaint(hWnd, &Paint);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 if ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 goto _def_wnd_proc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 return DefWindowProcA(hWnd, Msg, wParam, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 //----- (00464479) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 int v0; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12980 if (pMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 pMouse->SetCursorBitmap("MICON1");
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12982
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 pPaletteManager->ResetNonLocked();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 pBitmaps_LOD->ReleaseAll2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 pSprites_LOD->DeleteSomeOtherSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 pIcons_LOD->ReleaseAll2();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12987 if (pRenderer->pRenderD3D)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 pRenderer->field_1036B8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 pRenderer->_gpu_memory_used = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 sub_46080D();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12993 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 pIndoor->Release();
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12995 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
12996 pOutdoor->Release2();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 pSoundList->_4A9D79(0);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13000 uCurrentlyLoadedLevelType = LEVEL_null;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 pSpriteFrameTable->ResetSomeSpriteFlags();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 v0 = uNumVisibleWindows;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 while ( v0 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 //----- (004646F0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 void PrepareWorld(unsigned int this_)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 v1 = this_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 pGame->pVisInstance->_4C1A02();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 pParty->uFlags = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 pStru277->_427D48(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 DoPrepareWorld(0, (v1 == 0) + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 //----- (00464761) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 void __thiscall Game_DeinitializeAndTerminate(int exitCode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 v1 = exitCode;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 v2 = GetCurrentProcess();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 SetPriorityClass(v2, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 pRenderer->Release2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 if ( !DestroyWindow(hWnd) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 GetLastError();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 hWnd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 exit(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 //----- (004647AB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 void __cdecl FinalInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 pViewport->_4C02F8((signed __int64)(flt_6BE3A0 * 65536.0));
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13051
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13052 pIndoorCamera = new IndoorCamera;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 pIndoorCamera->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 65,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 viewparams->uScreenZ - viewparams->uScreenX + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 viewparams->uScreenW - viewparams->uScreenY + 1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13057
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 InitializeTurnBasedAnimations(&stru_50C198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 // 6BE3A0: using guessed type float flt_6BE3A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 //----- (00464839) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 char __cdecl Is_out15odm_underwater()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 return _strcmpi(pCurrentMapName, "out15.odm") == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 //----- (00464851) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 void __cdecl SetUnderwaterFog()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 day_fogrange_1 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 day_fogrange_2 = 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13077
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13078
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 //----- (00464866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 void __fastcall DoPrepareWorld(unsigned int bLoading, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 char *v3; // eax@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13085 //char *v4; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 unsigned int v5; // eax@3
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13087 //size_t v6; // ecx@10
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13088 //char *v7; // eax@11
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 char Str1[20]; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 unsigned int v9; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 v9 = bLoading;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 pDecalBuilder->Reset(0);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
13096 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 v3 = strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 strcpy(Str1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 Level_LoadEvtAndStr(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 LoadLevel_InitializeLevelEvt();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 strcpy(Str1, pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 _strrev(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 strtok(Str1, ".");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 _strrev(Str1);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13106
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13107 for (uint i = 0; i < 1000; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13108 pLayingItems[i].uObjectDescID = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13109
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 v5 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 bUnderwater = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 uLevelMapStatsID = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 pGame->uFlags2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 if ( !_strcmpi(pCurrentMapName, "out15.odm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 bUnderwater = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 pGame->uFlags2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 pParty->field_6F4_packedid = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 if ( _strcmpi(Str1, "blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 PrepareToLoadODM(v9, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 PrepareToLoadBLV(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 pAudioPlayer->SetMapEAX();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 sub_461103();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 if ( !_strcmpi(pCurrentMapName, "d11.blv") || !_strcmpi(pCurrentMapName, "d10.blv") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 {
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13128 //spawning grounds & good analogue - no loot & exp from monsters
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13129
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13130 for (uint i = 0; i < uNumActors; ++i)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13131 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13132 pActors[i].pMonsterInfo.uTreasureType = 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13133 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13134 pActors[i].pMonsterInfo.uExp = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 bDialogueUI_InitializeActor_NPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 OnMapLoad();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 pGameLoadingUI_ProgressBar->Progress();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 pGameLoadingUI_ProgressBar->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 _flushall();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
13143
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 //----- (004649EF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 int v3; // [sp+4h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 DWORD cbData; // [sp+8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 DWORD dwDisposition; // [sp+10h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 BYTE Data[4]; // [sp+14h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 HKEY hKey; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 HKEY phkResult; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 HKEY v10; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 HKEY v11; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 v3 = uDefValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 cbData = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13167 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13168 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13169 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v10, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13170 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13171 if ( !RegCreateKeyExA(v10, "1.0", 0, "", 0, 0xF003Fu, 0, &v11, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 *(int *)Data = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 RegCloseKey(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 RegCloseKey(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 return *(int *)Data;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 //----- (00464B02) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 size_t v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 const char *Str; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 HKEY v8; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 HKEY v9; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 Str = pString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13209 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13210 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13211 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13212 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13213 if ( !RegCreateKeyExA(v8, "1.0", 0, "", 0, 0xF003Fu, 0, &v9, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 v2 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 RegSetValueExA(v9, lpValueName, 0, 1u, (const BYTE *)Str, v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 RegCloseKey(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 //----- (00464BEF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 LSTATUS (__stdcall *v4)(HKEY); // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 LSTATUS result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 DWORD Type; // [sp+Ch] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 LPCSTR lpValueName; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 DWORD cbData; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 LPBYTE Dest; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 DWORD dwDisposition; // [sp+1Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237 HKEY phkResult; // [sp+20h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 HKEY hKey; // [sp+24h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 HKEY v13; // [sp+28h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 HKEY v14; // [sp+2Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 cbData = uBufLen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 Dest = (LPBYTE)pOutString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 lpValueName = pKeyName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey)
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13251 || RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13252 || RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v13, &dwDisposition)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13253 || RegCreateKeyExA(v13, "1.0", 0, "", 0, 0xF003Fu, 0, &v14, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 if ( RegQueryValueExA(v14, lpValueName, 0, &Type, Dest, &cbData) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 v4 = RegCloseKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 RegCloseKey(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 RegCloseKey(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 result = RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 result = v4(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 result = v4(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 if ( hKey )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 result = v4(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 if ( phkResult )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 result = v4(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 //----- (00464D32) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 const char *lpValueName; // [sp+4h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 BYTE Data[4]; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 HKEY hKey; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 HKEY phkResult; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 HKEY v7; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 HKEY v8; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 *(int *)Data = val;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 lpValueName = pKey;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 hKey = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 phkResult = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13302 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13303 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13304 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v7, &dwDisposition) )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13305 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13306 if ( !RegCreateKeyExA(v7, "1.0", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 RegSetValueExA(v8, lpValueName, 0, 4u, Data, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 RegCloseKey(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 RegCloseKey(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 RegCloseKey(phkResult);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 RegCloseKey(hKey);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 //----- (00464E17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 bool __fastcall CheckMM7CD(char c)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 char DstBuf[256]; // [sp+Ch] [bp-218h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 char strCommand[256]; // [sp+10Ch] [bp-118h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 char Filename[20]; // [sp+20Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 wchar_t pMagicPath[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 swprintf(pMagicPath, L"%C:\\anims\\magic7.vid", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 if (GetFileAttributesW(pMagicPath) == -1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 wsprintfA(strCommand, "info CD UPC wait");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 wsprintfA(strCommand, "close CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 mciSendStringA(strCommand, DstBuf, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 *Filename = c;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 auto f = fopen(Filename, "rb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 if (!f)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 if (!fseek(f, 0, SEEK_END))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 if (!fseek(f, -100, SEEK_CUR))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 fread(DstBuf, 1u, 0x64u, f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 fclose(f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 //----- (00464F1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 char v4; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 int v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 INT_PTR v12; // [sp-4h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 if ( a2 == 272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 hInsertCDWindow = hDlg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 v7 = v6 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 v8 = v7 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 v9 = v8 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 if ( v9 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 v11 = "Odwolaj";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 SetWindowTextA(hDlg, "Inserire il secondo CD");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 v11 = "Annulla";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 SetWindowTextA(hDlg, "Insérez le CD 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 v11 = "Supprimer";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 v11 = "Cancelar";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 v10 = SetDlgItemTextA;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 v11 = "Abbrechen";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 v10(hDlg, 2, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 if ( a2 == 273 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 if ( a3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 EndDialog(hDlg, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 v4 = a3 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 v4 = a2 == 1025;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 //----- (00465061) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 char drive[4] = {'X', ':', '\\', 0};
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 bool bGotCDFromRegistry = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 HKEY hSoftware = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 hNWC = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 hMM7 = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 hVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 DWORD cbData = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 bGotCDFromRegistry = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 RegCloseKey(hVersion);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 RegCloseKey(hMM7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 RegCloseKey(hNWC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 RegCloseKey(hSoftware);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482 if (bGotCDFromRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 if (CheckMM7CD(*drive))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 while (true)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 for (uint i = 0; i < 26; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 drive[0] = 'A' + i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 if (GetDriveTypeA(drive) == DRIVE_CDROM)
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13496 if (CheckMM7CD(*drive))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 cMM7GameCDDriveLetter = *drive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 WriteWindowsRegistryString("CDDrive", drive);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", ::hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 //----- (004651F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 bool MM7_Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 {
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13513 wchar_t pCurrentDir[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13514 _wgetcwd(pCurrentDir, 1024);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13515
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13516 wchar_t pMM6IniFile[1024];
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13517 wsprintf(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13518
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13519 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13520 if (bNoCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13521 bCanLoadFromCD = false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13522 if (bCanLoadFromCD)
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13523 {
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13524 if (!FindMM7CD(hWnd, &cMM7GameCDDriveLetter))
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13525 return false;
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13526 }
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13527
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13528
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 srand(GetTickCount());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 /*GetDiskFreeSpaceA(0, &SectorsPerCluster, &BytesPerSector, &hdc, &TotalNumberOfClusters);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 v4 = hdc * BytesPerSector * SectorsPerCluster;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 if ( (unsigned int)v4 < 0x1E00000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 "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
13538 (unsigned int)v4 / 1024i64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 v41 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 v40 = "More Hard Drive Space Required";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 v39 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 WNDCLASSEXW wcxw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 wcxw.cbSize = sizeof(wcxw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 wcxw.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 wcxw.lpfnWndProc = (WNDPROC)aWinProc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 wcxw.cbClsExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 wcxw.cbWndExtra = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 wcxw.hInstance = GetModuleHandleW(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 wcxw.hCursor = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 wcxw.hIcon = wcxw.hIconSm = LoadIconW(wcxw.hInstance, L"MM7_ICON");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 wcxw.lpszMenuName = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 wcxw.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13556 wcxw.lpszClassName = L"M&MTrilogy";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 if (!RegisterClassExW(&wcxw))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 Log::Warning(L"Cannot register window class");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 auto hDesktopDC = GetDC(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 uint uDesktopWidth = GetDeviceCaps(hDesktopDC, HORZRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 uint uDesktopHeight = GetDeviceCaps(hDesktopDC, VERTRES);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 if (GetDeviceCaps(hDesktopDC, BITSPIXEL) != 16 ||
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 GetDeviceCaps(hDesktopDC, PLANES) != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 dword_6BE364_game_settings_1 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 ReleaseDC(nullptr, hDesktopDC);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 uint uTotalWinWidth = 2 * GetSystemMetrics(SM_CXFRAME) + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 uint uTotalWinHeight = GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYFRAME) + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 uint uWinCenteredPosX = (uDesktopWidth - uTotalWinWidth) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 uint uWinCenteredPosY = (uDesktopHeight - uTotalWinHeight) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 uWindowX = ReadWindowsRegistryInt("window X", uWinCenteredPosX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 uWindowX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 WriteWindowsRegistryInt("window X", uWindowX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 uWindowY = ReadWindowsRegistryInt("window Y", uWinCenteredPosY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 uWindowY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 WriteWindowsRegistryInt("window Y", uWindowY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 hWnd = CreateWindowExW(0, wcxw.lpszClassName, L"Might and Magic® VII",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 uWindowStyle = WS_SYSMENU | WS_GROUP | WS_DLGFRAME | WS_BORDER,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 640, 480,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 hOSMenu = nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 wcxw.hInstance,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 nullptr);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13597 SetWindowTextW(hWnd, L"Might and Magic® VII");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 pRenderer = Render::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 if (!pRenderer)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 Log::Warning(L"Render creation failed");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 if (!pRenderer->Initialize(bWindowMode, uDefaultDevice, bColoredLights, uLevelOfDetail, bTinting))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 Log::Warning(L"Render failed to initialize");
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 pAllocator = Allocator::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 if (!pAllocator->Initialize(26 * 1024))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 L"Unable to Allocate 26Mb of RAM",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 L"More RAM Memory Required", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 pParty = new Party;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 pParty->sEyelevel = pParty->uDefaultEyelevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 bUseRegistry = GetPrivateProfileIntW(L"settings", L"registry", 1, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 MM6_Initialize(pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 pKeyActionMap = new KeyboardActionMapping;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 pEventTimer = Timer::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 pEventTimer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 OnTimer(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 GameUI_StatusBar_UpdateTimedString(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 pGame = Game::Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 pMouse = pGame->pMouseInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 RECT rcWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 GetWindowRect(hWnd, &rcWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 RECT rcClient;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 GetClientRect(hWnd, &rcClient);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 uWindowWidth = rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 uWindowHeight = rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 MoveWindow(hWnd, uWindowX, uWindowY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 rcClient.left - rcClient.right - rcWindow.left + rcWindow.right + 640,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 rcClient.top - rcClient.bottom - rcWindow.top + rcWindow.bottom + 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 ShowWindow(hWnd, SW_SHOWNORMAL);
4
4acbadf78023 missing file added
Nomad
parents: 3
diff changeset
13664
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 pIcons_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 if (!pIcons_LOD->LoadIconsOrEvents("data\\icons.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 pIcons_LOD->dword_011BA4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 pEvents_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 if (!pEvents_LOD->LoadIconsOrEvents("data\\events.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 MessageBoxW(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 L"Some files are missing\n\nPlease Reinstall.",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 L"Files Missing", MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 InitializeGameText();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 pBitmaps_LOD = new LODFile_IconsBitmaps;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 if (!pBitmaps_LOD->LoadBitmaps("data\\bitmaps.lod"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 bUseLoResSprites = ReadWindowsRegistryInt("resolution", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 bUseLoResSprites = GetPrivateProfileIntW(L"settings", L"resolution", 0, pMM6IniFile);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 const char *pSpritesFile = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 if (bUseLoResSprites)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 pSpritesFile = "data\\spriteLO.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 pSpritesFile = "data\\sprites.lod";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 pSprites_LOD = new LODFile_Sprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 if (!pSprites_LOD->LoadSprites(pSpritesFile))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 MessageBoxA(nullptr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 pGlobalTXT_LocalizationStrings[63],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 if (!pSpriteFrameTable->FromFileTxt("data\\sft.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 Abortf("Unable to open sft.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 if (!pDecorationList->FromFileTxt("data\\declist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 Abortf("Unable to open declist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 if (!pObjectList->FromFileTxt("data\\objlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 Abortf("Unable to open objlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 if (!pMonsterList->FromFileTxt("data\\monlist.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 Abortf("Unable to open monlist.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 if (!pIconsFrameTable->FromFileTxt("data\\ift.txt"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 Abortf("Unable to open ift.txt");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 if (!pTextureFrameTable->FromFileTxt("data\\tft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 Abortf("Unable to open tft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 if (!pTileTable->FromFileTxt("data\\tile.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 Abortf("Unable to open tile.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 if (!pPlayerFrameTable->FromFileTxt("data\\pft.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 Abortf("Unable to open pft.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 if (!pChestList->FromFileTxt("data\\chest.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 Abortf("Unable to open chest.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 if (!pOverlayList->FromFileTxt("data\\overlay.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 Abortf("Unable to open overlay.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 if (!pSoundList->FromFileTxt("data\\sounds.def"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 Abortf("Unable to open sounds.def");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 auto pSFT = pEvents_LOD->LoadRaw("dsft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 pSpriteFrameTable = new SpriteFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 pSpriteFrameTable->FromFile(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 free(pSFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 auto pTFT = pEvents_LOD->LoadRaw("dtft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 pTextureFrameTable = new TextureFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 pTextureFrameTable->FromFile(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 free(pTFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 auto pTiles = pEvents_LOD->LoadRaw("dtile.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 pTileTable = new TileTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 pTileTable->FromFile(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 free(pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 auto pPFT = pEvents_LOD->LoadRaw("dpft.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 pPlayerFrameTable = new PlayerFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 pPlayerFrameTable->FromFile(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 free(pPFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 auto pIFT = pEvents_LOD->LoadRaw("dift.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 pIconsFrameTable = new IconFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 pIconsFrameTable->FromFile(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 free(pIFT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 auto pDecs = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 pDecorationList = new DecorationList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 pDecorationList->FromFile(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 free(pDecs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 auto pObjs = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 pObjectList = new ObjectList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 pObjectList->FromFile(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 free(pObjs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 auto pMons = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 pMonsterList = new MonsterList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 pMonsterList->FromFile(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 free(pMons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 auto pChests = pEvents_LOD->LoadRaw("dchest.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 pChestList = new ChestList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 pChestList->FromFile(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 free(pChests);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 auto pOverlays = pEvents_LOD->LoadRaw("doverlay.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 pOverlayList = new OverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 pOverlayList->FromFile(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 free(pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 auto pSounds = pEvents_LOD->LoadRaw("dsounds.bin", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 pSoundList = new SoundList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 pSoundList->FromFile(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 free(pSounds);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 if (bDebugResouces)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 pSpriteFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 pDecorationList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 pObjectList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 pMonsterList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 pIconsFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 pTextureFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 pTileTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 pPlayerFrameTable->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 pChestList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 pOverlayList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 pSoundList->ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 // color depth != 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 // or
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 // not in window
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 SetMenu(hWnd, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 SetWindowLongA(hWnd, GWL_EXSTYLE, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 pAsyncMouse->Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 pRenderer->InitializeFullscreen(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 ClipCursor(nullptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 pRenderer->SwitchToWindow(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 uSoundVolumeMultiplier = ReadWindowsRegistryInt("soundflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13855 if (uSoundVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 uSoundVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 uMusicVolimeMultiplier = ReadWindowsRegistryInt("musicflag", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13858 if (uMusicVolimeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 uMusicVolimeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 uVoicesVolumeMultiplier = ReadWindowsRegistryInt("CharVoices", 9);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13861 if (uVoicesVolumeMultiplier > 9)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 uVoicesVolumeMultiplier = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 byte_6BE388_graphicsmode = ReadWindowsRegistryInt("graphicsmode", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 if (byte_6BE388_graphicsmode < 0 || byte_6BE388_graphicsmode > 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 byte_6BE388_graphicsmode = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 uGammaPos = ReadWindowsRegistryInt("GammaPos", 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 if (uGammaPos < 0 || uGammaPos > 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 uGammaPos = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 if ( ReadWindowsRegistryInt("Bloodsplats", 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 pGame->uFlags2 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 pGame->uFlags2 &= 0xFFFFFFDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 dword_6BE384_2dacceloff = ReadWindowsRegistryInt("2dacceloff", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13881 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 pAudioPlayer->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 pVideoPlayer = new VideoPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 pVideoPlayer->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13887 dword_6BE364_game_settings_1 |= 0x4000;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 switch ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 uTurnSpeed = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 uTurnSpeed = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 uTurnSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 }
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13908 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 //----- (00465D0B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 void __cdecl SecondaryInitialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 __int16 v4; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 signed int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 int v7; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 ObjectDesc *v8; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 char pContainer[32]; // [sp+10h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 pMouse->Initialize(hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 CreateAsyncMouse();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 CreateAsyncKeyboard();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 pItemsTable = new ItemsTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 pItemsTable->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 pBitmaps_LOD->dword_011BA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
90
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13935 pPaletteManager->pPalette_mistColor[0] = 128;
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13936 pPaletteManager->pPalette_mistColor[1] = 128;
8c6308bb19b3 2.11.12
Ritor1
parents: 82
diff changeset
13937 pPaletteManager->pPalette_mistColor[2] = 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 pPaletteManager->RecalculateAll();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 pSprites_LOD->field_ECAC = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 pObjectList->InitializeSprites();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 pOverlayList->InitializeSprites();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
13942 if (!bNoSound)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13943 pSoundList->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 static const char *pUIAnimNames[4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 "glow03", "glow05",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 "torchA", "wizeyeA"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 static unsigned short _4E98D0[4][4] =
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 {479, 0, 329, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 {585, 0, 332, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 {468, 0, 0, 0},
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 {606, 0, 0, 0}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 for (uint i = 0; i < 4; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 pUIAnims[i]->uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 pUIAnims[i]->uAnimTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 pUIAnims[i]->x = _4E98D0[i][0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 pUIAnims[i]->y = _4E98D0[i][2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 if ( (signed int)pObjectList->uNumObjects > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 BYTE3(v7) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 v8 = &pObjectList->pObjects[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 *(short *)((char *)&v7 + 1) = v8->uParticleTrailColorR;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 LOBYTE(v7) = v8->uParticleTrailColorG;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 v8->uParticleTrailColor = v8->uParticleTrailColorB | (v7 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 while ( v5 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 flt_6BE3A0 = 0.55000001f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 MainMenuUI_Create();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 pGame->pStru6Instance->LoadAnimations();
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13989
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13990 for (uint i = 0; i < 7; ++i)
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13991 {
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13992 sprintf(pContainer, "HDWTR%03u", i);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13993 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(pContainer);
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
13994 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 pNPCStats = new NPCStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 pNPCStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 Initialize_GlobalEVT();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 pBitmaps_LOD->dword_11B80 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 if ( pBitmaps_LOD->dword_11B84 < (signed int)pBitmaps_LOD->uNumLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 pSprites_LOD->field_ECA4 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 if ( pSprites_LOD->field_ECA0 < (signed int)pSprites_LOD->uNumLoadedSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 pPaletteManager->LockAll();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14007
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 _mkdir("Saves");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14009 for (uint i = 0; i < 5; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14010 for (uint j = 0; j < 6; ++j)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14011 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14012 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14013 remove(pTmpBuf);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14014 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14015 /*do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 sprintfex(pTmpBuf, "data\\lloyd%d%d.pcx", v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 remove(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 while ( v11 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14027 while ( v10 < 5 );*/
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14028
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 Initialize_GamesLOD_NewLOD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 dword_576E2C = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 dword_576E28 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 bool MM_Main(const wchar_t *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 HWND hPrevWnd; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 HWND hPrevWnd_; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 HWND v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 int v8; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 //bool v9; // edx@16
30
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14050 //OtherOverlay *v10; // esi@44
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14051 //signed int v11; // edi@44
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 unsigned int v12; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 HANDLE v13; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 unsigned int startms; // [sp+8h] [bp-24h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 RECT Rect; // [sp+Ch] [bp-20h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 int a2[4]; // [sp+1Ch] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14058 auto mm7text_dll = LoadLibraryW(L"mm7text.dll");
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14059 sprintfex = (int (__cdecl *)(char *a1, const char *a2, ...))GetProcAddress(mm7text_dll, "_sprintfex");
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
14060
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 if (pCmdLine && *pCmdLine)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 if (wcsstr(pCmdLine, L"-usedefs"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 bDebugResouces = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 if (wcsstr(pCmdLine, L"-window"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 dword_6BE368_debug_settings_2 |= 1u;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14067
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14068 if (wcsstr(pCmdLine, L"-nointro"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14069 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14070 if (wcsstr(pCmdLine, L"-nologo"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14071 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 if (wcsstr(pCmdLine, L"-nosound"))
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14073 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14074
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14075 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14076 if (wcsstr(pCmdLine, L"-nowalksound"))
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14077 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 if (wcsstr(pCmdLine, L"-noanim"))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 dword_6BE364_game_settings_1 |= 0x40;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14081 bNoVideo = true;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14082 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14083 if (wcsstr(pCmdLine, L"-nocd"))
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14084 bNoCD = true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 stru_51076C.registry_debug_flags = ReadWindowsRegistryInt("debug flags", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 v8 = sub_4AC1C9(0, (Vec4_int_ *)a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 Rect.left = *(int *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 Rect.top = *(int *)(v8 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 Rect.right = *(int *)(v8 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 Rect.bottom = *(int *)(v8 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 uCPUSpeed = Rect.bottom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 if (MM7_Initialize())
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14099 Log::Warning(L"MM init: ok");
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14100
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 SetWindowPos(hWnd, (HWND)((int)HWND_MESSAGE|0x2), 320, 240, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 Rect.left = 325;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 Rect.top = 245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 Rect.right = 326;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 Rect.bottom = 246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 ClipCursor(&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 SetUserInterface(1, false);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 WriteWindowsRegistryInt("Ran once", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 dword_6BE364_game_settings_1 |= 0x4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 pGame->InitializeGammaController();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 SecondaryInitialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 pRenderer->Clip_v2(0, 0, 639u, 479u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 FinalInitialization();
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14119
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14120 Log::Warning(L"MM: entering main loop");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 MainMenu_Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14128 switch (uGameState)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14129 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14130 case GAME_FINISHED:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 pGame->Deinitialize();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14132 return true;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14133 }
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14134
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14135 if (GetCurrentMenuID() == MENU_FINISHED)
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14136 {
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14137 uGameState = GAME_FINISHED;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14138 continue;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14140 if (GetCurrentMenuID() == MENU_NEWGAME)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 pParty->Reset();
30
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14145
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14146 for (uint k = 0; k < 50; ++k)
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14147 pOtherOverlayList->pOverlays[k].Reset();
4723e86bc51c Party creation initial fix.
Nomad
parents: 29
diff changeset
14148
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 strcpy(pCurrentMapName, pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 pParty->CreateDefaultParty(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 PlayerCreationUI_Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 if ( PlayerCreationUI_Loop() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 DeleteCCharFont();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 DeleteCCharFont();
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
14158 bFlashQuestBook = true;
13
17150bdf321e иÑправлено неполное воÑпроизведение роликов, бинков
Серик@ПончиК
parents: 4
diff changeset
14159 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0);
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
14160 Autosave();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14163 if (GetCurrentMenuID() == MENU_CREDITS)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 break;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14165 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LOAD)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14171 if (GetCurrentMenuID() != MENU_10)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 pMouse->Activate(0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14174 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 pAsyncKeyboard->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 pParty->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 pParty->CreateDefaultParty(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 crt_init_globals_46271C();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 extern OPENFILENAMEA ofn;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14185 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 _chdir("..\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 strcpy(pCurrentMapName, ofn.lpstrFileTitle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 pMouse->Activate(1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14194 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 pGame->Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 if ( uGameState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 v12 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 goto LABEL_57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 if ( uGameState == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 LABEL_57:
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14211 SetCurrentMenuID((MENU_STATE)v12);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 if ( uGameState == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 uGameState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 if ( pAudioPlayer->hAILRedbook )
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 extern MENU_STATE __cdecl CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 CreditsMenu__Loop();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 LABEL_53:
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14228 if (!bNoSound && pAudioPlayer->hAILRedbook)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 pAudioPlayer->SetMusicVolume(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 unsigned int end_ms;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 0xEu, &startms, &end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14240 else
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14241 Log::Warning(L"MM init: failed");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 pGame->Deinitialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 //----- (004637E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 char __cdecl sub_4637E0_is_there_popup_onscreen()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 return dword_507BF0_is_there_popup_onscreen == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 //----- (00465F5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 void __cdecl CreateAsyncMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 if (!pAsyncMouse &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 pRenderer->bUserDirect3D &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 pRenderer->uAcquiredDirect3DDevice == 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 pAsyncMouse = new AsyncMouse(&pRenderer->pDirectDraw4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 if (pAsyncMouse)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 //----- (00465FF0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 void __cdecl CreateAsyncKeyboard()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 LOG_DECOMPILATION_WARNING();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 if (!pAsyncKeyboard &&
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 pGame->pKeyboardInstance->bUsingAsynKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 pAsyncKeyboard = new AsyncKeyboard;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 if (pAsyncKeyboard)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 //----- (00466082) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 void MM6_Initialize(const wchar_t *pIniFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 //int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 UINT v1; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 size_t v2; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 size_t v3; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 size_t v4; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 //char v5[120]; // [sp+Ch] [bp-17Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 //char String[120]; // [sp+84h] [bp-104h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 unsigned int v9; // [sp+184h] [bp-4h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 //_getcwd(v5, 120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 viewparams = new ViewingParams;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 viewparams->uScreenX = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 viewparams->uScreenY = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 viewparams->uScreenZ = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 viewparams->uScreenW = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 pAudioPlayer = new AudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 if ( pAudioPlayer->uMixerChannels > 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 pAudioPlayer->uMixerChannels = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
14316
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 dword_6BE368_debug_settings_2 |= 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 if (bUseRegistry)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 v1 = ReadWindowsRegistryInt("startinwindow", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 v1 = GetPrivateProfileIntW(L"debug", L"startinwindow", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 if (v1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 dword_6BE368_debug_settings_2 |= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 dword_6BE368_debug_settings_2 |= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 dword_6BE368_debug_settings_2 |= 0x10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 dword_6BE368_debug_settings_2 |= 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 wchar_t pStartingMapNameW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 sprintf(pStartingMapName, "%S", pStartingMapNameW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 if ( strlen(pStartingMapName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 if ( pStartingMapName[v9] == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 pStartingMapName[v9] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 v2 = strlen(pStartingMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 while ( v9 < v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 pOutdoorCamera = new OutdoorCamera;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 outdoor_day_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.r", 81, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 outdoor_day_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.g", 121, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 outdoor_day_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.b", 236, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 outdoor_day_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.r", 153, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 outdoor_day_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.g", 193, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 outdoor_day_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.b", 237, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 outdoor_night_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.r", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 outdoor_night_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.g", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 outdoor_night_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.b", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 outdoor_night_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.r", 11, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 outdoor_night_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.g", 41, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 outdoor_night_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.b", 129, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 pOutdoorCamera->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 pOutdoorCamera->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 pOutdoorCamera->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 pOutdoorCamera->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 pOutdoorCamera->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 pOutdoorCamera->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 mipmapping_terrain_mm1 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm1", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 mipmapping_terrain_mm2 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm2", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 mipmapping_terrain_mm3 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm3", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 mipmapping_building_mm1 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm1", 1024, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 mipmapping_building_mm2 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm2", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 pOutdoorCamera->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 pOutdoorCamera->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 pOutdoorCamera->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 wchar_t pDefaultSkyTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 wchar_t pDefaultGroundTextureW[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 wchar_t pFloat[1024];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 if ( strlen(pDefaultSkyTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 if ( pDefaultSkyTexture[v3] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 pDefaultSkyTexture[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 while ( v3 < strlen(pDefaultSkyTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 if ( strlen(pDefaultGroundTexture) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 if ( pDefaultGroundTexture[v4] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 pDefaultGroundTexture[v4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 while ( v4 < strlen(pDefaultGroundTexture) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 texmapping_terrain_subdivsize = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivsize", 16, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 texmapping_terrain_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivpow2", 4, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 texmapping_building_subdivsize = GetPrivateProfileIntW(L"texmapping", L"building_subdivsize", 32, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 texmapping_building_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"building_subdivpow2", 5, pIniFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 //----- (004666D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 void __cdecl MM7Initialization()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 if ( !byte_6BE388_graphicsmode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 outdoor_grid_band_1 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 outdoor_grid_band_2 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 outdoor_grid_band_3 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 pOutdoorCamera->shading_dist_mist = 8192;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 pOutdoorCamera->bNoSky = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 mipmapping_terrain_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 mipmapping_terrain_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 mipmapping_building_mm1 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 mipmapping_building_mm2 = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 pOutdoorCamera->shading_dist_shade = 2048;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 pOutdoorCamera->terrain_gamma = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 pOutdoorCamera->building_gamme = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 mipmapping_terrain_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 mipmapping_building_mm3 = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 pOutdoorCamera->shading_dist_shademist = 4096;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 pOutdoorCamera->outdoor_no_wavy_water = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 sub_47F4D3(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 LOBYTE(viewparams->field_20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 viewparams->uSomeY = viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 viewparams->uSomeX = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 viewparams->uSomeZ = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 viewparams->uSomeW = viewparams->uScreenW;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 pViewport->SetScreen(viewparams->uScreenX, viewparams->uScreenY, viewparams->uScreenZ, viewparams->uScreenW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 //----- (00466B8C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 int __cdecl AbortWithError()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 if ( !aborting_app )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 aborting_app = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 if ( MessageBoxA(0, pGlobalTXT_LocalizationStrings[176], pGlobalTXT_LocalizationStrings[59], 0x34u) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 SaveGame(1, 0); // "Internal Error"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 // "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
14484 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 // 720018: using guessed type int aborting_app;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 //----- (00466BE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 void Abortf(const char *Format, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 va_list va; // [sp+8h] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 va_start(va, Format);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 if ( !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 pRenderer->ChangeBetweenWinFullscreenModes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 vsprintf(pTmpBuf, Format, va);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( pMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 pMouse->Activate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 ClipCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 MessageBoxA(0, pTmpBuf, "Error", 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 Game_DeinitializeAndTerminate(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 //----- (00466C40) --------------------------------------------------------
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14507 const wchar_t *MENU_STATE_to_string(MENU_STATE m)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14508 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14509 switch (m)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14510 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14511 case -1: return L"-1";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14512 case MENU_MAIN: return L"MENU_MAIN";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14513 case MENU_NEWGAME: return L"MENU_NEWGAME";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14514 case MENU_CREDITS: return L"MENU_CREDITS";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14515 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14516 case MENU_FINISHED: return L"MENU_FINISHED";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14517 case MENU_5: return L"MENU_5";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14518 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14519 case MENU_7: return L"MENU_7";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14520 case MENU_Credits: return L"MENU_Credits";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14521 case MENU_LOAD: return L"MENU_LOAD";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14522 case MENU_10: return L"MENU_10";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14523 default: return L"unk";
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14524 };
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14525 };
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14526 void SetCurrentMenuID(MENU_STATE uMenu)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14527 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14528 if ((int)uCurrentMenuID != -1)
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14529 {
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14530 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 pAsyncKeyboard->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 }
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14533 uCurrentMenuID = uMenu;
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14534
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14535 Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 //----- (00466CA0) --------------------------------------------------------
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
14539 MENU_STATE GetCurrentMenuID()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 return uCurrentMenuID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 if ( v4 > -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 switch ( v4 + 2005532212 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 v7 = "DDERR_SURFACENOTATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 v7 = "DDERR_TOOBIGHEIGHT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 v7 = "DDERR_TOOBIGSIZE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v7 = "DDERR_TOOBIGWIDTH";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 case 50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 v7 = "DDERR_UNSUPPORTEDFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 case 60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 v7 = "DDERR_UNSUPPORTEDMASK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 case 61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 v7 = "DDERR_INVALIDSTREAM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 case 77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 v7 = "DDERR_VERTICALBLANKINPROGRESS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 case 80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 v7 = "DDERR_WASSTILLDRAWING";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 case 100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 v7 = "DDERR_XALIGN";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 case 101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 v7 = "DDERR_INVALIDDIRECTDRAWGUID";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 case 102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 v7 = "DDERR_DIRECTDRAWALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 case 103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 v7 = "DDERR_NODIRECTDRAWHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 case 104:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 v7 = "DDERR_PRIMARYSURFACEALREADYEXISTS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 case 105:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 v7 = "DDERR_NOEMULATION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 case 106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 v7 = "DDERR_REGIONTOOSMALL";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 case 107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 v7 = "DDERR_CLIPPERISUSINGHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 case 108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 v7 = "DDERR_NOCLIPPERATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 case 109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 v7 = "DDERR_NOHWND";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 case 110:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 v7 = "DDERR_HWNDSUBCLASSED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 case 111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 v7 = "DDERR_HWNDALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 case 112:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 v7 = "DDERR_NOPALETTEATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 case 113:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 v7 = "DDERR_NOPALETTEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 case 114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 v7 = "DDERR_BLTFASTCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 case 115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 v7 = "DDERR_NOBLTHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 case 116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 v7 = "DDERR_NODDROPSHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 case 117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 v7 = "DDERR_OVERLAYNOTVISIBLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 case 118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 v7 = "DDERR_NOOVERLAYDEST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 case 119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 v7 = "DDERR_INVALIDPOSITION";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 case 120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 v7 = "DDERR_NOTAOVERLAYSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 case 121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 v7 = "DDERR_EXCLUSIVEMODEALREADYSET";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 case 122:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 v7 = "DDERR_NOTFLIPPABLE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 case 123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 v7 = "DDERR_CANTDUPLICATE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 case 125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 v7 = "DDERR_CANTCREATEDC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 case 126:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 v7 = "DDERR_NODC";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 case 127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 v7 = "DDERR_WRONGMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 case 128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 v7 = "DDERR_IMPLICITLYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 case 129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 v7 = "DDERR_NOTPALETTIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 case 130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 v7 = "DDERR_UNSUPPORTEDMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 case 131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 v7 = "DDERR_NOMIPMAPHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 case 132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 v7 = "DDERR_INVALIDSURFACETYPE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 case 140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 v7 = "DDERR_NOOPTIMIZEHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 case 141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 v7 = "DDERR_NOTLOADED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 case 142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 v7 = "DDERR_NOFOCUSWINDOW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 case 160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 v7 = "DDERR_DCALREADYCREATED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 case 170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 v7 = "DDERR_NONONLOCALVIDMEM";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 case 180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 v7 = "DDERR_CANTPAGELOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 case 200:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 v7 = "DDERR_CANTPAGEUNLOCK";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 case 220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v7 = "DDERR_NOTPAGELOCKED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 case 230:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 v7 = "DDERR_MOREDATA";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 case 231:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 v7 = "DDERR_EXPIRED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 case 235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 v7 = "DDERR_VIDEONOTACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 case 239:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 v7 = "DDERR_DEVICEDOESNTOWNSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 case 124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 if ( v4 != -2005532222 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 if ( v4 > -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 if ( v4 <= -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 if ( v4 == -2005532337 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 v7 = "DDERR_NOVSYNCHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 if ( v4 > -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 if ( v4 == -2005532382 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 v7 = "DDERR_NOROTATIONHW";
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 == -2005532362 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 v7 = "DDERR_NOSTRETCHHW";
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 == -2005532356 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 v7 = "DDERR_NOT4BITCOLOR";
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 == -2005532355 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 v7 = "DDERR_NOT4BITCOLORINDEX";
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 if ( v4 == -2005532352 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 v7 = "DDERR_NOT8BITCOLOR";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 if ( v4 == -2005532342 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 v7 = "DDERR_NOTEXTUREHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 if ( v4 == -2005532392 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 v7 = "DDERR_NORASTEROPHW";
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 == -2005532442 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 v7 = "DDERR_NOFLIPHW";
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 == -2005532432 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 v7 = "DDERR_NOGDI";
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 == -2005532422 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 v7 = "DDERR_NOMIRRORHW";
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 == -2005532417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 v7 = "DDERR_NOTFOUND";
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 if ( v4 == -2005532412 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 v7 = "DDERR_NOOVERLAYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 if ( v4 == -2005532402 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 v7 = "DDERR_OVERLAPPINGRECTS";
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 if ( v4 <= -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 if ( v4 == -2005532285 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 v7 = "DDERR_PALETTEBUSY";
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 == -2005532332 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 v7 = "DDERR_NOZBUFFERHW";
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 == -2005532322 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 v7 = "DDERR_NOZOVERLAYHW";
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_OUTOFCAPS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 v7 = "DDERR_OUTOFCAPS";
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_OUTOFVIDEOMEMORY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 v7 = "DDERR_OUTOFVIDEOMEMORY";
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 if ( v4 == DDERR_OVERLAYCANTCLIP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 v7 = "DDERR_OVERLAYCANTCLIP";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 if ( v4 == DDERR_OVERLAYCOLORKEYONLYONEACTIVE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 v7 = "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 if ( v4 == -2005532272 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 v7 = "DDERR_COLORKEYNOTSET";
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 == -2005532262 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 v7 = "DDERR_SURFACEALREADYATTACHED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 if ( v4 == -2005532252 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 v7 = "DDERR_SURFACEALREADYDEPENDENT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 if ( v4 != -2005532242 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 if ( v4 == -2005532237 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 v7 = "DDERR_CANTLOCKSURFACE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 if ( v4 == -2005532232 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 v7 = "DDERR_SURFACEISOBSCURED";
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 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 if ( v4 == -2005532447 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 v7 = "DDERR_NOEXCLUSIVEMODE";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 if ( v4 <= -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 if ( v4 == -2005532562 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 v7 = "DDERR_INVALIDCLIPLIST";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 if ( v4 > -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 if ( v4 == -2005532652 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v7 = "DDERR_CANNOTDETACHSURFACE";
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 == -2005532632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 v7 = "DDERR_CURRENTLYNOTAVAIL";
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 == -2005532617 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 v7 = "DDERR_EXCEPTION";
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 == -2005532582 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 v7 = "DDERR_HEIGHTALIGN";
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 if ( v4 == -2005532577 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 v7 = "DDERR_INCOMPATIBLEPRIMARY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 if ( v4 == -2005532572 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 v7 = "DDERR_INVALIDCAPS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 if ( v4 == -2005532662 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 v7 = "DDERR_CANNOTATTACHSURFACE";
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 == -2147467263 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 v7 = "DDERR_UNSUPPORTED";
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 == -2147467259 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 v7 = "DDERR_GENERIC";
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 == -2147221008 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v7 = "DDERR_NOTINITIALIZED";
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 == -2147024882 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 v7 = "DDERR_OUTOFMEMORY";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 if ( v4 == -2147024809 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 v7 = "DDERR_INVALIDPARAMS";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 if ( v4 == -2005532667 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 v7 = "DDERR_ALREADYINITIALIZED";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 LABEL_173:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 v13 = strlen(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 v12 = (char *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 std::stringoperator_assign__const_char_ptr__(&a1, v12, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 pRenderer->field_40110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 v15 = &v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 std::string40E2C8(&v11, Str, (int)((char *)&hr + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 v10 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 Str = (char *)&v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 std::string40E2C8(&v9, "Direct Draw Error", (int)((char *)&a3 + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 LOBYTE(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 CheckHRESULT_stru0::ShowMessageBox(v6, &a1, v9, v10, v11, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 goto LABEL_176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 sprintfex(&Src, "Unknown DirectDraw/Direct3D error number %X", v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 v13 = strlen(&Src);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 v12 = &Src;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 if ( v4 > -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 if ( v4 == -2005532467 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 v7 = "DDERR_NOCLIPLIST";
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 == -2005532462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 v7 = "DDERR_NOCOLORCONVHW";
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 == -2005532460 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 v7 = "DDERR_NOCOOPERATIVELEVELSET";
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 == -2005532457 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 v7 = "DDERR_NOCOLORKEY";
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 if ( v4 == -2005532452 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 v7 = "DDERR_NOCOLORKEYHW";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 if ( v4 == -2005532450 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 v7 = "DDERR_NODIRECTDRAWSUPPORT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 if ( v4 == -2005532492 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 v7 = "DDERR_NOALPHAHW";
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 == -2005532552 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 v7 = "DDERR_INVALIDMODE";
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 == -2005532542 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 v7 = "DDERR_INVALIDOBJECT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 if ( v4 == -2005532527 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 v7 = "DDERR_INVALIDPIXELFORMAT";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 if ( v4 != -2005532522 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 if ( v4 == -2005532512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 v7 = "DDERR_LOCKEDSURFACES";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 if ( v4 == -2005532502 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 v7 = "DDERR_NO3D";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 goto LABEL_174;
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 //----- (00467D5D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 int __thiscall sub_467D5D(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 return *(int *)(_this + 7204);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 //----- (00467E7F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 Player *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 int v4; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 ItemGen _this; // [sp+Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 Player *v9; // [sp+30h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 int v10; // [sp+34h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 int *v11; // [sp+38h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 v1 = uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 _this.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 30
diff changeset
15077 v2 = (unsigned __int8)byte_4E8394[v1 + 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 v3 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 v11 = (int *)((char *)&v3->pEquipment + 4 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 v4 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 v10 = *v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 *(char *)(v5 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 pParty->SetHoldingItem((ItemGen *)(v5 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 v6 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 _this.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 memcpy((void *)(v5 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 *v11 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 v7 = v3->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 if ( (v7 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 pParty->pPickedItem.uBodyAnchor = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 memcpy(&v9->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v9->pInventoryItems[v7]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 *v11 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 //----- (00467F48) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 void __fastcall sub_467F48(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 if ( !ptr_507BC4 && a1 >= 700 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 if ( a1 <= 782 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15119 ptr_507BC4 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)30, v1 - 700, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 // 720980: using guessed type int uTextureID_720980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 //----- (00467F9F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 void __cdecl free_book_subwindow()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 if ( ptr_507BC4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 ptr_507BC4->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 ptr_507BC4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 //----- (00467FB6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 char __cdecl sub_467FB6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 unsigned int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 char *v1; // ST18_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 unsigned int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 GUIWindow a1; // [sp+Ch] [bp-54h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 memcpy(&a1, ptr_507BC4, sizeof(a1));
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15144 a1.Hint = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 a1.uFrameX = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 a1.uFrameY = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 a1.uFrameWidth = 468;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 v0 = pFontSmallnum->CalcTextHeight(pScrolls[(unsigned int)ptr_507BC4->ptr_1C], &a1, 0, 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 + 2 * LOBYTE(pFontCreate->uFontHeight)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 + 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 a1.uFrameHeight = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 if ( (signed int)(v0 + a1.uFrameY) > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 v0 = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 a1.uFrameHeight = 479 - a1.uFrameY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 a1.uFrameW = v0 + a1.uFrameY - 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15159 a1.DrawMessageBox(0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 a1.uFrameX += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 a1.uFrameWidth -= 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 a1.uFrameY += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 a1.uFrameHeight -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 v1 = pItemsTable->pItems[(unsigned int)ptr_507BC4->ptr_1C + 700].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 sprintfex(pTmpBuf, format_4E2D80, v2, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 a1.DrawText2(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 return a1.DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 pFontSmallnum,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 LOBYTE(pFontCreate->uFontHeight) - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 pScrolls[(unsigned int)ptr_507BC4->ptr_1C],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 //----- (00468F8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 void __cdecl OnPaperdollLeftClick()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 unsigned int v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 unsigned int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 unsigned __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 unsigned int v6; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 int v7; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 unsigned int v8; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 int v9; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 int v10; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 int v11; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 int v12; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 int v13; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 char v14; // zf@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 int v15; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 int v16; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 int v17; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 unsigned int v18; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 unsigned int v19; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 int v20; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 int v21; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 unsigned int v22; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 unsigned int v23; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 int v24; // esi@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 unsigned int v26; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 int v27; // esi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 int v28; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 int v29; // esi@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 int v30; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 int v31; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 unsigned int v32; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 unsigned int v33; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 int v34; // esi@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 unsigned int v35; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 int v36; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 int v37; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 ItemGen *v38; // edi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 __int16 v39; // dx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 signed int v40; // [sp-1Ch] [bp-68h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 unsigned int v41; // [sp-18h] [bp-64h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 signed int v42; // [sp-14h] [bp-60h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 signed int v43; // [sp-10h] [bp-5Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 int v44; // [sp-Ch] [bp-58h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 unsigned int v45; // [sp-8h] [bp-54h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 int v46; // [sp-4h] [bp-50h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 ItemGen _this; // [sp+Ch] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 unsigned int v48; // [sp+30h] [bp-1Ch]@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 unsigned int v49; // [sp+34h] [bp-18h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 unsigned int v50; // [sp+38h] [bp-14h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 int v51; // [sp+3Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 unsigned int v52; // [sp+40h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 int v53; // [sp+44h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 unsigned int v54; // [sp+48h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 _this.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 v1 = v0->pEquipment.uMainHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 v2 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 v54 = v0->pEquipment.uOffHand;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 v53 = v1;
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15250 if ( v1 && pItemsTable->pItems[*(int *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uEquipType == 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 v51 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 v4 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 if ( v4 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 if ( (signed int)SkillToMastery(v5) < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 v0->PlaySound(39, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 v3 = pParty->pPickedItem.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 if ( (v4 == 8 || v4 == 1 || v4 == 2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 && v1
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15277 && pItemsTable->pItems[*(int *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v1 + 5]].uSkillType == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 sub_467E7F_EquipBody(3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 WetsuitOn(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 v6 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 switch ( v52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 case 5u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 case 6u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 case 7u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 case 8u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 case 9u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 case 0xBu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 sub_467E7F_EquipBody(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 if ( pParty->pPickedItem.uItemID == 604 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 case 0xAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 v52 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 v7 = (int)&v0->pEquipment.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 if ( !*(int *)v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 v8 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 if ( (v8 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 v7 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 if ( (signed int)v52 > 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 v9 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 pParty->pPickedItem.uBodyAnchor = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 *(&v0->pEquipment.uOffHand + v9) = v8 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 if ( v52 == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 v52 = v0->pEquipment.field_3C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 v10 = (int)((char *)v0 + 36 * v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 *(char *)(v10 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 pParty->SetHoldingItem((ItemGen *)(v10 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 _this.uBodyAnchor = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 v11 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 memcpy((void *)(v10 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 v0->pEquipment.field_3C = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 case 4u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 v12 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 *(char *)(v12 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 v13 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 v14 = v51 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 memcpy((void *)(v12 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 v0->pEquipment.uOffHand = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 if ( (v52 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 v17 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 v0->pEquipment.uOffHand = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 v15 = (int)((char *)v0 + 36 * (v53 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 *(char *)(v15 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 v16 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 v0->pEquipment.uOffHand = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 v0->pEquipment.uMainHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 case 0u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 case 0xCu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 && pParty->pPickedItem.uItemID != 64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 && pParty->pPickedItem.uItemID != 65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15404 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 v18 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 v19 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 v18 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 v19 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 v49 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 if ( (signed int)v18 >= 560 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 v20 = (int)((char *)v0 + 36 * v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 *(char *)(v20 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 _this.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 v21 = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 memcpy((void *)(v20 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 v0->pEquipment.uOffHand = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 v22 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 v50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 v23 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 if ( (v23 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 pParty->pPickedItem.uBodyAnchor = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 v50 = (unsigned int)&v0->pInventoryItems[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 v0->pEquipment.uOffHand = v23 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 if ( v52 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 v22 = *(int *)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455 if ( !v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 v26 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 if ( (v26 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 v50 = (unsigned int)&v0->pInventoryItems[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 v0->pEquipment.uMainHand = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 v24 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 *(char *)(v24 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 pParty->SetHoldingItem((ItemGen *)(v24 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 v25 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 v14 = v52 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 memcpy((void *)(v24 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 v0->pEquipment.uMainHand = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 v50 = _this.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 if ( v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 stru_A750F8[uActiveCharacter - 1]._494836(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 *((int *)&pSpellDatas[66].field_8 + v50),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 uActiveCharacter - 1 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 goto LABEL_95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 if ( !v0->HasSkill(v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 if ( v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 goto LABEL_96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 --v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 v27 = (int)((char *)v0 + 36 * v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508 *(char *)(v27 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 pParty->SetHoldingItem((ItemGen *)(v27 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512 v28 = v53 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 memcpy((void *)(v27 + 532), &_this, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 v0->pEquipment.uMainHand = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 v52 = v0->FindFreeInventorySlot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 if ( (v52 & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 v29 = (int)((char *)v0 + 36 * (v54 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 *(char *)(v29 + 556) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 pParty->SetHoldingItem((ItemGen *)(v29 + 532));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 _this.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 v30 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 memcpy(&v0->pInventoryItems[v52], &_this, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 v0->pEquipment.uOffHand = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 v0->pEquipment.uMainHand = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 pParty->pPickedItem.uBodyAnchor = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 v31 = v52 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 v0->pEquipment.uMainHand = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 v0->UseItem_DrinkPotion_etc(uActiveCharacter, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15552 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 v32 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 v33 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 v49 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 v48 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 v32 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 v33 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 v36 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 v37 = (int)((char *)v0 + 36 * v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 v50 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 v38 = (ItemGen *)(v37 + 532);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 v14 = v38->uItemID == 604;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 v52 = pItemsTable->pItems[v38->uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 LABEL_95:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 v42 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 LABEL_96:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 WetsuitOff(uActiveCharacter);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 if ( unk_50C9A0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 v39 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 *((int *)ptr_507BD4->ptr_1C + 3) = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 *((short *)ptr_507BD4->ptr_1C + 3) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 ptr_50C9A4 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 unk_50C9A0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 pMouse->SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 dword_50C9D4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 dword_50C9D0 = 113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 dword_50C9D8 = 256;
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 if ( !ptr_50C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 pParty->SetHoldingItem(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 *(&v0->uBirthYear + *(char *)(v50 + 556)) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 v38->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 v35 = v0->pEquipment.uBow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 {
23
509744251c8e Player-related members
Nomad
parents: 13
diff changeset
15622 auto _a = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v35 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 pParty->SetHoldingItem(_a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 _a->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 v0->pEquipment.uBow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 //----- (0046A0A1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 int __thiscall UnprojectX(int x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 if ( pRenderer->pRenderD3D )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15642 v1 = pGame->pIndoorCameraD3D->fov;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 //----- (0046A0F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 int __thiscall UnprojectY(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 double v1; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 int v3; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 if ( pRenderer->pRenderD3D )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15663 v1 = pGame->pIndoorCameraD3D->fov;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 v1 = pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 v3 = (signed __int64)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 v3 = pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 return stru_5C6E00->Atan2(_this - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 //----- (0046A14B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 char __cdecl OnPressSpace()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 SHORT v0; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 int *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 char *v2; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 unsigned int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 signed int v4; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 unsigned int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 int v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 int v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 int v8; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 int *v9; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 signed int v10; // ebx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 int i; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 int v12; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 int v13; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 int j; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 int v16; // [sp+4h] [bp-1Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 char *v17; // [sp+8h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 unsigned int v18; // [sp+Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 int v19; // [sp+10h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 int *v20; // [sp+14h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 int *v21; // [sp+18h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 int v22; // [sp+1Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 v0 = GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 pGame->_44EB12((v0 & 0x8001) != 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 v1 = (int *)pGame->pVisInstance->get_picked_object_zbuf_val();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 if ( v1 != (int *)-1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 LOBYTE(v1) = DoInteractionWithTopmostZObject((unsigned __int16)v1, (signed int)(unsigned __int16)v1 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 v2 = (char *)v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 v1 = (int *)((char *)v1 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 v3 = 640 * viewparams->uScreenY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 v20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 if ( (signed int)v2 >= (signed int)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 v4 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 v7 = *v1 & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 if ( v4 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 if ( dword_7207F0[v6] == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 v19 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 while ( v6 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 if ( (v7 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 v16 = (unsigned int)v7 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 if ( (signed int)(((unsigned int)*v21 >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 if ( (unsigned int)*v21 > 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 if ( v19 == v22 && v4 < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 v8 = *v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 dword_7207EC[v4] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 dword_72065C[v4] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 v1 = v21 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 v21 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 v2 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 v3 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 if ( v22 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 v9 = dword_720660;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 for ( i = v10; i < v22; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 v12 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 v13 = dword_720660[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 if ( v13 < *v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 *v9 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 dword_720660[i] = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 LOBYTE(v1) = v10 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 while ( v10 - 1 < v22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 for ( j = 0; j < v22; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 if ( !(char)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 return (char)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 // 72065C: using guessed type int dword_72065C[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 // 7207EC: using guessed type int dword_7207EC[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 //----- (0046A334) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 BLVFace *v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 unsigned int v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 unsigned __int16 v6; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 ODMFace *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 LevelDecoration *v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 __int16 v9; // ax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 int v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 int v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 int v12; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 Actor *v13; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 unsigned __int16 v14; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 unsigned __int16 v15; // ax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 const char *v16; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 int v17; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 int v18; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 ItemGen *v19; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 unsigned int v20; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 int v21; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 std::string v22; // [sp-18h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 const char *v23; // [sp-8h] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 int v24; // [sp-4h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 char v25; // [sp+8h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 int v26; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 int a3; // [sp+13h] [bp-1h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 switch ( a1 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 v17 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 v26 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 v18 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 if ( pObjectList->pObjects[pLayingItems[v18].uObjectDescID].uFlags & 0x10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 || v17 >= 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 || !pLayingItems[v18].uObjectDescID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 v19 = &pLayingItems[v18].stru_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 v20 = pLayingItems[v18].stru_24.uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 if ( pItemsTable->pItems[v20].uEquipType == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 party_finds_gold(v19->uAdditionalValue, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 v21 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 ShowStatusBarString(pTmpBuf2, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 if ( v19->uItemID == 506 )
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
15867 _449B7E_toggle_bit(pParty->_award_bits, 184, 1u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 if ( v19->uItemID == 455 )
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
15869 _449B7E_toggle_bit(pParty->_award_bits, 185, 1u);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 if ( !pParty->AddItem(v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 pParty->SetHoldingItem(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 v21 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 LayingItem::_42F933(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 v12 = a1 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 v13 = &pActors[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 v14 = v13->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 if ( v14 == 4 || v14 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 if ( v14 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 stru_50C198.LootActor(&pActors[a1 >> 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 if ( !v13->GetActorsRelation(0) && !(BYTE2(v13->uAttributes) & 8) && v13->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 Actor::FaceObject(v12, 4u, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 if ( v13->uNPC_ID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 v15 = pNPCStats->pGroups_copy[v13->uGroup];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 v16 = pNPCStats->pCatchPhrases[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 strcpy(byte_5B0938, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 sub_4451A8_press_any_key(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 v8 = &pLevelDecorations[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 v9 = v8->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 EventProcessor(v9, a1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 LOBYTE(v8->field_2) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 if ( !pLevelDecorations[a1 >> 3].IsInteractive() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 v10 = v8->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 v24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 v11 = stru_5E4C90.field_0[v10] + 380;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 _5C3420_pDecoration = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 if ( (a1 & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 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
15942 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 if ( a1 >> 9 >= pOutdoor->uNumBModels
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15947 || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uAttributes) & 0x10)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 || (v6 = v7->sCogTriggeredID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 EventProcessor((signed __int16)v6, v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 v4 = &pIndoor->pFaces[a1 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 v5 = v4->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 if ( !(v5 & 0x2000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 ShowNothingHereStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 return 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15963 if ( pCurrentScreen != 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
15969 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 //----- (0046A6AC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 int __fastcall sub_46A6AC(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 unsigned int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 int *v5; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 signed int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 unsigned __int16 v8; // ax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 int i; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 int v10; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 int v11; // [sp+0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 unsigned int v12; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 unsigned int v13; // [sp+8h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 int v14; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 int *v15; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 int v16; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 result = sub_46A7C8(a1, a2, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 v4 = viewparams->uScreenX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 v12 = viewparams->uScreenZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 v15 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 v13 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 if ( (signed int)v4 < (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 v5 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 v6 = ((v12 - v4 - 1) >> 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 if ( (*(char *)v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 if ( *v5 <= a3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 v7 = (signed int)(unsigned __int16)*v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 v8 = pActors[v7].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 if ( v8 != 4 && v8 != 11 && v8 != 17 && v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 for ( i = 0; i < v16; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 if ( *(int *)(v14 + 4 * i) == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 if ( i == v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 if ( i < v11 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 v10 = v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 *(int *)(v14 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 v5 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 v15 += 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 --v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 result = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 //----- (0046A7C8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 int __fastcall sub_46A7C8(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 unsigned int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 unsigned int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 unsigned int v7; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 unsigned __int16 v8; // ax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 float v9; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 unsigned int v12; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 int v13; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 int v14; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 int v15; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 unsigned int a1a; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 v13 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 v14 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 a1a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 v12 = pRenderer->GetBillboardDrawListSize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 if ( (signed int)v12 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 v3 = pRenderer->GetParentBillboardID(a1a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 v4 = pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 v5 = (unsigned __int16)pBillboardRenderList[v3].sZValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 if ( (v5 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 if ( v4 <= (unsigned int)(a3 << 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 v6 = v5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 v8 = pActors[v6].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 if ( v8 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 if ( v8 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 if ( v8 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 if ( v8 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 if ( v8 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 v9 = (double)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 if ( v15 < v14 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 v10 = v15++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 *(int *)(v13 + 4 * v10) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 ++a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 while ( (signed int)a1a < (signed int)v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 return v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 //----- (0046A89E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 int __fastcall sub_46A89E(int a1, int a2, signed int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 unsigned int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 int v9; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 unsigned int v10; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 unsigned int v11; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 __int16 v12; // ax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 int v13; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 int v15; // [sp+4h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 int v16; // [sp+8h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 int v17; // [sp+Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 int v18; // [sp+10h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 int v19; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 v16 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 v4 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 v5 = abs(*((short *)v4 - 17) - pParty->vPosition.x);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16153 v17 = abs(*((short *)v4 - 16) - pParty->vPosition.y);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16154 v18 = abs(*((short *)v4 - 15) - pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 v7 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 v8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 if ( v6 < v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 v9 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 v7 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 if ( v6 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 v10 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 v6 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 v8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 if ( v7 < (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 v7 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 if ( (signed int)(((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6) <= a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 v12 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 if ( *(short *)v4 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 if ( v12 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 if ( v12 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 if ( v12 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 if ( v12 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 v13 = v19++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 *(int *)(v16 + 4 * v13) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 if ( v19 >= v15 - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 v4 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 while ( v3 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 //----- (0046A99B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 int __cdecl sub_46A99B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 signed int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 int *v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 int v7; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 int v8; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 int v9; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 unsigned __int8 v10; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 char v11; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 char v12; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 int *v14; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 signed int v15; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 int i; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 int v17; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 int v18; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 int v19; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 unsigned int v20; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 BLVFace *v21; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 unsigned int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 const char *v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 const char *v24; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 LevelDecoration *v25; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 LevelDecoration *v26; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 __int16 v27; // ax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 int v28; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 int v29; // [sp+14h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 int v30; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 signed int v31; // [sp+1Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 int v32; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 v1 = (signed int)(viewparams->uScreenW + viewparams->uScreenY) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 v2 = (signed int)(viewparams->uScreenX + viewparams->uScreenZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 v3 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 v4 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 v30 = v1 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 v28 = v1 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 if ( v1 - 50 >= v1 + 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 v5 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 v29 = 640 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 v31 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 v8 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 if ( (unsigned int)*v6 <= 0x2000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 while ( v9 < v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 if ( v9 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 if ( v8 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 dword_720020_zvalues[v7] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 dword_7201B0_zvalues[v7] = (unsigned __int16)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 v32 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 if ( v7 == 99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 if ( !v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 v4 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 v5 = v29 + 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 v29 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 if ( v30 < v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 v10 = v0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 v11 = v0 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 if ( !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 if ( !((unsigned __int8)(v11 ^ v12) | v10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 v14 = dword_720020_zvalues;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 for ( i = v15; i < v32; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 v17 = dword_720020_zvalues[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 if ( v17 < *v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 dword_720020_zvalues[i] = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 *v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 while ( v15 - 1 < v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 v0 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 if ( v0 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 v19 = dword_720020_zvalues[v18] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 v20 = (dword_720020_zvalues[v18] & 0xFFFFu) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 if ( (dword_720020_zvalues[v18] & 7) == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 if ( v20 >= 0x3E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 if ( !(pLayingItems[v20].uAttributes & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 v23 = pLayingItems[v20].stru_24.GetDisplayName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 if ( (dword_720020_zvalues[v18] & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 if ( v20 >= 0xBB8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 v24 = (const char *)&pActors[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 if ( (dword_720020_zvalues[v18] & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 if ( (dword_720020_zvalues[v18] & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 v21 = &pIndoor->pFaces[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 if ( !(BYTE3(v21->uAttributes) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 >= pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 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
16378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 v23 = _444732_GetEventHintString(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 if ( v18 >= v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 v25 = &pLevelDecorations[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 v27 = v25->field_16_event_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 v23 = _444732_GetEventHintString(v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 if ( v25->IsInteractive() )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16402 v24 = pNPCTopics[stru_5E4C90.field_0[v26->field_1C] + 379].pTopic;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 sub_41C0B8_set_status_string(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 return v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 //----- (0046BDA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 unsigned int __cdecl GetGravityStrength()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 v0 = ~LOBYTE(pGame->uFlags2) & 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 LOBYTE(v0) = v0 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 return (unsigned int)v0 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 //----- (0046BDC0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 if ( dword_6BE364_game_settings_1 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 BLV_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 ODM_UpdateUserInputAndOther();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 _438F8F_area_of_effect__damage_evaluate();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 //----- (0046BDF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 void __cdecl BLV_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 BLV_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 UpdateActors_BLV();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 BLV_UpdateDoors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 //----- (0046BE0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 void __cdecl ODM_UpdateUserInputAndOther()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 bool v0; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 int pOut; // [sp+8h] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 UpdateObjects();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 ODM_ProcessPartyActions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 if ( pParty->vPosition.x < -22528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 || pParty->vPosition.x > 22528
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16465 || pParty->vPosition.y < -22528
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16466 || pParty->vPosition.y > 22528 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16469 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, (char *)&pOut, 32);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 if ( pParty->vPosition.x < -22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 pParty->vPosition.x = -22528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 if ( pParty->vPosition.x > 22528 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 pParty->vPosition.x = 22528;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16476 if ( pParty->vPosition.y < -22528 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16477 pParty->vPosition.y = -22528;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16478 if ( pParty->vPosition.y > 22528 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
16479 pParty->vPosition.y = 22528;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 UI_CreateTravelDialogue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 UpdateActors_ODM();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 _46CC4B_check_event_triggers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 //----- (0046BEF1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 void LayingItem::_46BEF1_apply_spells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 LayingItem *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 __int16 v3; // fps@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 unsigned __int8 v4; // c0@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 unsigned __int8 v5; // c3@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 signed int v6; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 v2 = (char *)&pActors[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 if ( ((Actor *)(v2 - 144))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 //UNDEF(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 if ( !(v4 | v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 if ( stru_50C198.GetMagicalResistance((Actor *)(v2 - 144), 0xAu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 ((SpellBuff *)&v2[16 * v1->field_48 + 68])->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 v1->field_50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 *(v2 - 106) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 while ( v6 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 //----- (0046BFFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 LayingItem *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 ObjectDesc *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 unsigned __int16 v5; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 unsigned __int16 v6; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 signed int v7; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 unsigned int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 unsigned int v9; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 signed int v10; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 char *v11; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 unsigned __int16 v12; // ax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 unsigned int v14; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 unsigned __int16 v15; // ax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 int v16; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 unsigned int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 __int16 v18; // di@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 signed int v19; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 unsigned __int8 v20; // sf@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 char *v21; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 unsigned __int16 v22; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 unsigned int v23; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 signed int v24; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 char *v25; // edx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 int v26; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 int v27; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 int v28; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 int v29; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 unsigned __int16 v30; // ax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 unsigned int v31; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 int v32; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 unsigned int v33; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 signed int v34; // edx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 char *v35; // ecx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 unsigned __int16 v36; // ax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 int v37; // ST14_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 int v39; // ST10_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 int v40; // ST0C_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 int v41; // edx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 int v42; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 int v43; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 unsigned __int8 v44; // zf@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 int v45; // edx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 unsigned __int16 v46; // ax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 int v47; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 int v48; // edx@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 int v49; // edx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 int v50; // edx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 unsigned int v51; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 signed int v52; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 char *v53; // edx@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 unsigned __int16 v54; // ax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 unsigned int v55; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 signed int v56; // ebx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 char *v57; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 unsigned __int16 v58; // ax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 unsigned __int16 v59; // ax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 unsigned int v60; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 signed int v61; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 char *v62; // edx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 unsigned __int16 v63; // ax@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 int v64; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 signed int v65; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 unsigned int v66; // edi@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 unsigned __int16 v67; // ax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 unsigned int v68; // ecx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 signed int v69; // ebx@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 char *v70; // edx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 unsigned __int16 v71; // ax@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 unsigned int v72; // ebx@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 int v73; // ST14_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 int v74; // ST10_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 int v75; // ebx@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 int v76; // ST0C_4@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 unsigned __int16 v77; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 int v78; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 char v79; // zf@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 unsigned int v80; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 signed int v81; // edx@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 char *v82; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 unsigned __int16 v83; // ax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 unsigned __int16 v84; // ax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 unsigned int v85; // ecx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 signed int v86; // ebx@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 char *v87; // edx@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 unsigned __int16 v88; // ax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 unsigned int v89; // eax@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 int v90; // ST34_4@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 int v91; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 unsigned int v92; // eax@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 unsigned int v93; // eax@177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 char *v94; // ecx@178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 unsigned __int16 v95; // ax@181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 unsigned __int16 v96; // ax@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 int v97; // eax@185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 unsigned __int16 v98; // ax@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 unsigned int v99; // ecx@191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 char v100; // ST18_1@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 int v101; // ST14_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 int v102; // eax@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 int v103; // ST10_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 int v104; // ST0C_4@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 unsigned __int16 v105; // ax@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 signed int v106; // eax@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 unsigned int v107; // edx@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 signed int v108; // ebx@225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 unsigned int v109; // eax@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 signed int v110; // ebx@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 char *v111; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 unsigned __int16 v112; // ax@238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 unsigned __int16 v113; // si@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 int v114; // eax@242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 int v115; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 signed int v116; // eax@245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 unsigned __int16 v117; // ax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 unsigned int v118; // ecx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 signed int v119; // ebx@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 char *v120; // edx@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 unsigned __int16 v121; // ax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 unsigned int v122; // eax@260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 char *v123; // edx@261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 int v124; // eax@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 int v125; // [sp-20h] [bp-4Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 signed int v126; // [sp-1Ch] [bp-48h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 unsigned int v127; // [sp-18h] [bp-44h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 signed int v128; // [sp-14h] [bp-40h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 signed int v129; // [sp-10h] [bp-3Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 int v130; // [sp-Ch] [bp-38h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 unsigned int v131; // [sp-8h] [bp-34h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 char v132; // [sp-8h] [bp-34h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 int v133; // [sp-4h] [bp-30h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 char v134; // [sp-4h] [bp-30h]@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 signed int v135; // [sp-4h] [bp-30h]@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 int v136; // [sp+Ch] [bp-20h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 int v137; // [sp+10h] [bp-1Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 signed int v138; // [sp+14h] [bp-18h]@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 signed int v139; // [sp+18h] [bp-14h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 char *v140; // [sp+1Ch] [bp-10h]@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 signed int v141; // [sp+1Ch] [bp-10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 unsigned int v142; // [sp+1Ch] [bp-10h]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 signed int v143; // [sp+1Ch] [bp-10h]@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 char *v144; // [sp+1Ch] [bp-10h]@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 signed int v145; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 signed int v146; // [sp+20h] [bp-Ch]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 int v147; // [sp+20h] [bp-Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 signed int v148; // [sp+20h] [bp-Ch]@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 int v149; // [sp+20h] [bp-Ch]@198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 int v151; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 signed int v152; // [sp+24h] [bp-8h]@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 unsigned int v153; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 v153 = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 v2 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 v3 = &pObjectList->pObjects[v2->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 v145 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 v151 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 if ( (v2->field_58 & 7) == 3 && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 if ( (a2 & 7) == 4 && (v2->field_58 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 v5 = v2->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 if ( v5 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 v2->uAttributes = v5 & 0xFFFB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 if ( v151 == 6 && (v2->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 v6 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 v7 = v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 if ( v7 > 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 if ( v7 > 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 if ( v7 > 8090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 if ( v7 == 9010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 if ( v7 != 9040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 if ( v7 != 9080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 LABEL_191:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 v98 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 v99 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 v2->uItemType = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 if ( (signed int)v99 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 v144 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 while ( v98 != *(short *)v144 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 v144 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 if ( v146 >= (signed int)v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 LABEL_195:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 LABEL_172:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 v143 = 17030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 switch ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 case 0x1798u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 v143 = 15040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 case 0xFAAu:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 v143 = 13010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 case 0x2346u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 v143 = 18030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 v138 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 if ( v6 != 9030 || v2->field_50 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 goto LABEL_246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 if ( !v138 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 v109 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 if ( (signed int)v109 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 LABEL_238:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 v112 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 v111 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 while ( v2->uItemType != *(short *)v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 ++v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 v111 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 if ( v110 >= (signed int)v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 goto LABEL_238;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 v112 = v110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 v2->uObjectDescID = v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 if ( !v112 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 v113 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 if ( v113 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 v114 = (signed __int16)v113 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 v130 = v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 v115 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 LOBYTE(v115) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 v126 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 v116 = v143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 goto LABEL_269;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 LABEL_246:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 v106 = v145;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 v150 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 v139 = v106 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 v137 = v2->field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 v152 = v2->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 v136 = v2->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 if ( v6 == 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 v150 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 if ( v152 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 v150 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 if ( v152 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 v150 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 BYTE2(pActors[v139].uAttributes) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 if ( v7 == 6040 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 v135 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 if ( v7 == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 v135 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 if ( v7 != 9030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 v107 = v136;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 LABEL_222:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 if ( v6 != 9030 || v152 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 v108 = v139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 v138 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 if ( v2->uItemType == 8030 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
16872 pActors[v108].uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 pActors[v108].UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[v136] + v108 * 836))->Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 v152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 v150,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 v2->_46BEF1_apply_spells();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 v2->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 v2->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 v2->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 v135 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 v107 = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 goto LABEL_222;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 if ( v7 == 8090 || v7 == 7030 || v7 == 7090 || v7 == 8000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 if ( v7 == 8010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 if ( v151 == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 && MonsterStats::BelongsToSupertype(pActors[v145 >> 3].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 v93 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 if ( (signed int)v93 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 v94 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 while ( v2->uItemType != *(short *)v94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 v94 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 if ( v52 >= (signed int)v93 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 v79 = v7 == 8030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 if ( v7 == 6090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 if ( v7 <= 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 if ( v7 != 4070 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 v48 = v7 - 3090;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 v49 = v48 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 v50 = v49 - 908;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 v45 = v50 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 goto LABEL_91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 v54 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 v55 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 v2->uItemType = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 LABEL_102:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 v57 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 while ( v54 != *(short *)v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 v57 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 if ( v56 >= (signed int)v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 goto LABEL_102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 v58 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 v2->uObjectDescID = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 if ( !v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 v15 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 if ( v15 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 v16 = (signed __int16)v15 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 v130 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 v92 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 LABEL_267:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 v124 = 8 * v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 LOBYTE(v124) = v124 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 v126 = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 LABEL_268:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 v116 = word_4EE088_sound_ids[v2->field_48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 LABEL_269:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 v125 = v116 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 v59 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 v60 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 v2->uItemType = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 LABEL_111:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 v62 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 while ( v59 != *(short *)v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 v62 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 if ( v61 >= (signed int)v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 goto LABEL_111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 v63 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 v2->uObjectDescID = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 if ( !v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 v44 = v2->field_50 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 v65 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 v65 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 if ( v65 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 v141 = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 v64 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 v2->Create(v64, 0, 1000, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 --v141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 while ( v141 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 LABEL_160:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 LayingItem::_42F933(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 v67 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 v68 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 v2->uItemType = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 LABEL_128:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 v70 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 while ( v67 != *(short *)v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 v70 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 if ( v69 >= (signed int)v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 goto LABEL_128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 v71 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 v2->uObjectDescID = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 v132 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 LABEL_132:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 v73 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 v74 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 v75 = 8 * v72 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 v2->vVelocity.z = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 v2->vVelocity.y = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 v76 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 v2->vVelocity.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 v2->uSpriteFrameID = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 stru_50FE08.Add(v75, 512, v76, v74, v73, v132, v134);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 v77 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 if ( v77 == (short)v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 v78 = (signed __int16)v77 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 v133 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 v131 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 v130 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 v129 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 v127 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 v126 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 if ( v7 == 4090 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 v84 = v6 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 v85 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 v2->uItemType = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 LABEL_155:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 v87 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 while ( v84 != *(short *)v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 v87 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 if ( v86 >= (signed int)v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 goto LABEL_155;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 v88 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 v2->uObjectDescID = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 if ( !v88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 v89 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 v142 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 v148 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 pRnd->SetRange(-128, 128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 v90 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 pRnd->SetRange(5, 500);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 v91 = pRnd->GetInRange();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 v2->Create(v90 + v142, 0, v91, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 --v148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 while ( v148 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 goto LABEL_160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 if ( v7 == 4092 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 v80 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 v2->uItemType = 4091;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17165 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 LABEL_144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 v82 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 while ( *(short *)v82 != 4091 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 ++v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 v82 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 if ( v81 >= (signed int)v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 goto LABEL_144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 v83 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 v2->uObjectDescID = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 v72 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 v132 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 goto LABEL_132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 if ( v7 == 4100 || v7 == 6010 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 v79 = v7 == 6040;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 if ( !v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 goto LABEL_172;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 if ( v7 == 3060 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 if ( v7 <= 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 if ( v7 == 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 v23 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 if ( (signed int)v23 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 v25 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 while ( v2->uItemType != *(short *)v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 v25 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 if ( v24 >= (signed int)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 v22 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 v2->uObjectDescID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 if ( v22 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 v2->vVelocity.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 v2->vVelocity.y = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 v2->vVelocity.x = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 v2->uSpriteFrameID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 switch ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 case 500:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 case 505:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 case 510:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 case 515:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 case 520:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 case 525:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 case 530:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 case 535:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 case 540:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 v8 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 if ( (signed int)v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 v11 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 case 545:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 case 550:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 if ( v2->stru_24.uItemID != 405 && v2->stru_24.uAdditionalValue != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 v14 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 v17 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 v2->uItemType = 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 v21 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 while ( *(short *)v21 != 600 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 v21 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 if ( v19 >= (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17284 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 v22 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 while ( v2->uItemType != *(short *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 v11 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 if ( v10 >= (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 v2->uObjectDescID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 v44 = v2->uItemType == 555;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 if ( !v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 if ( v7 > 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 v41 = v7 - 2030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 v42 = v41 - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 if ( v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 v43 = v42 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 v45 = v43 - 910;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 v44 = v45 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 LABEL_91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 if ( !v44 && v45 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 v51 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 if ( (signed int)v51 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 v53 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 while ( v2->uItemType != *(short *)v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 v53 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 if ( v52 >= (signed int)v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 goto LABEL_202;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 v2->uObjectDescID = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 if ( v95 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 v96 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 v2->vVelocity.z = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 v2->vVelocity.y = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 v2->vVelocity.x = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 v2->uSpriteFrameID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 if ( v96 == (short)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 v97 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 v97 = (signed __int16)v96 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 v130 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 v92 = v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 goto LABEL_267;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 if ( v7 == 1100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 v26 = v7 - 600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 v33 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 v2->uItemType = 601;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 v35 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 while ( *(short *)v35 != 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 v35 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 if ( v34 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 v36 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 v2->uObjectDescID = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 if ( !v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 v37 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 v38 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 v39 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 LOBYTE(v38) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 v40 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 v147 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 stru_50FE08.Add(v38, 512, v40, v39, v37, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, 0, v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 v131 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 v129 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 v126 = v147;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 v27 = v26 - 410;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 v28 = v27 - 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 goto LABEL_191;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 v29 = v28 - 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 if ( v29 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 if ( v151 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 v30 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 v31 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 v2->uItemType = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 v146 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 if ( (signed int)v31 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 v140 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 while ( v30 != *(short *)v140 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 ++v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 v140 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 if ( v146 >= (signed int)v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 v46 = v146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 v2->uObjectDescID = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 if ( v46 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 v100 = v2->field_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 v101 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 v2->uSpriteFrameID = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 v102 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 v103 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 LOBYTE(v102) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 v2->vVelocity.x = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 v2->vVelocity.y = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 v104 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 v2->vVelocity.z = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 v149 = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 if ( HIBYTE(v3->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 array_5118E8._440E91(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 v2->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 v2->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 v2->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 v3->uParticleTrailColor);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 v105 = v2->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 if ( v105 == (short)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 v47 = (signed __int16)v105 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 v133 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 v131 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 v130 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 v129 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 v127 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 v126 = v149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 goto LABEL_268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17493 goto LABEL_195;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 if ( v151 == 6 || v151 == 5 || (v9 = 0, !v151) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 if ( v151 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 sub_43A97E(v153, v145);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 v122 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 ++v2->uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 if ( (signed int)v122 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 v123 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 while ( v2->uItemType != *(short *)v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 v123 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 if ( v52 >= (signed int)v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 LABEL_202:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 v95 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 v117 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 v118 = pObjectList->uNumObjects;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 v44 = pObjectList->uNumObjects == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 v20 = (pObjectList->uNumObjects & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 v2->uItemType = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 if ( v20 | v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 v120 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 while ( v117 != *(short *)v120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 v120 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 if ( v119 >= (signed int)v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 v121 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 v2->uObjectDescID = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 if ( !v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 LayingItem::_42F933(v153);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 v2->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 v2->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 v2->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 v2->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 v133 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 v131 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 v130 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 v13 = 8 * v153;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 v129 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 v128 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 LOBYTE(v13) = 8 * v153 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 v127 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 v125 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568