annotate mm7_1.cpp @ 774:c319601893af

Слияние
author Ritor1
date Sun, 24 Mar 2013 00:32:13 +0600
parents cf2fbac6edc9
children c47efaf23642
rev   line source
0
Ritor1
parents:
diff changeset
1 /* This file has been generated by the Hex-Rays decompiler.
Ritor1
parents:
diff changeset
2 Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com>
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 Detected compiler: Visual C++
Ritor1
parents:
diff changeset
5 */
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 //#include <defs.h>
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
8 #include <assert.h>
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
9
0
Ritor1
parents:
diff changeset
10 #include "MM7.h"
Ritor1
parents:
diff changeset
11
Ritor1
parents:
diff changeset
12 #include "MapInfo.h"
Ritor1
parents:
diff changeset
13 #include "Game.h"
Ritor1
parents:
diff changeset
14 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
15 #include "GUIFont.h"
Ritor1
parents:
diff changeset
16 #include "GUIButton.h"
Ritor1
parents:
diff changeset
17 #include "GUIProgressBar.h"
Ritor1
parents:
diff changeset
18 #include "Party.h"
Ritor1
parents:
diff changeset
19 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
20 #include "Outdoor.h"
Ritor1
parents:
diff changeset
21 #include "IndoorCamera.h"
Ritor1
parents:
diff changeset
22 #include "Overlays.h"
Ritor1
parents:
diff changeset
23 #include "Monsters.h"
Ritor1
parents:
diff changeset
24 #include "Arcomage.h"
Ritor1
parents:
diff changeset
25 #include "LOD.h"
Ritor1
parents:
diff changeset
26 #include "Actor.h"
Ritor1
parents:
diff changeset
27 #include "Allocator.h"
Ritor1
parents:
diff changeset
28 #include "Events.h"
Ritor1
parents:
diff changeset
29 #include "Viewport.h"
Ritor1
parents:
diff changeset
30 #include "FrameTableInc.h"
Ritor1
parents:
diff changeset
31 #include "Math.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
32 #include "SpriteObject.h"
0
Ritor1
parents:
diff changeset
33 #include "ObjectList.h"
Ritor1
parents:
diff changeset
34 #include "Chest.h"
Ritor1
parents:
diff changeset
35 #include "PaletteManager.h"
Ritor1
parents:
diff changeset
36 #include "DecorationList.h"
Ritor1
parents:
diff changeset
37 #include "SaveLoad.h"
Ritor1
parents:
diff changeset
38 #include "stru123.h"
Ritor1
parents:
diff changeset
39 #include "Time.h"
Ritor1
parents:
diff changeset
40 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
41 #include "Awards.h"
Ritor1
parents:
diff changeset
42 #include "Autonotes.h"
Ritor1
parents:
diff changeset
43 #include "stru160.h"
Ritor1
parents:
diff changeset
44 #include "stru279.h"
Ritor1
parents:
diff changeset
45 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
46 #include "stru277.h"
Ritor1
parents:
diff changeset
47 #include "Weather.h"
Ritor1
parents:
diff changeset
48 #include "stru272.h"
Ritor1
parents:
diff changeset
49 #include "stru298.h"
Ritor1
parents:
diff changeset
50 #include "StorylineTextTable.h"
Ritor1
parents:
diff changeset
51 #include "Events2D.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
52 #include "texts.h"
351
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 336
diff changeset
53 #include "stru351.h"
747
585490c29945 House dialogue ids appended
Nomad
parents: 726
diff changeset
54 #include "UIHouses.h"
0
Ritor1
parents:
diff changeset
55
Ritor1
parents:
diff changeset
56 #include "mm7_data.h"
Ritor1
parents:
diff changeset
57
Ritor1
parents:
diff changeset
58
Ritor1
parents:
diff changeset
59
Ritor1
parents:
diff changeset
60
Ritor1
parents:
diff changeset
61 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
Ritor1
parents:
diff changeset
62 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
Ritor1
parents:
diff changeset
63 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive);
Ritor1
parents:
diff changeset
64 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine);
Ritor1
parents:
diff changeset
65
Ritor1
parents:
diff changeset
66
Ritor1
parents:
diff changeset
67
Ritor1
parents:
diff changeset
68
Ritor1
parents:
diff changeset
69
Ritor1
parents:
diff changeset
70
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
73 //----- (004453C0) mm6-----------------------------------------------------
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
74 //----- (004A1760) mm6_chinese---------------------------------------------
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
75 int fixpoint_mul(int a1, int a2)
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
76 {
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
77 return ((__int64)a1 * a2) >> 16;
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
78 }
cf2fbac6edc9 Misc cleaning
Nomad
parents: 749
diff changeset
79
0
Ritor1
parents:
diff changeset
80 //----- (004196A0) --------------------------------------------------------
Ritor1
parents:
diff changeset
81 void __cdecl sub_4196A0()
Ritor1
parents:
diff changeset
82 {
Ritor1
parents:
diff changeset
83 GUIButton *i; // esi@2
Ritor1
parents:
diff changeset
84 GUIButton *j; // esi@7
Ritor1
parents:
diff changeset
85
Ritor1
parents:
diff changeset
86 if ( dword_507CC0 )
Ritor1
parents:
diff changeset
87 {
Ritor1
parents:
diff changeset
88 dword_507CC0 = 0;
705
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
89 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j )
0
Ritor1
parents:
diff changeset
90 {
705
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
91 j=i->pNext;
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
92 if ( BYTE1(i->field_1C) & 0x80 )
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
93 {
697
2dfb67633b01 GUIButton Release
zipi
parents: 693
diff changeset
94 i->Release();
705
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
95 pAllocator->FreeChunk(i);
e39702f35283 memory allocation partly reworked
zipi
parents: 702
diff changeset
96 }
0
Ritor1
parents:
diff changeset
97 }
Ritor1
parents:
diff changeset
98 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext )
Ritor1
parents:
diff changeset
99 {
Ritor1
parents:
diff changeset
100 if ( j->uControlID == 120 )
Ritor1
parents:
diff changeset
101 {
Ritor1
parents:
diff changeset
102 j->uX = dword_50698C;
Ritor1
parents:
diff changeset
103 j->uY = dword_506988;
Ritor1
parents:
diff changeset
104 j->uZ = dword_506984;
Ritor1
parents:
diff changeset
105 j->uW = dword_506980;
Ritor1
parents:
diff changeset
106 pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0);
Ritor1
parents:
diff changeset
107 }
Ritor1
parents:
diff changeset
108 }
Ritor1
parents:
diff changeset
109 }
Ritor1
parents:
diff changeset
110 }
Ritor1
parents:
diff changeset
111 // 506980: using guessed type int dword_506980;
Ritor1
parents:
diff changeset
112 // 506984: using guessed type int dword_506984;
Ritor1
parents:
diff changeset
113 // 506988: using guessed type int dword_506988;
Ritor1
parents:
diff changeset
114 // 50698C: using guessed type int dword_50698C;
Ritor1
parents:
diff changeset
115 // 507CC0: using guessed type int dword_507CC0;
Ritor1
parents:
diff changeset
116
Ritor1
parents:
diff changeset
117
Ritor1
parents:
diff changeset
118 // 50651C: using guessed type int dword_50651C;
Ritor1
parents:
diff changeset
119 // 506520: using guessed type int dword_506520;
Ritor1
parents:
diff changeset
120 // 506524: using guessed type int dword_506524;
Ritor1
parents:
diff changeset
121 // 506528: using guessed type int dword_506528;
Ritor1
parents:
diff changeset
122 // 506544: using guessed type int dword_506544;
Ritor1
parents:
diff changeset
123 // 506548: using guessed type int dword_506548;
Ritor1
parents:
diff changeset
124 // 723E80: using guessed type int dword_723E80_award_related[];
Ritor1
parents:
diff changeset
125 // 723E84: using guessed type int dword_723E84[];
Ritor1
parents:
diff changeset
126
Ritor1
parents:
diff changeset
127
566
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 564
diff changeset
128
0
Ritor1
parents:
diff changeset
129 // 5075E0: using guessed type int pVisibleWindowsIdxs[20];
Ritor1
parents:
diff changeset
130
Ritor1
parents:
diff changeset
131
Ritor1
parents:
diff changeset
132
Ritor1
parents:
diff changeset
133
Ritor1
parents:
diff changeset
134 //----- (0041CD4F) --------------------------------------------------------
Ritor1
parents:
diff changeset
135 bool __thiscall sub_41CD4F(unsigned int _this)
Ritor1
parents:
diff changeset
136 {
Ritor1
parents:
diff changeset
137 unsigned int v1; // edi@1
Ritor1
parents:
diff changeset
138 unsigned int v2; // eax@2
Ritor1
parents:
diff changeset
139 int v3; // esi@3
Ritor1
parents:
diff changeset
140 int v4; // ecx@10
Ritor1
parents:
diff changeset
141 GUIButton *v5; // eax@11
Ritor1
parents:
diff changeset
142 int v6; // edx@12
Ritor1
parents:
diff changeset
143 int v7; // ecx@20
Ritor1
parents:
diff changeset
144 char v8; // zf@21
Ritor1
parents:
diff changeset
145 GUIButton *v9; // ecx@24
Ritor1
parents:
diff changeset
146 int v10; // esi@24
Ritor1
parents:
diff changeset
147 int v11; // edx@26
Ritor1
parents:
diff changeset
148 int v12; // edx@28
Ritor1
parents:
diff changeset
149 int v13; // esi@32
Ritor1
parents:
diff changeset
150 GUIButton *v14; // eax@37
Ritor1
parents:
diff changeset
151 int v15; // edx@38
Ritor1
parents:
diff changeset
152 int v17; // ecx@50
Ritor1
parents:
diff changeset
153 int v18; // edx@50
Ritor1
parents:
diff changeset
154 GUIButton *v19; // ecx@54
Ritor1
parents:
diff changeset
155 int v20; // esi@54
Ritor1
parents:
diff changeset
156 int v21; // edx@56
Ritor1
parents:
diff changeset
157 int v22; // ecx@59
Ritor1
parents:
diff changeset
158 int v23; // edx@59
Ritor1
parents:
diff changeset
159 int v24; // ecx@60
Ritor1
parents:
diff changeset
160 int v25; // esi@63
Ritor1
parents:
diff changeset
161 unsigned int v26; // [sp+Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
162 int v27; // [sp+10h] [bp-10h]@1
Ritor1
parents:
diff changeset
163 int v28; // [sp+14h] [bp-Ch]@10
Ritor1
parents:
diff changeset
164 int v29; // [sp+14h] [bp-Ch]@36
Ritor1
parents:
diff changeset
165 unsigned int uClickX; // [sp+18h] [bp-8h]@10
Ritor1
parents:
diff changeset
166 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10
Ritor1
parents:
diff changeset
167
Ritor1
parents:
diff changeset
168 v1 = 0;
Ritor1
parents:
diff changeset
169 v26 = _this;
Ritor1
parents:
diff changeset
170 v27 = uNumVisibleWindows;
Ritor1
parents:
diff changeset
171 if ( uNumVisibleWindows < 0 )
Ritor1
parents:
diff changeset
172 return 0;
Ritor1
parents:
diff changeset
173 v2 = pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
174 while ( 1 )
Ritor1
parents:
diff changeset
175 {
Ritor1
parents:
diff changeset
176 v3 = pVisibleWindowsIdxs[v27] - 1;
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
177 if ( pWindowList[v3].field_44 != v1 )
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
178 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
179 switch(v26)
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
180 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
181 case VK_LEFT:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
182 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
183 v12 = pWindowList[v3].field_34;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
184 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
185 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
186 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
187 pWindowList[v3].pCurrentPosActiveItem -= v12;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
188 if ( v8 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
189 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
190 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
191 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
192 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
193 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
194 if ( pWindowList[v3].field_30 != v1 )
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
195 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
196 break;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
197 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
198 v9 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
199 v13 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
200 if ( v13 > (signed int)v1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
201 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
202 do
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
203 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
204 v9 = v9->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
205 --v13;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
206 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
207 while ( v13 );
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
208 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
209 v11 = v9->uControlParam;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
210 /*if ( (signed int)v2 < 40 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
211 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
212 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
213 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
214 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
215 v2 = pMessageQueue_50CBD0->uNumMessages + 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
216 ++pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
217 }*/
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
218 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
219 break;
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
220 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
221 case VK_RIGHT:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
222 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
223 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
224 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem )
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
225 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
226 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
227 pWindowList[v3].pCurrentPosActiveItem = v7;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
228 if ( v8 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
229 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
230 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
231 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
232 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
233 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
234 if ( pWindowList[v3].field_30 != v1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
235 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
236 break;
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
237 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
238 v9 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
239 v10 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
240 if ( v10 > (signed int)v1 )
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
241 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
242 do
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
243 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
244 v9 = v9->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
245 --v10;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
246 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
247 while ( v10 );
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
248 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
249 v11 = v9->uControlParam;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
250 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
251 break;
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
252 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
253 case VK_DOWN:
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
254 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
255 v17 = pWindowList[v3].pStartingPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
256 v18 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
257 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
258 pWindowList[v3].pCurrentPosActiveItem = v17;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
259 else
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
260 pWindowList[v3].pCurrentPosActiveItem = v18 + 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
261 if ( pWindowList[v3].field_30 != v1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
262 return 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
263 v19 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
264 v20 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
265 if ( v20 > (signed int)v1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
266 {
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
267 do
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
268 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
269 v19 = v19->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
270 --v20;
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
271 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
272 while ( v20 );
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
273 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
274 v21 = v19->uControlParam;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
275 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
276 return 1;
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
277 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
278 case VK_SELECT:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
279 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
280 pMouse->GetClickPos(&uClickX, &uClickY);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
281 v4 = pWindowList[v3].pStartingPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
282 v28 = v4 + pWindowList[v3].pNumPresenceButton;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
283 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
284 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
285 while ( 1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
286 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
287 v5 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
288 if ( v4 > 0 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
289 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
290 v6 = v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
291 do
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
292 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
293 v5 = v5->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
294 --v6;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
295 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
296 while ( v6 );
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
297 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
298 if ( (signed int)uClickX >= (signed int)v5->uX
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
299 && (signed int)uClickX <= (signed int)v5->uZ
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
300 && (signed int)uClickY >= (signed int)v5->uY
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
301 && (signed int)uClickY <= (signed int)v5->uW )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
302 break;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
303 ++v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
304 if ( v4 >= v28 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
305 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
306 v1 = 0;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
307 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
308 --v27;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
309 if ( v27 < 0 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
310 return 0;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
311 continue;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
312 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
313 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
314 pWindowList[v3].pCurrentPosActiveItem = v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
315 return 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
316 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
317 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
318 break;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
319 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
320 case VK_UP:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
321 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
322 v22 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
323 v23 = pWindowList[v3].pStartingPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
324 if ( v22 <= v23 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
325 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
326 else
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
327 v24 = v22 - 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
328 v8 = pWindowList[v3].field_30 == v1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
329 pWindowList[v3].pCurrentPosActiveItem = v24;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
330 if ( !v8 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
331 return 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
332 v19 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
333 v25 = pWindowList[v3].pCurrentPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
334 if ( v25 > (signed int)v1 )
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
335 {
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
336 do
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
337 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
338 v19 = v19->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
339 --v25;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
340 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
341 while ( v25 );
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
342 }
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
343 v21 = v19->uControlParam;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
344 /*if ( (signed int)v2 < 40 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
345 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
346 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
347 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
348 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
349 ++pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
350 }*/
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
351 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
352 return 1;
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
353 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
354 case VK_NEXT:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
355 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
356 if ( pWindowList[v3].field_30 != v1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
357 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
358 pMouse->GetClickPos(&uClickX, &uClickY);
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
359 v4 = pWindowList[v3].pStartingPosActiveItem;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
360 v29 = v4 + pWindowList[v3].pNumPresenceButton;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
361 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
362 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
363 while ( 1 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
364 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
365 v14 = pWindowList[v3].pControlsHead;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
366 if ( v4 > 0 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
367 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
368 v15 = v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
369 do
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
370 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
371 v14 = v14->pNext;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
372 --v15;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
373 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
374 while ( v15 );
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
375 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
376 if ( (signed int)uClickX >= (signed int)v14->uX
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
377 && (signed int)uClickX <= (signed int)v14->uZ
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
378 && (signed int)uClickY >= (signed int)v14->uY
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
379 && (signed int)uClickY <= (signed int)v14->uW )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
380 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
381 pWindowList[v3].pCurrentPosActiveItem = v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
382 return 1;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
383 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
384 ++v4;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
385 if ( v4 >= v29 )
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
386 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
387 v1 = 0;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
388 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
389 break;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
390 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
391 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
392 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
393 else
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
394 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
395 v2 = pMessageQueue_50CBD0->uNumMessages;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
396 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
397 }
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
398 break;
586
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
399 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
400 default:
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
401 {
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
402 break;
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
403 }
3c7fca0e01a0 sub_41CD4F clean
zipi
parents: 585
diff changeset
404
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
405 }
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
406 }
0
Ritor1
parents:
diff changeset
407 --v27;
Ritor1
parents:
diff changeset
408 if ( v27 < 0 )
Ritor1
parents:
diff changeset
409 return 0;
Ritor1
parents:
diff changeset
410 }
585
3ac7059a3f4f goto clean
zipi
parents: 584
diff changeset
411
0
Ritor1
parents:
diff changeset
412 }
Ritor1
parents:
diff changeset
413
Ritor1
parents:
diff changeset
414 //----- (0041D20D) --------------------------------------------------------
Ritor1
parents:
diff changeset
415 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2)
Ritor1
parents:
diff changeset
416 {
Ritor1
parents:
diff changeset
417 unsigned int v4; // edi@1
Ritor1
parents:
diff changeset
418 unsigned int v5; // esi@1
Ritor1
parents:
diff changeset
419 unsigned int v6; // ebp@1
Ritor1
parents:
diff changeset
420 unsigned int v7; // ebx@1
Ritor1
parents:
diff changeset
421 signed __int64 v8; // ST34_8@1
Ritor1
parents:
diff changeset
422 signed __int64 v9; // kr00_8@1
Ritor1
parents:
diff changeset
423 char *v10; // eax@2
Ritor1
parents:
diff changeset
424 char *v11; // eax@7
Ritor1
parents:
diff changeset
425 char *v12; // eax@13
Ritor1
parents:
diff changeset
426 char *v13; // eax@19
Ritor1
parents:
diff changeset
427 int uY; // [sp+0h] [bp-20h]@1
Ritor1
parents:
diff changeset
428 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
429 signed __int64 v17; // [sp+10h] [bp-10h]@1
Ritor1
parents:
diff changeset
430 signed __int64 v18; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
431 unsigned int v19; // [sp+24h] [bp+4h]@1
Ritor1
parents:
diff changeset
432
Ritor1
parents:
diff changeset
433 a1 = edx0;
Ritor1
parents:
diff changeset
434 uY = ecx0;
Ritor1
parents:
diff changeset
435 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32;
Ritor1
parents:
diff changeset
436 v5 = (signed __int64)((double)a3 * 0.234375);
Ritor1
parents:
diff changeset
437 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32;
Ritor1
parents:
diff changeset
438 v7 = (signed __int64)((double)a3 * 0.234375) / 60;
Ritor1
parents:
diff changeset
439 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60;
Ritor1
parents:
diff changeset
440 v19 = (unsigned int)v8 / 0x18;
Ritor1
parents:
diff changeset
441 v18 = (signed __int64)__PAIR__(v4, v5) % 60;
Ritor1
parents:
diff changeset
442 v17 = (signed __int64)__PAIR__(v6, v7) % 60;
Ritor1
parents:
diff changeset
443 v9 = v8 % 24;
Ritor1
parents:
diff changeset
444 strcpy(pTmpBuf, "\r020");
Ritor1
parents:
diff changeset
445 if ( (unsigned int)v8 / 0x18 )
Ritor1
parents:
diff changeset
446 {
Ritor1
parents:
diff changeset
447 v10 = pGlobalTXT_LocalizationStrings[57]; // Days
Ritor1
parents:
diff changeset
448 if ( v19 <= 1 )
Ritor1
parents:
diff changeset
449 v10 = pGlobalTXT_LocalizationStrings[56]; // Day
Ritor1
parents:
diff changeset
450 sprintf(pTmpBuf2, "%d %s ", v19, v10);
Ritor1
parents:
diff changeset
451 strcat(pTmpBuf, pTmpBuf2);
Ritor1
parents:
diff changeset
452 }
Ritor1
parents:
diff changeset
453 if ( v9 )
Ritor1
parents:
diff changeset
454 {
Ritor1
parents:
diff changeset
455 if ( v9 <= 1 )
Ritor1
parents:
diff changeset
456 v11 = pGlobalTXT_LocalizationStrings[109];// Hour
Ritor1
parents:
diff changeset
457 else
Ritor1
parents:
diff changeset
458 v11 = pGlobalTXT_LocalizationStrings[110];// Hours
Ritor1
parents:
diff changeset
459 sprintf(pTmpBuf2, "%d %s ", v9, v11);
Ritor1
parents:
diff changeset
460 strcat(pTmpBuf, pTmpBuf2);
Ritor1
parents:
diff changeset
461 }
Ritor1
parents:
diff changeset
462 if ( v17 && !v19 )
Ritor1
parents:
diff changeset
463 {
Ritor1
parents:
diff changeset
464 if ( v17 <= 1 )
Ritor1
parents:
diff changeset
465 v12 = pGlobalTXT_LocalizationStrings[437];// Minute
Ritor1
parents:
diff changeset
466 else
Ritor1
parents:
diff changeset
467 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes
Ritor1
parents:
diff changeset
468 sprintf(pTmpBuf2, "%d %s ", v17, v12);
Ritor1
parents:
diff changeset
469 strcat(pTmpBuf, pTmpBuf2);
Ritor1
parents:
diff changeset
470 }
Ritor1
parents:
diff changeset
471 if ( v18 && !v9 )
Ritor1
parents:
diff changeset
472 {
Ritor1
parents:
diff changeset
473 if ( v18 <= 1 )
Ritor1
parents:
diff changeset
474 v13 = pGlobalTXT_LocalizationStrings[439];// Second
Ritor1
parents:
diff changeset
475 else
Ritor1
parents:
diff changeset
476 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds
Ritor1
parents:
diff changeset
477 sprintf(pTmpBuf2, "%d %s ", v18, v13);
Ritor1
parents:
diff changeset
478 strcat(pTmpBuf, pTmpBuf2);
Ritor1
parents:
diff changeset
479 }
Ritor1
parents:
diff changeset
480 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0);
Ritor1
parents:
diff changeset
481 }
Ritor1
parents:
diff changeset
482
Ritor1
parents:
diff changeset
483
Ritor1
parents:
diff changeset
484
549
f146781c5c2d Draw_item_info fixing
Gloval
parents: 526
diff changeset
485
0
Ritor1
parents:
diff changeset
486
587
fb0e105683e9 GameUI_WritePointedObjectStatusString goto clean
zipi
parents: 586
diff changeset
487
0
Ritor1
parents:
diff changeset
488
Ritor1
parents:
diff changeset
489 //----- (0041F54A) --------------------------------------------------------
Ritor1
parents:
diff changeset
490 void __cdecl LoadActualSkyFrame()
Ritor1
parents:
diff changeset
491 {
Ritor1
parents:
diff changeset
492 if ( pTexture_RestUI_CurrentSkyFrame )
Ritor1
parents:
diff changeset
493 pTexture_RestUI_CurrentSkyFrame->Release();
Ritor1
parents:
diff changeset
494 if ( pTexture_RestUI_CurrentHourglassFrame )
Ritor1
parents:
diff changeset
495 pTexture_RestUI_CurrentHourglassFrame->Release();
Ritor1
parents:
diff changeset
496 pIcons_LOD->_40F9C5();
Ritor1
parents:
diff changeset
497 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour);
Ritor1
parents:
diff changeset
498 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
Ritor1
parents:
diff changeset
499 }
Ritor1
parents:
diff changeset
500
Ritor1
parents:
diff changeset
501 //----- (0041F5BE) --------------------------------------------------------
Ritor1
parents:
diff changeset
502 void __cdecl Sleep6Hours()
Ritor1
parents:
diff changeset
503 {
Ritor1
parents:
diff changeset
504 if ( _506F18_num_hours_to_sleep < 6 )
Ritor1
parents:
diff changeset
505 {
Ritor1
parents:
diff changeset
506 pParty->pPlayers[3].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
507 pParty->pPlayers[2].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
508 pParty->pPlayers[1].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
509 pParty->pPlayers[0].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
510 if ( _506F18_num_hours_to_sleep )
Ritor1
parents:
diff changeset
511 {
Ritor1
parents:
diff changeset
512 Rest(_506F18_num_hours_to_sleep);
Ritor1
parents:
diff changeset
513 _506F18_num_hours_to_sleep = 0;
Ritor1
parents:
diff changeset
514 LoadActualSkyFrame();
Ritor1
parents:
diff changeset
515 }
Ritor1
parents:
diff changeset
516 if ( dword_506F14 == 2 )
Ritor1
parents:
diff changeset
517 {
Ritor1
parents:
diff changeset
518 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
519 pEventTimer->Resume();
Ritor1
parents:
diff changeset
520 if ( pTexture_RestUI_CurrentSkyFrame )
Ritor1
parents:
diff changeset
521 pTexture_RestUI_CurrentSkyFrame->Release();
Ritor1
parents:
diff changeset
522 if ( pTexture_RestUI_CurrentHourglassFrame )
Ritor1
parents:
diff changeset
523 pTexture_RestUI_CurrentHourglassFrame->Release();
Ritor1
parents:
diff changeset
524 pTexture_RestUI_CurrentHourglassFrame = 0;
Ritor1
parents:
diff changeset
525 pTexture_RestUI_CurrentSkyFrame = 0;
Ritor1
parents:
diff changeset
526 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
527 pIcons_LOD->_40F9C5();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
528 pCurrentScreen = SCREEN_GAME;
0
Ritor1
parents:
diff changeset
529 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
530 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
531 {
Ritor1
parents:
diff changeset
532 pOutdoor->UpdateSunlightVectors();
Ritor1
parents:
diff changeset
533 pOutdoor->UpdateFog();
Ritor1
parents:
diff changeset
534 }
Ritor1
parents:
diff changeset
535 }
Ritor1
parents:
diff changeset
536 dword_506F14 = 0;
Ritor1
parents:
diff changeset
537 }
Ritor1
parents:
diff changeset
538 else
Ritor1
parents:
diff changeset
539 {
Ritor1
parents:
diff changeset
540 Rest(6u);
Ritor1
parents:
diff changeset
541 _506F18_num_hours_to_sleep -= 6;
Ritor1
parents:
diff changeset
542 LoadActualSkyFrame();
Ritor1
parents:
diff changeset
543 }
Ritor1
parents:
diff changeset
544 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
545 }
Ritor1
parents:
diff changeset
546
Ritor1
parents:
diff changeset
547
421
80a5aab68b67 Chest subs moved to Chest.cpp
Nomad
parents: 406
diff changeset
548
0
Ritor1
parents:
diff changeset
549
Ritor1
parents:
diff changeset
550 //----- (0042038D) --------------------------------------------------------
Ritor1
parents:
diff changeset
551 void __cdecl sub_42038D()
Ritor1
parents:
diff changeset
552 {
Ritor1
parents:
diff changeset
553 POINT *v0; // esi@2
Ritor1
parents:
diff changeset
554 int v1; // ecx@2
Ritor1
parents:
diff changeset
555 const char *v2; // eax@3
Ritor1
parents:
diff changeset
556 POINT v3; // [sp+0h] [bp-10h]@2
Ritor1
parents:
diff changeset
557 POINT a2; // [sp+8h] [bp-8h]@1
Ritor1
parents:
diff changeset
558
Ritor1
parents:
diff changeset
559 if ( pMouse->GetCursorPos(&a2)->y < 350 )
Ritor1
parents:
diff changeset
560 {
Ritor1
parents:
diff changeset
561 v0 = pMouse->GetCursorPos(&a2);
Ritor1
parents:
diff changeset
562 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]];
Ritor1
parents:
diff changeset
563 if ( v1 )
Ritor1
parents:
diff changeset
564 {
Ritor1
parents:
diff changeset
565 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
566 + 18 * *((short *)&pChests[0].igChestItems[139].uExpireTime
0
Ritor1
parents:
diff changeset
567 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3));
702
efde64b3e147 sub_4BDAAF clean
zipi
parents: 697
diff changeset
568
efde64b3e147 sub_4BDAAF clean
zipi
parents: 697
diff changeset
569 _w = (ItemGen *)(&pChests[(unsigned int)pChestWindow->ptr_1C] -32
efde64b3e147 sub_4BDAAF clean
zipi
parents: 697
diff changeset
570 + 18 * *((short *)&pChests[(unsigned int)pChestWindow->ptr_1C].igChestItems[139].uExpireTime + v1 + 3));
0
Ritor1
parents:
diff changeset
571 v2 = _w->GetDisplayName();
Ritor1
parents:
diff changeset
572 sub_41C0B8_set_status_string(v2);
Ritor1
parents:
diff changeset
573 }
Ritor1
parents:
diff changeset
574 }
Ritor1
parents:
diff changeset
575 }
Ritor1
parents:
diff changeset
576
Ritor1
parents:
diff changeset
577
Ritor1
parents:
diff changeset
578 //----- (00420C05) --------------------------------------------------------
Ritor1
parents:
diff changeset
579 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
Ritor1
parents:
diff changeset
580 {
Ritor1
parents:
diff changeset
581 unsigned int v2; // edi@1
Ritor1
parents:
diff changeset
582 int v3; // ebp@1
Ritor1
parents:
diff changeset
583 unsigned int v4; // esi@1
Ritor1
parents:
diff changeset
584 int v5; // ecx@6
Ritor1
parents:
diff changeset
585 NPCData *v6; // eax@6
Ritor1
parents:
diff changeset
586 signed int v7; // edx@8
Ritor1
parents:
diff changeset
587 signed int v8; // ebx@10
Ritor1
parents:
diff changeset
588 char *v9; // edi@11
Ritor1
parents:
diff changeset
589 signed int v10; // ecx@17
Ritor1
parents:
diff changeset
590 int v11; // eax@21
Ritor1
parents:
diff changeset
591 NPCData *v12; // ecx@21
Ritor1
parents:
diff changeset
592 unsigned int v13; // ecx@23
Ritor1
parents:
diff changeset
593 signed int v14; // [sp+Ch] [bp-4h]@6
Ritor1
parents:
diff changeset
594
Ritor1
parents:
diff changeset
595 v2 = 0;
Ritor1
parents:
diff changeset
596 v3 = 0;
Ritor1
parents:
diff changeset
597 v4 = uNumGold;
Ritor1
parents:
diff changeset
598 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal )
Ritor1
parents:
diff changeset
599 {
Ritor1
parents:
diff changeset
600 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 )
Ritor1
parents:
diff changeset
601 {
Ritor1
parents:
diff changeset
602 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold!
Ritor1
parents:
diff changeset
603 }
Ritor1
parents:
diff changeset
604 else
Ritor1
parents:
diff changeset
605 {
Ritor1
parents:
diff changeset
606 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 )
Ritor1
parents:
diff changeset
607 pTmpBuf2[0] = 0;
Ritor1
parents:
diff changeset
608 }
Ritor1
parents:
diff changeset
609 }
Ritor1
parents:
diff changeset
610 else
Ritor1
parents:
diff changeset
611 {
Ritor1
parents:
diff changeset
612 v14 = 0;
Ritor1
parents:
diff changeset
613 v5 = 0;
Ritor1
parents:
diff changeset
614 v6 = pParty->pHirelings;
Ritor1
parents:
diff changeset
615 do
Ritor1
parents:
diff changeset
616 {
Ritor1
parents:
diff changeset
617 if ( v6->pName )
Ritor1
parents:
diff changeset
618 {
Ritor1
parents:
diff changeset
619 v7 = v14++;
Ritor1
parents:
diff changeset
620 pTmpBuf[v7] = v5;
Ritor1
parents:
diff changeset
621 }
Ritor1
parents:
diff changeset
622 ++v6;
Ritor1
parents:
diff changeset
623 ++v5;
Ritor1
parents:
diff changeset
624 }
Ritor1
parents:
diff changeset
625 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
Ritor1
parents:
diff changeset
626 v8 = 0;
Ritor1
parents:
diff changeset
627 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
Ritor1
parents:
diff changeset
628 {
Ritor1
parents:
diff changeset
629 v9 = (char *)pNPCStats->pNewNPCData;
Ritor1
parents:
diff changeset
630 do
Ritor1
parents:
diff changeset
631 {
Ritor1
parents:
diff changeset
632 if ( v9[8] & 0x80
Ritor1
parents:
diff changeset
633 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName))
Ritor1
parents:
diff changeset
634 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) )
Ritor1
parents:
diff changeset
635 {
Ritor1
parents:
diff changeset
636 v10 = v14++;
Ritor1
parents:
diff changeset
637 pTmpBuf[v10] = v8 + 2;
Ritor1
parents:
diff changeset
638 }
Ritor1
parents:
diff changeset
639 ++v8;
Ritor1
parents:
diff changeset
640 v9 += 76;
Ritor1
parents:
diff changeset
641 }
Ritor1
parents:
diff changeset
642 while ( v8 < (signed int)pNPCStats->uNumNewNPCs );
Ritor1
parents:
diff changeset
643 v2 = 0;
Ritor1
parents:
diff changeset
644 }
Ritor1
parents:
diff changeset
645 if ( v14 > 0 )
Ritor1
parents:
diff changeset
646 {
Ritor1
parents:
diff changeset
647 do
Ritor1
parents:
diff changeset
648 {
Ritor1
parents:
diff changeset
649 v11 = (unsigned __int8)pTmpBuf[v2];
Ritor1
parents:
diff changeset
650 v12 = &pNPCStats->pNPCData[v11 + 499];
33
a9e9c6989d04 20.01.13
Ritor1
parents: 24
diff changeset
651 if ( (unsigned __int8)pTmpBuf[v2] < 2 )
0
Ritor1
parents:
diff changeset
652 v12 = &pParty->pHirelings[v11];
Ritor1
parents:
diff changeset
653 v13 = v12->uProfession;
Ritor1
parents:
diff changeset
654 if ( v13 )
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 266
diff changeset
655 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13);
0
Ritor1
parents:
diff changeset
656 ++v2;
Ritor1
parents:
diff changeset
657 }
Ritor1
parents:
diff changeset
658 while ( (signed int)v2 < v14 );
Ritor1
parents:
diff changeset
659 }
652
1ff57450f090 * Some fixes to TravelByTransport
Nomad
parents: 649
diff changeset
660 if ( CheckHiredNPCSpeciality(Factor) )
0
Ritor1
parents:
diff changeset
661 v4 += (signed int)(10 * v4) / 100;
652
1ff57450f090 * Some fixes to TravelByTransport
Nomad
parents: 649
diff changeset
662 if ( CheckHiredNPCSpeciality(Banker) )
0
Ritor1
parents:
diff changeset
663 v4 += (signed int)(20 * v4) / 100;
652
1ff57450f090 * Some fixes to TravelByTransport
Nomad
parents: 649
diff changeset
664 if ( CheckHiredNPCSpeciality(Pirate) )
0
Ritor1
parents:
diff changeset
665 v4 += (signed int)(10 * v4) / 100;
Ritor1
parents:
diff changeset
666 if ( v3 )
Ritor1
parents:
diff changeset
667 {
Ritor1
parents:
diff changeset
668 v3 = (signed int)(v4 * v3 / 100) / 100;
Ritor1
parents:
diff changeset
669 if ( v3 < 1 )
Ritor1
parents:
diff changeset
670 v3 = 1;
Ritor1
parents:
diff changeset
671 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)!
Ritor1
parents:
diff changeset
672 }
Ritor1
parents:
diff changeset
673 else
Ritor1
parents:
diff changeset
674 {
Ritor1
parents:
diff changeset
675 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold!
Ritor1
parents:
diff changeset
676 }
Ritor1
parents:
diff changeset
677 v2 = 0;
Ritor1
parents:
diff changeset
678 }
Ritor1
parents:
diff changeset
679 pParty->uNumGold += v4 - v3;
Ritor1
parents:
diff changeset
680 pUIAnim_Gold->uAnimTime = v2;
Ritor1
parents:
diff changeset
681 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
Ritor1
parents:
diff changeset
682 if ( pTmpBuf2[0] )
Ritor1
parents:
diff changeset
683 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
684 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2);
Ritor1
parents:
diff changeset
685 }
Ritor1
parents:
diff changeset
686
Ritor1
parents:
diff changeset
687 //----- (00420E01) --------------------------------------------------------
Ritor1
parents:
diff changeset
688 void __cdecl sub_420E01()
Ritor1
parents:
diff changeset
689 {
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
690 int chest_id; // edi@1
0
Ritor1
parents:
diff changeset
691 POINT *v1; // esi@2
Ritor1
parents:
diff changeset
692 int v2; // eax@2
Ritor1
parents:
diff changeset
693 int v3; // ebx@4
Ritor1
parents:
diff changeset
694 int v4; // esi@6
Ritor1
parents:
diff changeset
695 int v5; // ecx@6
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
696 //SpriteObject v6; // [sp+Ch] [bp-80h]@1
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
697 POINT v7; // [sp+7Ch] [bp-10h]@2
0
Ritor1
parents:
diff changeset
698 POINT a2; // [sp+84h] [bp-8h]@2
Ritor1
parents:
diff changeset
699
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
700 SpriteObject v6; // [sp+Ch] [bp-80h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
701 //SpriteObject::SpriteObject(&v6);
0
Ritor1
parents:
diff changeset
702
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
703 chest_id = pGUIWindow_CurrentMenu->par1C;
0
Ritor1
parents:
diff changeset
704 if ( pParty->pPickedItem.uItemID )
Ritor1
parents:
diff changeset
705 {
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
706 if ( Chest::PutItemInChest(-1, &pParty->pPickedItem, pGUIWindow_CurrentMenu->par1C) )
0
Ritor1
parents:
diff changeset
707 pMouse->RemoveHoldingItem();
Ritor1
parents:
diff changeset
708 }
Ritor1
parents:
diff changeset
709 else
Ritor1
parents:
diff changeset
710 {
Ritor1
parents:
diff changeset
711 v1 = pMouse->GetCursorPos(&a2);
Ritor1
parents:
diff changeset
712 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF;
Ritor1
parents:
diff changeset
713 if ( v2 )
Ritor1
parents:
diff changeset
714 {
Ritor1
parents:
diff changeset
715 if ( v2 )
Ritor1
parents:
diff changeset
716 v3 = v2 - 1;
Ritor1
parents:
diff changeset
717 else
Ritor1
parents:
diff changeset
718 v3 = -1;
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
719 v4 = pChests[chest_id].pInventoryIndices[v3] - 1;
600
db4a23580e6c Chest item view fixed, gold can be taken
Gloval
parents: 595
diff changeset
720 if ( pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uEquipType == EQUIP_GOLD )
0
Ritor1
parents:
diff changeset
721 {
600
db4a23580e6c Chest item view fixed, gold can be taken
Gloval
parents: 595
diff changeset
722 party_finds_gold(pChests[chest_id].igChestItems[v4].uSpecEnchantmentType, 0);
0
Ritor1
parents:
diff changeset
723 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
724 }
Ritor1
parents:
diff changeset
725 else
Ritor1
parents:
diff changeset
726 {
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
727 pParty->SetHoldingItem(&pChests[chest_id].igChestItems[v4]);
0
Ritor1
parents:
diff changeset
728 }
Ritor1
parents:
diff changeset
729 sub_420B13(v4, v3);
Ritor1
parents:
diff changeset
730 }
Ritor1
parents:
diff changeset
731 }
Ritor1
parents:
diff changeset
732 }
Ritor1
parents:
diff changeset
733
Ritor1
parents:
diff changeset
734
Ritor1
parents:
diff changeset
735
Ritor1
parents:
diff changeset
736 //----- (004219BE) --------------------------------------------------------
Ritor1
parents:
diff changeset
737 GUIWindow *stru277::sub_4219BE()
Ritor1
parents:
diff changeset
738 {
Ritor1
parents:
diff changeset
739 int v1; // esi@1
Ritor1
parents:
diff changeset
740 GUIWindow *v2; // ebx@1
Ritor1
parents:
diff changeset
741
Ritor1
parents:
diff changeset
742 auto a4 = this;
Ritor1
parents:
diff changeset
743 v1 = (int)a4;
Ritor1
parents:
diff changeset
744 pEventTimer->Pause();
Ritor1
parents:
diff changeset
745 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
746 bRingsShownInCharScreen = 0;
Ritor1
parents:
diff changeset
747 CharacterUI_LoadPaperdollTextures();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
748 pCurrentScreen = SCREEN_CASTING;
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 706
diff changeset
749 v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_1F, v1, 0);
0
Ritor1
parents:
diff changeset
750 pCharacterScreen_ExitBtn = v2->CreateButton(
Ritor1
parents:
diff changeset
751 394u,
Ritor1
parents:
diff changeset
752 318u,
Ritor1
parents:
diff changeset
753 75u,
Ritor1
parents:
diff changeset
754 33u,
Ritor1
parents:
diff changeset
755 1,
Ritor1
parents:
diff changeset
756 0,
Ritor1
parents:
diff changeset
757 0xA8u,
Ritor1
parents:
diff changeset
758 0,
Ritor1
parents:
diff changeset
759 0,
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 706
diff changeset
760 pGlobalTXT_LocalizationStrings[79], // Close
0
Ritor1
parents:
diff changeset
761 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0),
Ritor1
parents:
diff changeset
762 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0,
Ritor1
parents:
diff changeset
763 0);
Ritor1
parents:
diff changeset
764 v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0);
Ritor1
parents:
diff changeset
765 pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0);
Ritor1
parents:
diff changeset
766 v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
Ritor1
parents:
diff changeset
767 v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
Ritor1
parents:
diff changeset
768 v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
Ritor1
parents:
diff changeset
769 v2->CreateButton(407u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
Ritor1
parents:
diff changeset
770 return v2;
Ritor1
parents:
diff changeset
771 }
Ritor1
parents:
diff changeset
772
Ritor1
parents:
diff changeset
773
Ritor1
parents:
diff changeset
774 //----- (00421B2C) --------------------------------------------------------
Ritor1
parents:
diff changeset
775 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem()
Ritor1
parents:
diff changeset
776 {
Ritor1
parents:
diff changeset
777 unsigned int v0; // eax@2
Ritor1
parents:
diff changeset
778 Texture *v1; // ebx@2
Ritor1
parents:
diff changeset
779 int v2; // eax@3
Ritor1
parents:
diff changeset
780 Player *v3; // esi@5
Ritor1
parents:
diff changeset
781 int v4; // eax@6
Ritor1
parents:
diff changeset
782 unsigned __int16 v5; // dx@11
Ritor1
parents:
diff changeset
783 signed int v6; // eax@11
Ritor1
parents:
diff changeset
784 char *v7; // edi@12
Ritor1
parents:
diff changeset
785 __int16 v8; // ax@16
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
786 SpriteObject a1; // [sp+4h] [bp-78h]@11
0
Ritor1
parents:
diff changeset
787 int v11; // [sp+74h] [bp-8h]@2
Ritor1
parents:
diff changeset
788 int v12; // [sp+78h] [bp-4h]@5
Ritor1
parents:
diff changeset
789
Ritor1
parents:
diff changeset
790 if ( !pParty->pPickedItem.uItemID )
Ritor1
parents:
diff changeset
791 return 1;
Ritor1
parents:
diff changeset
792 v0 = pIcons_LOD->LoadTexture(
Ritor1
parents:
diff changeset
793 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName,
Ritor1
parents:
diff changeset
794 TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
795 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0);
Ritor1
parents:
diff changeset
796 v11 = areWeLoadingTexture;
Ritor1
parents:
diff changeset
797 if ( uActiveCharacter
Ritor1
parents:
diff changeset
798 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 )
Ritor1
parents:
diff changeset
799 {
232
c879446b4a22 inventory indexing fixed
zipi
parents: 223
diff changeset
800 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u);
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
801 pMouse->RemoveHoldingItem();
0
Ritor1
parents:
diff changeset
802 }
Ritor1
parents:
diff changeset
803 else
Ritor1
parents:
diff changeset
804 {
Ritor1
parents:
diff changeset
805 v12 = 0;
Ritor1
parents:
diff changeset
806 v3 = pParty->pPlayers;
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
807 while ( v3 <= &pParty->pPlayers[3] )
0
Ritor1
parents:
diff changeset
808 {
Ritor1
parents:
diff changeset
809 v4 = v3->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID);
Ritor1
parents:
diff changeset
810 if ( v4 )
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
811 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
812 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u);
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
813 pMouse->RemoveHoldingItem();
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
814 break;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
815 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
816 ++v12;
0
Ritor1
parents:
diff changeset
817 ++v3;
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
818 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
819 if ( v12 == 4 )
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
820 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
821 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
822 v6 = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
823 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
824 if ( (signed int)pObjectList->uNumObjects <= 0 )
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
825 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
826 LOWORD(v6) = 0;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
827 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
828 else
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
829 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
830 v7 = (char *)&pObjectList->pObjects->uObjectID;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
831 while ( v5 != *(short *)v7 )
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
832 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
833 ++v6;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
834 v7 += 56;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
835 if ( v6 >= (signed int)pObjectList->uNumObjects )
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
836 {
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
837 LOWORD(v6) = 0;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
838 break;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
839 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
840 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
841 }
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 291
diff changeset
842 a1.field_58_pid = OBJECT_Player;
244
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
843 a1.uObjectDescID = v6;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
844 a1.vPosition.y = pParty->vPosition.y;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
845 a1.vPosition.x = pParty->vPosition.x;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
846 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
847 a1.uSoundID = 0;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
848 a1.uFacing = 0;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
849 a1.uAttributes = 8;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
850 v8 = pIndoor->GetSector(
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
851 pParty->vPosition.x,
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
852 pParty->vPosition.y,
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
853 pParty->sEyelevel + pParty->vPosition.z);
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
854 a1.uSpriteFrameID = 0;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
855 a1.uSectorID = v8;
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
856 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24));
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
857 a1.Create(pParty->sRotationY, 184, 200, 0);
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
858 pMouse->RemoveHoldingItem();
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
859 }
bb9e946cbcbf cleaning, ring fixed
zipi
parents: 243
diff changeset
860 }
0
Ritor1
parents:
diff changeset
861 if ( !v11 )
Ritor1
parents:
diff changeset
862 {
Ritor1
parents:
diff changeset
863 v1->Release();
Ritor1
parents:
diff changeset
864 pIcons_LOD->_40F9C5();
Ritor1
parents:
diff changeset
865 }
Ritor1
parents:
diff changeset
866 return 1;
Ritor1
parents:
diff changeset
867 }
Ritor1
parents:
diff changeset
868
Ritor1
parents:
diff changeset
869
Ritor1
parents:
diff changeset
870 //----- (00421D00) --------------------------------------------------------
Ritor1
parents:
diff changeset
871 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID)
Ritor1
parents:
diff changeset
872 {
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
873 //unsigned int v1; // esi@1
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
874 //int v2; // eax@2
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
875 //Player *v3; // ecx@2
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
876 //Player *v4; // ecx@5
0
Ritor1
parents:
diff changeset
877 unsigned int v5; // [sp-4h] [bp-10h]@21
Ritor1
parents:
diff changeset
878
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
879 //v1 = uPlayerID;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
880 auto player = &pParty->pPlayers[uPlayerID - 1];
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
881 if (pParty->pPickedItem.uItemID)
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
882 {
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
883 //v3 = player;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
884 if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID))
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
885 {
232
c879446b4a22 inventory indexing fixed
zipi
parents: 223
diff changeset
886 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u);
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
887 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
888 pMouse->RemoveHoldingItem();
Ritor1
parents:
diff changeset
889 return;
Ritor1
parents:
diff changeset
890 }
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
891
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
892 if (!player->CanAct())
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
893 {
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
894 player = pPlayers[uActiveCharacter];
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
895 }
595
55d6b756e03a Cave textures
Nomad
parents: 588
diff changeset
896 if(player->CanAct() || !pPlayers[uActiveCharacter]->CanAct())
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
897 player->PlaySound(SPEECH_NoRoom, 0);
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
898 }
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
899
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
900 //LABEL_9:
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
901 if (pCurrentScreen == SCREEN_GAME)
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
902 {
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
903 viewparams->bRedrawGameUI = true;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
904 if ( uActiveCharacter != uPlayerID )
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
905 //goto LABEL_27;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
906 {
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
907 if ( pPlayers[uPlayerID]->uTimeToRecovery )
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
908 return;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
909
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
910 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
911 return;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
912 }
0
Ritor1
parents:
diff changeset
913 v5 = 7;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
914 //LABEL_22:
0
Ritor1
parents:
diff changeset
915 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5);
Ritor1
parents:
diff changeset
916 return;
Ritor1
parents:
diff changeset
917 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
918 if ( pCurrentScreen == SCREEN_SPELL_BOOK )
0
Ritor1
parents:
diff changeset
919 return;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
920 if ( pCurrentScreen == SCREEN_CHEST )
0
Ritor1
parents:
diff changeset
921 {
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
922 //LABEL_23:
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
923 viewparams->bRedrawGameUI = true;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
924 if ( uActiveCharacter == uPlayerID )
0
Ritor1
parents:
diff changeset
925 {
Ritor1
parents:
diff changeset
926 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
927 pCurrentScreen = SCREEN_F;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
928 //goto LABEL_28;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
929 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
930 return;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
931 }
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
932 //LABEL_27:
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
933 if ( pPlayers[uPlayerID]->uTimeToRecovery )
0
Ritor1
parents:
diff changeset
934 return;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
935 //goto LABEL_28;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
936 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
937 return;
0
Ritor1
parents:
diff changeset
938 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
939 if ( pCurrentScreen != SCREEN_HOUSE )
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
940 {
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
941 if ( pCurrentScreen == SCREEN_E )
0
Ritor1
parents:
diff changeset
942 {
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
943 //LABEL_28:
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
944 uActiveCharacter = uPlayerID;
0
Ritor1
parents:
diff changeset
945 return;
Ritor1
parents:
diff changeset
946 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
947 if ( pCurrentScreen != SCREEN_F )
0
Ritor1
parents:
diff changeset
948 {
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
949 viewparams->bRedrawGameUI = true;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
950 uActiveCharacter = uPlayerID;
0
Ritor1
parents:
diff changeset
951 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 )
521
663c4f618f56 Awards tab corrrection
Gloval
parents: 520
diff changeset
952 FillAwardsData();
0
Ritor1
parents:
diff changeset
953 return;
Ritor1
parents:
diff changeset
954 }
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
955 //goto LABEL_23;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
956 viewparams->bRedrawGameUI = true;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
957 if ( uActiveCharacter == uPlayerID )
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
958 {
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
959 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
960 pCurrentScreen = SCREEN_F;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
961 //goto LABEL_28;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
962 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
963 return;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
964 }
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
965 //LABEL_27:
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
966 if ( pPlayers[uPlayerID]->uTimeToRecovery )
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
967 return;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
968 //goto LABEL_28;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
969 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
970 return;
0
Ritor1
parents:
diff changeset
971 }
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
972 if ( window_SpeakInHouse->field_40 == 1 )
0
Ritor1
parents:
diff changeset
973 return;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
974 viewparams->bRedrawGameUI = true;
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
975 if ( uActiveCharacter != uPlayerID )
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
976 //goto LABEL_28;
201
30aa44013f7a On Items
Nomad
parents: 190
diff changeset
977 uActiveCharacter = uPlayerID;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
978 return;
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
979 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6)
0
Ritor1
parents:
diff changeset
980 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 726
diff changeset
981 __debugbreak(); // fix indexing
0
Ritor1
parents:
diff changeset
982 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
Ritor1
parents:
diff changeset
983 v5 = 14;
11
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
984 //goto LABEL_22;
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
985 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5);
66319a734368 16.01.13(work)
Ritor1
parents: 8
diff changeset
986 return;
0
Ritor1
parents:
diff changeset
987 }
Ritor1
parents:
diff changeset
988 }
Ritor1
parents:
diff changeset
989 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
990 // F8B19C: using guessed type int dword_F8B19C;
Ritor1
parents:
diff changeset
991
Ritor1
parents:
diff changeset
992 //----- (00421EA6) --------------------------------------------------------
Ritor1
parents:
diff changeset
993 void __cdecl sub_421EA6_OnInventoryLeftClick()
Ritor1
parents:
diff changeset
994 {
Ritor1
parents:
diff changeset
995 Player *v0; // ebx@1
Ritor1
parents:
diff changeset
996 signed int v1; // eax@2
Ritor1
parents:
diff changeset
997 signed int v2; // ecx@2
Ritor1
parents:
diff changeset
998 int v3; // eax@2
Ritor1
parents:
diff changeset
999 char v4; // sf@2
Ritor1
parents:
diff changeset
1000 int v5; // eax@2
Ritor1
parents:
diff changeset
1001 unsigned int v6; // eax@7
Ritor1
parents:
diff changeset
1002 unsigned int v7; // esi@12
Ritor1
parents:
diff changeset
1003 unsigned int v8; // eax@12
Ritor1
parents:
diff changeset
1004 unsigned int v9; // eax@16
Ritor1
parents:
diff changeset
1005 unsigned int v10; // eax@18
Ritor1
parents:
diff changeset
1006 ItemGen this_; // [sp+Ch] [bp-3Ch]@1
Ritor1
parents:
diff changeset
1007 POINT a2; // [sp+30h] [bp-18h]@4
Ritor1
parents:
diff changeset
1008 unsigned int v13; // [sp+38h] [bp-10h]@13
Ritor1
parents:
diff changeset
1009 unsigned int pY; // [sp+3Ch] [bp-Ch]@2
Ritor1
parents:
diff changeset
1010 unsigned int pX; // [sp+40h] [bp-8h]@2
Ritor1
parents:
diff changeset
1011 int a4; // [sp+44h] [bp-4h]@2
Ritor1
parents:
diff changeset
1012
Ritor1
parents:
diff changeset
1013 v0 = pPlayers[uActiveCharacter];
501
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1014 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )
0
Ritor1
parents:
diff changeset
1015 {
501
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1016 pMouse->GetClickPos(&pX, &pY);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1017 pY = pY - 17;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1018 v2 =pX - 14;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1019 pX = v2;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1020 v3 = 14 * (pY >> 5);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1021 v2 >>= 5;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1022 v4 = v2 + v3 < 0;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1023 v5 = v2 + v3;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1024 a4 = v5;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1025 if ( !v4 )
0
Ritor1
parents:
diff changeset
1026 {
501
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1027 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1028 && pMouse->GetCursorPos(&a2)->x >= 14 )
0
Ritor1
parents:
diff changeset
1029 {
501
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1030 if ( unk_50C9A0 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1031 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1032 v6 = v0->GetItemIDAtInventoryIndex(&a4);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1033 if ( v6 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1034 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1035 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1036 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1037 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1038 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1039 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1];
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1040 unk_50C9A0 = 0;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1041 if ( pMessageQueue_50CBD0->uNumMessages )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1042 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1043 pMouse->SetCursorBitmap("MICON1");
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1044 dword_50C9D0 = 113;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1045 dword_50C9D4 = 0;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1046 dword_50C9D8 = 256;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1047 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1048 return;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1049 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1050 if ( ptr_50C9A4 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1051 return;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1052 v7 = pParty->pPickedItem.uItemID;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1053 v8 = v0->GetItemIDAtInventoryIndex(&a4);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1054 if ( !v7 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1055 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1056 if ( !v8 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1057 return;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1058 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem));
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1059 v0->RemoveItemAtInventoryIndex(a4);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1060 v9 = pParty->pPickedItem.uItemID;
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1061 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1062 return;
501
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1063 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1064 v13 = v8;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1065 if ( v8 )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1066 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1067 a2.y = (LONG)&v0->pInventoryItems[v8-1];
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1068 memcpy(&this_, (const void *)a2.y, sizeof(this_));
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1069 v0->RemoveItemAtInventoryIndex(a4);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1070 pX = v0->AddItem2(a4, &pParty->pPickedItem);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1071 if ( !pX )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1072 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1073 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1074 if ( !pX )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1075 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1076 v0->_49298B(&this_, v13 - 1, a4);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1077 memcpy((void *)a2.y, &this_, sizeof(ItemGen));
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1078 return;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1079 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1080 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1081 v9 = this_.uItemID;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1082 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem));
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1083 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1084 return;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1085 }
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1086 v10 = v0->AddItem(a4, v7);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1087 pX = v10;
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1088 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) )
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1089 {
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1090 memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u);
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1091 pMouse->RemoveHoldingItem();
6fa3ff8ef729 SubtractVariables
Ritor1
parents: 500
diff changeset
1092 }
0
Ritor1
parents:
diff changeset
1093 }
Ritor1
parents:
diff changeset
1094 }
Ritor1
parents:
diff changeset
1095 }
Ritor1
parents:
diff changeset
1096 }
Ritor1
parents:
diff changeset
1097
Ritor1
parents:
diff changeset
1098 //----- (0042213C) --------------------------------------------------------
Ritor1
parents:
diff changeset
1099 void __cdecl OnGameViewportClick()
Ritor1
parents:
diff changeset
1100 {
Ritor1
parents:
diff changeset
1101 signed int v0; // ebx@2
Ritor1
parents:
diff changeset
1102 POINT *v1; // esi@3
Ritor1
parents:
diff changeset
1103 signed int v2; // eax@9
Ritor1
parents:
diff changeset
1104 BLVFace *v3; // eax@10
Ritor1
parents:
diff changeset
1105 unsigned int v4; // eax@11
Ritor1
parents:
diff changeset
1106 unsigned __int16 v5; // dx@14
Ritor1
parents:
diff changeset
1107 signed int v6; // eax@14
Ritor1
parents:
diff changeset
1108 char *v7; // esi@15
Ritor1
parents:
diff changeset
1109 int *v8; // eax@19
Ritor1
parents:
diff changeset
1110 int v9; // eax@19
Ritor1
parents:
diff changeset
1111 unsigned int v10; // eax@19
Ritor1
parents:
diff changeset
1112 int v11; // ecx@21
Ritor1
parents:
diff changeset
1113 ODMFace *v12; // eax@22
Ritor1
parents:
diff changeset
1114 LevelDecoration *v13; // esi@24
Ritor1
parents:
diff changeset
1115 __int16 v14; // ax@25
Ritor1
parents:
diff changeset
1116 int v15; // ecx@29
Ritor1
parents:
diff changeset
1117 signed int v16; // edx@30
Ritor1
parents:
diff changeset
1118 Actor *v17; // esi@30
Ritor1
parents:
diff changeset
1119 int v18; // ebx@47
Ritor1
parents:
diff changeset
1120 unsigned __int16 v19; // ax@50
Ritor1
parents:
diff changeset
1121 const char *v20; // eax@51
Ritor1
parents:
diff changeset
1122 signed int v21; // eax@58
Ritor1
parents:
diff changeset
1123 ItemGen *v22; // esi@62
Ritor1
parents:
diff changeset
1124 unsigned int v23; // eax@62
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1125 SpriteObject a1; // [sp+Ch] [bp-80h]@1
0
Ritor1
parents:
diff changeset
1126 POINT v25; // [sp+7Ch] [bp-10h]@3
Ritor1
parents:
diff changeset
1127 POINT a2; // [sp+84h] [bp-8h]@3
Ritor1
parents:
diff changeset
1128
Ritor1
parents:
diff changeset
1129 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
1130 {
Ritor1
parents:
diff changeset
1131 v0 = pGame->pVisInstance->get_picked_object_zbuf_val();
Ritor1
parents:
diff changeset
1132 }
Ritor1
parents:
diff changeset
1133 else
Ritor1
parents:
diff changeset
1134 {
Ritor1
parents:
diff changeset
1135 v1 = pMouse->GetCursorPos(&a2);
Ritor1
parents:
diff changeset
1136 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]];
Ritor1
parents:
diff changeset
1137 }
141
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
1138 if ( (v0 & 7) == OBJECT_Item)
0
Ritor1
parents:
diff changeset
1139 {
Ritor1
parents:
diff changeset
1140 a2.y = (signed int)(unsigned __int16)v0 >> 3;
Ritor1
parents:
diff changeset
1141 v21 = (signed int)(unsigned __int16)v0 >> 3;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1142 if ( !(pObjectList->pObjects[pSpriteObjects[v21].uObjectDescID].uFlags & 0x10)
0
Ritor1
parents:
diff changeset
1143 && a2.y < 1000
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1144 && pSpriteObjects[v21].uObjectDescID
0
Ritor1
parents:
diff changeset
1145 && (unsigned int)v0 < 0x2000000 )
Ritor1
parents:
diff changeset
1146 {
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1147 v22 = &pSpriteObjects[v21].stru_24;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1148 v23 = pSpriteObjects[v21].stru_24.uItemID;
0
Ritor1
parents:
diff changeset
1149 if ( pItemsTable->pItems[v23].uEquipType == 18 )
Ritor1
parents:
diff changeset
1150 {
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
1151 party_finds_gold(v22->uSpecEnchantmentType, 0);
0
Ritor1
parents:
diff changeset
1152 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
1153 }
Ritor1
parents:
diff changeset
1154 else
Ritor1
parents:
diff changeset
1155 {
721
Ritor1
parents: 705
diff changeset
1156 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName);
0
Ritor1
parents:
diff changeset
1157 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1158 if ( v22->uItemID == 506 )
484
4bd56919f075 avard quest guild bits
Gloval
parents: 469
diff changeset
1159 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u);
0
Ritor1
parents:
diff changeset
1160 if ( v22->uItemID == 455 )
484
4bd56919f075 avard quest guild bits
Gloval
parents: 469
diff changeset
1161 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u);
0
Ritor1
parents:
diff changeset
1162 if ( !pParty->AddItem(v22) )
Ritor1
parents:
diff changeset
1163 pParty->SetHoldingItem(v22);
Ritor1
parents:
diff changeset
1164 }
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
1165 SpriteObject::OnInteraction(a2.y);
0
Ritor1
parents:
diff changeset
1166 return;
Ritor1
parents:
diff changeset
1167 }
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1168 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1169 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1170 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1171 goto LABEL_14;
0
Ritor1
parents:
diff changeset
1172 }
141
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
1173 if ( (v0 & 7) != OBJECT_Actor)
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
1174 {
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
1175 if ( (v0 & 7) == OBJECT_Decoration)
0
Ritor1
parents:
diff changeset
1176 {
Ritor1
parents:
diff changeset
1177 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3];
Ritor1
parents:
diff changeset
1178 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 )
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1179 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1180 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1181 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1182 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1183 goto LABEL_14;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1184 }
0
Ritor1
parents:
diff changeset
1185 v14 = v13->field_16_event_id;
Ritor1
parents:
diff changeset
1186 if ( !v14 )
Ritor1
parents:
diff changeset
1187 {
Ritor1
parents:
diff changeset
1188 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() )
Ritor1
parents:
diff changeset
1189 {
Ritor1
parents:
diff changeset
1190 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380;
520
35f28d4c0ff9 GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents: 515
diff changeset
1191 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3];
0
Ritor1
parents:
diff changeset
1192 EventProcessor(v15, 0, 1);
520
35f28d4c0ff9 GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents: 515
diff changeset
1193 activeLevelDecoration = NULL;
0
Ritor1
parents:
diff changeset
1194 }
Ritor1
parents:
diff changeset
1195 return;
Ritor1
parents:
diff changeset
1196 }
Ritor1
parents:
diff changeset
1197 v11 = v14;
Ritor1
parents:
diff changeset
1198 }
Ritor1
parents:
diff changeset
1199 else
Ritor1
parents:
diff changeset
1200 {
141
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
1201 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 )
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1202 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1203 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1204 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1205 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1206 goto LABEL_14;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1207 }
0
Ritor1
parents:
diff changeset
1208 v2 = (signed int)(unsigned __int16)v0 >> 3;
Ritor1
parents:
diff changeset
1209 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
1210 {
Ritor1
parents:
diff changeset
1211 v3 = &pIndoor->pFaces[v2];
Ritor1
parents:
diff changeset
1212 if ( !(v3->uAttributes & 0x2000000) )
Ritor1
parents:
diff changeset
1213 {
Ritor1
parents:
diff changeset
1214 LABEL_11:
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1215 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1216 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1217 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1218 ShowNothingHereStatus();
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1219 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1220 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1221 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1222 }
0
Ritor1
parents:
diff changeset
1223 LABEL_14:
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1224 v5 = pItemsTable->pItems[v4].uSpriteID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1225 v6 = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1226 a1.uType = v5;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1227 if ( (signed int)pObjectList->uNumObjects <= 0 )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1228 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1229 LOWORD(v6) = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1230 }
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1231 else
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1232 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1233 v7 = (char *)&pObjectList->pObjects->uObjectID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1234 while ( v5 != *(short *)v7 )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1235 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1236 ++v6;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1237 v7 += 56;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1238 if ( v6 >= (signed int)pObjectList->uNumObjects )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1239 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1240 LOWORD(v6) = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1241 break;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1242 }
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1243 }
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1244 }
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1245 a1.uObjectDescID = v6;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1246 a1.vPosition.y = pParty->vPosition.y;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1247 a1.field_58_pid = OBJECT_Player;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1248 a1.vPosition.x = pParty->vPosition.x;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1249 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1250 a1.uSoundID = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1251 a1.uFacing = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1252 a1.uAttributes = 8;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1253 a1.uSectorID = pIndoor->GetSector(
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1254 pParty->vPosition.x,
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1255 pParty->vPosition.y,
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1256 pParty->sEyelevel + pParty->vPosition.z);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1257 a1.uSpriteFrameID = 0;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1258 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1259 v8 = (int *)pMouse->GetCursorPos(&v25);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1260 v9 = UnprojectX(*v8);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1261 a1.Create(pParty->sRotationY + v9, 184, 200, 0);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1262 v10 = pIcons_LOD->LoadTexture(
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1263 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName,
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1264 TEXTURE_16BIT_PALETTE);
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1265 if (v10 != -1)
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1266 pIcons_LOD->pTextures[v10].Release();
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1267 pMouse->RemoveHoldingItem();
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1268 pIcons_LOD->_40F9C5();
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1269 return;
0
Ritor1
parents:
diff changeset
1270 }
Ritor1
parents:
diff changeset
1271 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID;
Ritor1
parents:
diff changeset
1272 }
Ritor1
parents:
diff changeset
1273 else
Ritor1
parents:
diff changeset
1274 {
Ritor1
parents:
diff changeset
1275 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F];
Ritor1
parents:
diff changeset
1276 if ( !(v12->uAttributes & 0x2000000) )
Ritor1
parents:
diff changeset
1277 goto LABEL_11;
Ritor1
parents:
diff changeset
1278 v11 = v12->sCogTriggeredID;
Ritor1
parents:
diff changeset
1279 }
Ritor1
parents:
diff changeset
1280 }
Ritor1
parents:
diff changeset
1281 EventProcessor(v11, (unsigned __int16)v0, 1);
Ritor1
parents:
diff changeset
1282 return;
Ritor1
parents:
diff changeset
1283 }
Ritor1
parents:
diff changeset
1284 v16 = (signed int)(unsigned __int16)v0 >> 3;
Ritor1
parents:
diff changeset
1285 a2.y = v16;
Ritor1
parents:
diff changeset
1286 v17 = &pActors[v16];
Ritor1
parents:
diff changeset
1287 if ( v17->uAIState == 5 )
Ritor1
parents:
diff changeset
1288 {
Ritor1
parents:
diff changeset
1289 if ( (unsigned int)v0 < 0x2000000 )
Ritor1
parents:
diff changeset
1290 {
Ritor1
parents:
diff changeset
1291 stru_50C198.LootActor(&pActors[v16]);
Ritor1
parents:
diff changeset
1292 return;
Ritor1
parents:
diff changeset
1293 }
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1294 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1295 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1296 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1297 goto LABEL_14;
0
Ritor1
parents:
diff changeset
1298 }
Ritor1
parents:
diff changeset
1299 if ( GetAsyncKeyState(VK_SHIFT) >= 0 )
Ritor1
parents:
diff changeset
1300 {
Ritor1
parents:
diff changeset
1301 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) )
Ritor1
parents:
diff changeset
1302 {
Ritor1
parents:
diff changeset
1303 if ( (unsigned int)v0 >= 0x2000000 )
588
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1304 {
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1305 v4 = pParty->pPickedItem.uItemID;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1306 if ( !pParty->pPickedItem.uItemID )
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1307 return;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1308 goto LABEL_14;
829fb49eee05 OnGameViewportClick cleaned partly
zipi
parents: 587
diff changeset
1309 }
0
Ritor1
parents:
diff changeset
1310 if ( !v17->CanAct() )
Ritor1
parents:
diff changeset
1311 return;
Ritor1
parents:
diff changeset
1312 v18 = a2.y;
Ritor1
parents:
diff changeset
1313 Actor::FaceObject(a2.y, 4u, 0, 0);
602
628694cd5744 Margaret working
zipi
parents: 600
diff changeset
1314 if ( !v17->sNPC_ID )
0
Ritor1
parents:
diff changeset
1315 {
Ritor1
parents:
diff changeset
1316 v19 = pNPCStats->pGroups_copy[v17->uGroup];
Ritor1
parents:
diff changeset
1317 if ( v19 )
Ritor1
parents:
diff changeset
1318 {
Ritor1
parents:
diff changeset
1319 v20 = pNPCStats->pCatchPhrases[v19];
Ritor1
parents:
diff changeset
1320 if ( v20 )
Ritor1
parents:
diff changeset
1321 {
Ritor1
parents:
diff changeset
1322 pParty->uFlags |= 2u;
Ritor1
parents:
diff changeset
1323 strcpy(byte_5B0938, v20);
Ritor1
parents:
diff changeset
1324 sub_4451A8_press_any_key(0, 0, 0);
Ritor1
parents:
diff changeset
1325 }
Ritor1
parents:
diff changeset
1326 }
Ritor1
parents:
diff changeset
1327 return;
Ritor1
parents:
diff changeset
1328 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1329 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
0
Ritor1
parents:
diff changeset
1330 return;
Ritor1
parents:
diff changeset
1331 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
Ritor1
parents:
diff changeset
1332 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18;
Ritor1
parents:
diff changeset
1333 LABEL_42:
Ritor1
parents:
diff changeset
1334 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
1335 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1336 return;*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1337 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0);
0
Ritor1
parents:
diff changeset
1338 return;
Ritor1
parents:
diff changeset
1339 }
Ritor1
parents:
diff changeset
1340 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
Ritor1
parents:
diff changeset
1341 {
Ritor1
parents:
diff changeset
1342 pTurnEngine->field_18 |= 8u;
Ritor1
parents:
diff changeset
1343 return;
Ritor1
parents:
diff changeset
1344 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1345 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
1346 {
Ritor1
parents:
diff changeset
1347 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23;
Ritor1
parents:
diff changeset
1348 goto LABEL_41;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1349 }*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1350 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
0
Ritor1
parents:
diff changeset
1351 }
Ritor1
parents:
diff changeset
1352 else
Ritor1
parents:
diff changeset
1353 {
Ritor1
parents:
diff changeset
1354 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
Ritor1
parents:
diff changeset
1355 {
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1356 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
0
Ritor1
parents:
diff changeset
1357 return;
Ritor1
parents:
diff changeset
1358 }
Ritor1
parents:
diff changeset
1359 if ( uActiveCharacter
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1360 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell))
0
Ritor1
parents:
diff changeset
1361 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1362 pMessageQueue_50CBD0->AddMessage(UIMSG_19, 0, 0);
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1363 /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
1364 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25;
Ritor1
parents:
diff changeset
1365 LABEL_41:
Ritor1
parents:
diff changeset
1366 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 431
diff changeset
1367 goto LABEL_42;*/
0
Ritor1
parents:
diff changeset
1368 }
Ritor1
parents:
diff changeset
1369 }
Ritor1
parents:
diff changeset
1370 }
Ritor1
parents:
diff changeset
1371
Ritor1
parents:
diff changeset
1372 //----- (004226C2) --------------------------------------------------------
265
96bc024a5fed Render overflows
Nomad
parents: 255
diff changeset
1373 bool PauseGameDrawing()
0
Ritor1
parents:
diff changeset
1374 {
265
96bc024a5fed Render overflows
Nomad
parents: 255
diff changeset
1375 if ( pCurrentScreen != SCREEN_GAME
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1376 && pCurrentScreen != SCREEN_NPC_DIALOGUE
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1377 && pCurrentScreen != SCREEN_CHANGE_LOCATION )
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1378 {
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1379 if ( pCurrentScreen == SCREEN_INPUT_BLV )
0
Ritor1
parents:
diff changeset
1380 return pVideoPlayer->pSmackerMovie != 0;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1381 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG )
265
96bc024a5fed Render overflows
Nomad
parents: 255
diff changeset
1382 return true;
96bc024a5fed Render overflows
Nomad
parents: 255
diff changeset
1383 }
96bc024a5fed Render overflows
Nomad
parents: 255
diff changeset
1384 return false;
0
Ritor1
parents:
diff changeset
1385 }
Ritor1
parents:
diff changeset
1386 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
1387
Ritor1
parents:
diff changeset
1388 //----- (004226EF) --------------------------------------------------------
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1389 void SetUserInterface(PartyAlignment align, bool bReplace)
0
Ritor1
parents:
diff changeset
1390 {
Ritor1
parents:
diff changeset
1391 unsigned int v3; // eax@7
Ritor1
parents:
diff changeset
1392 unsigned __int16 v4; // dx@7
Ritor1
parents:
diff changeset
1393 unsigned __int16 v5; // cx@7
Ritor1
parents:
diff changeset
1394 unsigned __int16 v6; // [sp-4h] [bp-14h]@7
Ritor1
parents:
diff changeset
1395
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1396
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1397 if (align == PartyAlignment_Evil)
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1398 {
0
Ritor1
parents:
diff changeset
1399 if ( bReplace )
Ritor1
parents:
diff changeset
1400 {
Ritor1
parents:
diff changeset
1401 pTexture_RightFrame->Reload("ib-r-C.pcx");
Ritor1
parents:
diff changeset
1402 pTexture_BottomFrame->Reload("ib-b-C.pcx");
Ritor1
parents:
diff changeset
1403 pTexture_TopFrame->Reload("ib-t-C.pcx");
Ritor1
parents:
diff changeset
1404 pTexture_LeftFrame->Reload("ib-l-C.pcx");
Ritor1
parents:
diff changeset
1405 pTexture_StatusBar->Reload("IB-Foot-c.pcx");
Ritor1
parents:
diff changeset
1406 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2);
Ritor1
parents:
diff changeset
1407 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2);
Ritor1
parents:
diff changeset
1408 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2);
Ritor1
parents:
diff changeset
1409 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2);
Ritor1
parents:
diff changeset
1410 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2);
Ritor1
parents:
diff changeset
1411 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1412 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1413 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1414 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1415 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2);
0
Ritor1
parents:
diff changeset
1416 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1417 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1418 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1419 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1420 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2);
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1421
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1422 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1423 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1424 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1425 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1426
0
Ritor1
parents:
diff changeset
1427 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1428 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID);
0
Ritor1
parents:
diff changeset
1429 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1430 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1431
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
1432 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2);
0
Ritor1
parents:
diff changeset
1433 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2);
Ritor1
parents:
diff changeset
1434 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2);
Ritor1
parents:
diff changeset
1435 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
Ritor1
parents:
diff changeset
1436 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2);
Ritor1
parents:
diff changeset
1437 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2);
Ritor1
parents:
diff changeset
1438 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2);
Ritor1
parents:
diff changeset
1439 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2);
Ritor1
parents:
diff changeset
1440 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2);
Ritor1
parents:
diff changeset
1441 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2);
Ritor1
parents:
diff changeset
1442 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2);
Ritor1
parents:
diff changeset
1443 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2);
Ritor1
parents:
diff changeset
1444 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2);
Ritor1
parents:
diff changeset
1445 }
Ritor1
parents:
diff changeset
1446 else
Ritor1
parents:
diff changeset
1447 {
Ritor1
parents:
diff changeset
1448 pTexture_RightFrame->Load("ib-r-C.pcx", 0);
Ritor1
parents:
diff changeset
1449 pTexture_BottomFrame->Load("ib-b-c.pcx", 0);
Ritor1
parents:
diff changeset
1450 pTexture_TopFrame->Load("ib-t-C.pcx", 0);
Ritor1
parents:
diff changeset
1451 pTexture_LeftFrame->Load("ib-l-C.pcx", 0);
Ritor1
parents:
diff changeset
1452 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0);
Ritor1
parents:
diff changeset
1453 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1454 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1455 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1456 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1457 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1458 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1459 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1460 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE);
328
8e23edf57e27 little fix
Ritor1
parents: 323
diff changeset
1461 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1462 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE);
0
Ritor1
parents:
diff changeset
1463 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1464 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1465 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1466 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1467 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
1468 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1469 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1470 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1471 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1472 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
0
Ritor1
parents:
diff changeset
1473 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1474 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1475 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
Ritor1
parents:
diff changeset
1476 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
Ritor1
parents:
diff changeset
1477 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
Ritor1
parents:
diff changeset
1478 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
Ritor1
parents:
diff changeset
1479 }
Ritor1
parents:
diff changeset
1480 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0);
Ritor1
parents:
diff changeset
1481 v4 = 0;
Ritor1
parents:
diff changeset
1482 v6 = 0;
Ritor1
parents:
diff changeset
1483 v5 = 10;
Ritor1
parents:
diff changeset
1484 }
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1485 else if (align == PartyAlignment_Neutral)
0
Ritor1
parents:
diff changeset
1486 {
Ritor1
parents:
diff changeset
1487 if ( bReplace )
Ritor1
parents:
diff changeset
1488 {
Ritor1
parents:
diff changeset
1489 pTexture_RightFrame->Reload("ib-r-a.pcx");
Ritor1
parents:
diff changeset
1490 pTexture_BottomFrame->Reload("ib-b-a.pcx");
Ritor1
parents:
diff changeset
1491 pTexture_TopFrame->Reload("ib-t-a.pcx");
Ritor1
parents:
diff changeset
1492 pTexture_LeftFrame->Reload("ib-l-a.pcx");
Ritor1
parents:
diff changeset
1493 pTexture_StatusBar->Reload("IB-Foot-a.pcx");
Ritor1
parents:
diff changeset
1494 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2);
Ritor1
parents:
diff changeset
1495 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2);
Ritor1
parents:
diff changeset
1496 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2);
Ritor1
parents:
diff changeset
1497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2);
Ritor1
parents:
diff changeset
1498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2);
Ritor1
parents:
diff changeset
1499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1502 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1503 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2);
0
Ritor1
parents:
diff changeset
1504 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1505 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1506 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1507 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1508 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2);
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1509 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1510 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1511 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1512 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2);
0
Ritor1
parents:
diff changeset
1513 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
Ritor1
parents:
diff changeset
1514 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
Ritor1
parents:
diff changeset
1515 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
Ritor1
parents:
diff changeset
1516 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
1517 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2);
0
Ritor1
parents:
diff changeset
1518 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2);
Ritor1
parents:
diff changeset
1519 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2);
Ritor1
parents:
diff changeset
1520 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
Ritor1
parents:
diff changeset
1521 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2);
Ritor1
parents:
diff changeset
1522 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2);
Ritor1
parents:
diff changeset
1523 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2);
Ritor1
parents:
diff changeset
1524 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2);
Ritor1
parents:
diff changeset
1525 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2);
Ritor1
parents:
diff changeset
1526 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2);
Ritor1
parents:
diff changeset
1527 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2);
Ritor1
parents:
diff changeset
1528 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2);
Ritor1
parents:
diff changeset
1529 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2);
Ritor1
parents:
diff changeset
1530 }
Ritor1
parents:
diff changeset
1531 else
Ritor1
parents:
diff changeset
1532 {
Ritor1
parents:
diff changeset
1533 pTexture_RightFrame->Load("ib-r-A.pcx", 0);
Ritor1
parents:
diff changeset
1534 pTexture_BottomFrame->Load("ib-b-A.pcx", 0);
Ritor1
parents:
diff changeset
1535 pTexture_TopFrame->Load("ib-t-A.pcx", 0);
Ritor1
parents:
diff changeset
1536 pTexture_LeftFrame->Load("ib-l-A.pcx", 0);
Ritor1
parents:
diff changeset
1537 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0);
Ritor1
parents:
diff changeset
1538 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1539 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1540 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1541 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1542 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1543 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1544 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1545 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE);
0
Ritor1
parents:
diff changeset
1546 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1547 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1548 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1549 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1550 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE);
328
8e23edf57e27 little fix
Ritor1
parents: 323
diff changeset
1551 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1552 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
1553 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1554 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1555 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1556 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1557 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
0
Ritor1
parents:
diff changeset
1558 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1559 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1560 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
Ritor1
parents:
diff changeset
1561 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
Ritor1
parents:
diff changeset
1562 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
Ritor1
parents:
diff changeset
1563 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
Ritor1
parents:
diff changeset
1564 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1565 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1566 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1567 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1568 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1569 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1570 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1571 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1572 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
1573 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)];
Ritor1
parents:
diff changeset
1574
Ritor1
parents:
diff changeset
1575 }
Ritor1
parents:
diff changeset
1576 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0);
Ritor1
parents:
diff changeset
1577 v4 = 214;
Ritor1
parents:
diff changeset
1578 v5 = 230;
Ritor1
parents:
diff changeset
1579 v6 = 193;
Ritor1
parents:
diff changeset
1580 }
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1581 else if (align == PartyAlignment_Good)
0
Ritor1
parents:
diff changeset
1582 {
Ritor1
parents:
diff changeset
1583 if ( bReplace )
Ritor1
parents:
diff changeset
1584 {
Ritor1
parents:
diff changeset
1585 pTexture_RightFrame->Reload("ib-r-B.pcx");
Ritor1
parents:
diff changeset
1586 pTexture_BottomFrame->Reload("ib-b-B.pcx");
Ritor1
parents:
diff changeset
1587 pTexture_TopFrame->Reload("ib-t-B.pcx");
Ritor1
parents:
diff changeset
1588 pTexture_LeftFrame->Reload("ib-l-B.pcx");
Ritor1
parents:
diff changeset
1589 pTexture_StatusBar->Reload("IB-Foot-b.pcx");
Ritor1
parents:
diff changeset
1590 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2);
Ritor1
parents:
diff changeset
1591 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2);
Ritor1
parents:
diff changeset
1592 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2);
Ritor1
parents:
diff changeset
1593 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2);
Ritor1
parents:
diff changeset
1594 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2);
Ritor1
parents:
diff changeset
1595 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1596 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1597 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1598 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1599 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2);
0
Ritor1
parents:
diff changeset
1600 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2);
319
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1601 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1602 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1603 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
5a66be213cff Actor::Die
Nomad
parents: 316
diff changeset
1604 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2);
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1605 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1606 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1607 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2);
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
1608 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2);
0
Ritor1
parents:
diff changeset
1609 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB");
Ritor1
parents:
diff changeset
1610 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
Ritor1
parents:
diff changeset
1611 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
Ritor1
parents:
diff changeset
1612 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 524
diff changeset
1613 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2);
0
Ritor1
parents:
diff changeset
1614 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2);
Ritor1
parents:
diff changeset
1615 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2);
Ritor1
parents:
diff changeset
1616 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
Ritor1
parents:
diff changeset
1617 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2);
Ritor1
parents:
diff changeset
1618 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2);
Ritor1
parents:
diff changeset
1619 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2);
Ritor1
parents:
diff changeset
1620 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2);
Ritor1
parents:
diff changeset
1621 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2);
Ritor1
parents:
diff changeset
1622 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2);
Ritor1
parents:
diff changeset
1623 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2);
Ritor1
parents:
diff changeset
1624 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2);
Ritor1
parents:
diff changeset
1625 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2);
Ritor1
parents:
diff changeset
1626 }
Ritor1
parents:
diff changeset
1627 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u);
Ritor1
parents:
diff changeset
1628 v5 = 255;
Ritor1
parents:
diff changeset
1629 v4 = 225;
Ritor1
parents:
diff changeset
1630 v6 = 255;
Ritor1
parents:
diff changeset
1631 }
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1632 else assert(false);
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 365
diff changeset
1633
0
Ritor1
parents:
diff changeset
1634 uGameUIFontMain = v3;
Ritor1
parents:
diff changeset
1635 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6);
Ritor1
parents:
diff changeset
1636 }
Ritor1
parents:
diff changeset
1637
Ritor1
parents:
diff changeset
1638
Ritor1
parents:
diff changeset
1639
Ritor1
parents:
diff changeset
1640 //----- (00423AEE) --------------------------------------------------------
Ritor1
parents:
diff changeset
1641 void __cdecl reset_some_strus_flt_2Cs()
Ritor1
parents:
diff changeset
1642 {
Ritor1
parents:
diff changeset
1643 float *v0; // eax@1
Ritor1
parents:
diff changeset
1644 signed int v1; // ecx@1
Ritor1
parents:
diff changeset
1645 signed int v2; // edx@1
Ritor1
parents:
diff changeset
1646 float *v3; // eax@3
Ritor1
parents:
diff changeset
1647 signed int v4; // edx@3
Ritor1
parents:
diff changeset
1648 float *v5; // eax@5
Ritor1
parents:
diff changeset
1649 signed int v6; // edx@5
Ritor1
parents:
diff changeset
1650 float *v7; // eax@7
Ritor1
parents:
diff changeset
1651 signed int v8; // edx@7
Ritor1
parents:
diff changeset
1652 float *v9; // eax@9
Ritor1
parents:
diff changeset
1653
Ritor1
parents:
diff changeset
1654 v0 = &array_50AC10[0].flt_2C;
Ritor1
parents:
diff changeset
1655 v1 = 50;
Ritor1
parents:
diff changeset
1656 v2 = 50;
Ritor1
parents:
diff changeset
1657 do
Ritor1
parents:
diff changeset
1658 {
Ritor1
parents:
diff changeset
1659 *v0 = 0.0;
Ritor1
parents:
diff changeset
1660 v0 += 12;
Ritor1
parents:
diff changeset
1661 --v2;
Ritor1
parents:
diff changeset
1662 }
Ritor1
parents:
diff changeset
1663 while ( v2 );
Ritor1
parents:
diff changeset
1664 v3 = &array_50A2B0[0].flt_2C;
Ritor1
parents:
diff changeset
1665 v4 = 50;
Ritor1
parents:
diff changeset
1666 do
Ritor1
parents:
diff changeset
1667 {
Ritor1
parents:
diff changeset
1668 *v3 = 0.0;
Ritor1
parents:
diff changeset
1669 v3 += 12;
Ritor1
parents:
diff changeset
1670 --v4;
Ritor1
parents:
diff changeset
1671 }
Ritor1
parents:
diff changeset
1672 while ( v4 );
Ritor1
parents:
diff changeset
1673 v5 = &array_509950[0].flt_2C;
Ritor1
parents:
diff changeset
1674 v6 = 50;
Ritor1
parents:
diff changeset
1675 do
Ritor1
parents:
diff changeset
1676 {
Ritor1
parents:
diff changeset
1677 *v5 = 0.0;
Ritor1
parents:
diff changeset
1678 v5 += 12;
Ritor1
parents:
diff changeset
1679 --v6;
Ritor1
parents:
diff changeset
1680 }
Ritor1
parents:
diff changeset
1681 while ( v6 );
Ritor1
parents:
diff changeset
1682 v7 = &array_508FF0[0].flt_2C;
Ritor1
parents:
diff changeset
1683 v8 = 50;
Ritor1
parents:
diff changeset
1684 do
Ritor1
parents:
diff changeset
1685 {
Ritor1
parents:
diff changeset
1686 *v7 = 0.0;
Ritor1
parents:
diff changeset
1687 v7 += 12;
Ritor1
parents:
diff changeset
1688 --v8;
Ritor1
parents:
diff changeset
1689 }
Ritor1
parents:
diff changeset
1690 while ( v8 );
Ritor1
parents:
diff changeset
1691 v9 = &array_508690[0].flt_2C;
Ritor1
parents:
diff changeset
1692 do
Ritor1
parents:
diff changeset
1693 {
Ritor1
parents:
diff changeset
1694 *v9 = 0.0;
Ritor1
parents:
diff changeset
1695 v9 += 12;
Ritor1
parents:
diff changeset
1696 --v1;
Ritor1
parents:
diff changeset
1697 }
Ritor1
parents:
diff changeset
1698 while ( v1 );
Ritor1
parents:
diff changeset
1699 }
Ritor1
parents:
diff changeset
1700
Ritor1
parents:
diff changeset
1701 //----- (00423B4A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1702 void __cdecl sub_423B4A()
Ritor1
parents:
diff changeset
1703 {
Ritor1
parents:
diff changeset
1704 float *v0; // eax@1
Ritor1
parents:
diff changeset
1705 signed int v1; // ecx@1
Ritor1
parents:
diff changeset
1706
Ritor1
parents:
diff changeset
1707 v0 = &array_507D30[0].flt_2C;
Ritor1
parents:
diff changeset
1708 v1 = 50;
Ritor1
parents:
diff changeset
1709 do
Ritor1
parents:
diff changeset
1710 {
Ritor1
parents:
diff changeset
1711 *v0 = 0.0;
Ritor1
parents:
diff changeset
1712 v0 += 12;
Ritor1
parents:
diff changeset
1713 --v1;
Ritor1
parents:
diff changeset
1714 }
Ritor1
parents:
diff changeset
1715 while ( v1 );
Ritor1
parents:
diff changeset
1716 }
Ritor1
parents:
diff changeset
1717
Ritor1
parents:
diff changeset
1718 //----- (00423B5D) --------------------------------------------------------
Ritor1
parents:
diff changeset
1719 int __fastcall sub_423B5D(unsigned int uFaceID)
Ritor1
parents:
diff changeset
1720 {
Ritor1
parents:
diff changeset
1721 BLVFace *v1; // ebx@1
Ritor1
parents:
diff changeset
1722 Vec3_short_ *v2; // esi@1
Ritor1
parents:
diff changeset
1723 //int v3; // ST28_4@1
Ritor1
parents:
diff changeset
1724 __int16 v4; // ST2C_2@1
Ritor1
parents:
diff changeset
1725 //signed int v5; // esi@1
Ritor1
parents:
diff changeset
1726 //Vec3_short_ *v6; // eax@4
Ritor1
parents:
diff changeset
1727 //signed int v7; // edi@5
Ritor1
parents:
diff changeset
1728 //signed int v8; // eax@5
Ritor1
parents:
diff changeset
1729 //signed int i_; // ecx@10
Ritor1
parents:
diff changeset
1730 int v10; // eax@10
Ritor1
parents:
diff changeset
1731 int v11; // edx@11
Ritor1
parents:
diff changeset
1732 int v12; // ST28_4@12
Ritor1
parents:
diff changeset
1733 signed int v13; // edx@12
Ritor1
parents:
diff changeset
1734 signed __int64 v14; // qtt@12
Ritor1
parents:
diff changeset
1735 int *v15; // ebx@12
Ritor1
parents:
diff changeset
1736 int v16; // ST28_4@14
Ritor1
parents:
diff changeset
1737 signed int v17; // eax@14
Ritor1
parents:
diff changeset
1738 signed __int64 v18; // qtt@14
Ritor1
parents:
diff changeset
1739 signed int v19; // edx@15
Ritor1
parents:
diff changeset
1740 signed int v20; // edx@17
Ritor1
parents:
diff changeset
1741 signed int v21; // ebx@19
Ritor1
parents:
diff changeset
1742 signed int v22; // esi@20
Ritor1
parents:
diff changeset
1743 int v23; // edi@21
Ritor1
parents:
diff changeset
1744 int v24; // eax@21
Ritor1
parents:
diff changeset
1745 int v25; // eax@22
Ritor1
parents:
diff changeset
1746 int v26; // eax@22
Ritor1
parents:
diff changeset
1747 signed int v27; // ST30_4@24
Ritor1
parents:
diff changeset
1748 signed __int64 v28; // qtt@24
Ritor1
parents:
diff changeset
1749 int v29; // ST18_4@25
Ritor1
parents:
diff changeset
1750 int v30; // eax@26
Ritor1
parents:
diff changeset
1751 int v31; // eax@27
Ritor1
parents:
diff changeset
1752 int v32; // eax@27
Ritor1
parents:
diff changeset
1753 signed int v33; // ST30_4@29
Ritor1
parents:
diff changeset
1754 signed __int64 v34; // qtt@29
Ritor1
parents:
diff changeset
1755 int v35; // ST30_4@30
Ritor1
parents:
diff changeset
1756 signed int v36; // edi@31
Ritor1
parents:
diff changeset
1757 unsigned int v37; // eax@31
Ritor1
parents:
diff changeset
1758 bool v38; // edx@31
Ritor1
parents:
diff changeset
1759 int v39; // ecx@31
Ritor1
parents:
diff changeset
1760 int v40; // ecx@32
Ritor1
parents:
diff changeset
1761 int v41; // esi@32
Ritor1
parents:
diff changeset
1762 int v42; // eax@34
Ritor1
parents:
diff changeset
1763 signed int v43; // ebx@41
Ritor1
parents:
diff changeset
1764 unsigned int v44; // eax@41
Ritor1
parents:
diff changeset
1765 signed int v45; // ecx@42
Ritor1
parents:
diff changeset
1766 int v46; // esi@42
Ritor1
parents:
diff changeset
1767 int v47; // eax@44
Ritor1
parents:
diff changeset
1768 signed int v48; // edi@51
Ritor1
parents:
diff changeset
1769 unsigned int v49; // eax@51
Ritor1
parents:
diff changeset
1770 bool v50; // edx@51
Ritor1
parents:
diff changeset
1771 int v51; // ecx@51
Ritor1
parents:
diff changeset
1772 int v52; // ecx@52
Ritor1
parents:
diff changeset
1773 signed int v53; // esi@52
Ritor1
parents:
diff changeset
1774 int v54; // eax@54
Ritor1
parents:
diff changeset
1775 int v55; // ebx@61
Ritor1
parents:
diff changeset
1776 unsigned int v56; // eax@61
Ritor1
parents:
diff changeset
1777 signed int v57; // ecx@62
Ritor1
parents:
diff changeset
1778 int v58; // esi@62
Ritor1
parents:
diff changeset
1779 int v59; // eax@64
Ritor1
parents:
diff changeset
1780 char v61; // zf@72
Ritor1
parents:
diff changeset
1781 signed int v62; // edx@75
Ritor1
parents:
diff changeset
1782 int v63; // ecx@76
Ritor1
parents:
diff changeset
1783 int v64; // esi@76
Ritor1
parents:
diff changeset
1784 int v65; // ecx@83
Ritor1
parents:
diff changeset
1785 //signed int v66; // [sp+14h] [bp-14h]@3
Ritor1
parents:
diff changeset
1786 int v67; // [sp+14h] [bp-14h]@34
Ritor1
parents:
diff changeset
1787 int v68; // [sp+14h] [bp-14h]@44
Ritor1
parents:
diff changeset
1788 int v69; // [sp+14h] [bp-14h]@54
Ritor1
parents:
diff changeset
1789 int v70; // [sp+14h] [bp-14h]@64
Ritor1
parents:
diff changeset
1790 signed int v71; // [sp+14h] [bp-14h]@75
Ritor1
parents:
diff changeset
1791 bool thisa; // [sp+18h] [bp-10h]@9
Ritor1
parents:
diff changeset
1792 int thisb; // [sp+18h] [bp-10h]@12
Ritor1
parents:
diff changeset
1793 int thisc; // [sp+18h] [bp-10h]@20
Ritor1
parents:
diff changeset
1794 bool thisd; // [sp+18h] [bp-10h]@41
Ritor1
parents:
diff changeset
1795 bool thise; // [sp+18h] [bp-10h]@61
Ritor1
parents:
diff changeset
1796 int thisf; // [sp+18h] [bp-10h]@74
Ritor1
parents:
diff changeset
1797 signed int v79; // [sp+1Ch] [bp-Ch]@9
Ritor1
parents:
diff changeset
1798 int v80; // [sp+1Ch] [bp-Ch]@76
Ritor1
parents:
diff changeset
1799 bool v81; // [sp+20h] [bp-8h]@10
Ritor1
parents:
diff changeset
1800 bool v82; // [sp+20h] [bp-8h]@32
Ritor1
parents:
diff changeset
1801 bool v83; // [sp+20h] [bp-8h]@42
Ritor1
parents:
diff changeset
1802 bool v84; // [sp+20h] [bp-8h]@52
Ritor1
parents:
diff changeset
1803 bool v85; // [sp+20h] [bp-8h]@62
Ritor1
parents:
diff changeset
1804 //signed int i; // [sp+24h] [bp-4h]@9
Ritor1
parents:
diff changeset
1805 signed int ia; // [sp+24h] [bp-4h]@19
Ritor1
parents:
diff changeset
1806 signed int ib; // [sp+24h] [bp-4h]@31
Ritor1
parents:
diff changeset
1807 signed int ic; // [sp+24h] [bp-4h]@41
Ritor1
parents:
diff changeset
1808 signed int id; // [sp+24h] [bp-4h]@51
Ritor1
parents:
diff changeset
1809 signed int ie; // [sp+24h] [bp-4h]@61
Ritor1
parents:
diff changeset
1810
Ritor1
parents:
diff changeset
1811 v1 = &pIndoor->pFaces[uFaceID];
Ritor1
parents:
diff changeset
1812 //this = pGame->pIndoorCameraD3D;
Ritor1
parents:
diff changeset
1813 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]];
Ritor1
parents:
diff changeset
1814 //v3 = *(_DWORD *)&v2->x;
Ritor1
parents:
diff changeset
1815 v4 = v2->z;
Ritor1
parents:
diff changeset
1816 //v5 = 0;
Ritor1
parents:
diff changeset
1817 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x)
Ritor1
parents:
diff changeset
1818 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y)
Ritor1
parents:
diff changeset
1819 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 )
Ritor1
parents:
diff changeset
1820 {
Ritor1
parents:
diff changeset
1821 dword_50B700 = 1;
Ritor1
parents:
diff changeset
1822 }
Ritor1
parents:
diff changeset
1823 else
Ritor1
parents:
diff changeset
1824 {
Ritor1
parents:
diff changeset
1825 dword_50B700 = 0;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
1826 if ( !v1->Portal() )
0
Ritor1
parents:
diff changeset
1827 return 0;
Ritor1
parents:
diff changeset
1828 }
Ritor1
parents:
diff changeset
1829 //v66 = v1->uNumVertices;
Ritor1
parents:
diff changeset
1830 for (uint i = 0; i < v1->uNumVertices; ++i)
Ritor1
parents:
diff changeset
1831 {
Ritor1
parents:
diff changeset
1832 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]];
Ritor1
parents:
diff changeset
1833 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
Ritor1
parents:
diff changeset
1834 v6->x,
Ritor1
parents:
diff changeset
1835 v6->y,
Ritor1
parents:
diff changeset
1836 v6->z,
Ritor1
parents:
diff changeset
1837 &_50B924_view_transformed_xs[i],
Ritor1
parents:
diff changeset
1838 &_50B834_view_transformed_zs[i],
Ritor1
parents:
diff changeset
1839 &_50B744_view_transformed_ys[i],
Ritor1
parents:
diff changeset
1840 0);
Ritor1
parents:
diff changeset
1841 }
Ritor1
parents:
diff changeset
1842
Ritor1
parents:
diff changeset
1843 //v7 = v1->uNumVertices;
Ritor1
parents:
diff changeset
1844 //v8 = 0;
Ritor1
parents:
diff changeset
1845 if (v1->uNumVertices <= 0)
Ritor1
parents:
diff changeset
1846 return 0;
Ritor1
parents:
diff changeset
1847
Ritor1
parents:
diff changeset
1848 bool bFound = false;
Ritor1
parents:
diff changeset
1849 for (uint i = 0; i < v1->uNumVertices; ++i)
Ritor1
parents:
diff changeset
1850 if (_50B924_view_transformed_xs[i] >= 0x80000u)
Ritor1
parents:
diff changeset
1851 {
Ritor1
parents:
diff changeset
1852 bFound = true;
Ritor1
parents:
diff changeset
1853 break;
Ritor1
parents:
diff changeset
1854 }
Ritor1
parents:
diff changeset
1855 if (!bFound)
Ritor1
parents:
diff changeset
1856 return 0;
Ritor1
parents:
diff changeset
1857
Ritor1
parents:
diff changeset
1858 v79 = 0;
Ritor1
parents:
diff changeset
1859 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0];
Ritor1
parents:
diff changeset
1860 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0];
Ritor1
parents:
diff changeset
1861 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0];
564
8b77231088d8 Moon Temple doesn't crash
Nomad
parents: 562
diff changeset
1862 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u;
0
Ritor1
parents:
diff changeset
1863 //int i = 1;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1864 for (uint i = 1; i <= v1->uNumVertices; ++i)
0
Ritor1
parents:
diff changeset
1865 {
Ritor1
parents:
diff changeset
1866 v10 = _50B924_view_transformed_xs[i];
Ritor1
parents:
diff changeset
1867 v81 = v10 >= (signed int)0x80000u;
Ritor1
parents:
diff changeset
1868 if ( thisa ^ v81 )
Ritor1
parents:
diff changeset
1869 {
Ritor1
parents:
diff changeset
1870 v11 = _50B924_view_transformed_xs[i - 1];
Ritor1
parents:
diff changeset
1871 if ( v10 >= (signed int)0x80000u )
Ritor1
parents:
diff changeset
1872 {
Ritor1
parents:
diff changeset
1873 v12 = v10 - v11;
Ritor1
parents:
diff changeset
1874 v13 = 0x80000 - v11;
Ritor1
parents:
diff changeset
1875 LODWORD(v14) = v13 << 16;
Ritor1
parents:
diff changeset
1876 HIDWORD(v14) = v13 >> 16;
Ritor1
parents:
diff changeset
1877 v15 = &_50B744_view_transformed_ys[i - 1];
486
Nomad
parents: 484
diff changeset
1878 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) * v14 / v12) >> 16) + _50B834_view_transformed_zs[i - 1];
0
Ritor1
parents:
diff changeset
1879 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16;
Ritor1
parents:
diff changeset
1880 }
Ritor1
parents:
diff changeset
1881 else
Ritor1
parents:
diff changeset
1882 {
Ritor1
parents:
diff changeset
1883 v16 = v11 - v10;
Ritor1
parents:
diff changeset
1884 v17 = 0x80000 - v10;
Ritor1
parents:
diff changeset
1885 LODWORD(v18) = v17 << 16;
Ritor1
parents:
diff changeset
1886 HIDWORD(v18) = v17 >> 16;
Ritor1
parents:
diff changeset
1887 v15 = &_50B744_view_transformed_ys[i];
108
2baff1256844 fix Benefits window
Ritor1
parents: 89
diff changeset
1888 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i - 1] - _50B834_view_transformed_zs[i]) * v18 / v16) >> 16) + _50B834_view_transformed_zs[i];
0
Ritor1
parents:
diff changeset
1889 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16;
Ritor1
parents:
diff changeset
1890 }
Ritor1
parents:
diff changeset
1891 v19 = v79++;
Ritor1
parents:
diff changeset
1892 //v7 = v66;
Ritor1
parents:
diff changeset
1893 dword_50B738[v19] = thisb + *v15;
Ritor1
parents:
diff changeset
1894 dword_50B918[v19] = 0x80000u;
Ritor1
parents:
diff changeset
1895 }
Ritor1
parents:
diff changeset
1896 if ( v81 )
Ritor1
parents:
diff changeset
1897 {
Ritor1
parents:
diff changeset
1898 v20 = v79++;
Ritor1
parents:
diff changeset
1899 dword_50B918[v20] = _50B924_view_transformed_xs[i];
Ritor1
parents:
diff changeset
1900 dword_50B828[v20] = _50B834_view_transformed_zs[i];
Ritor1
parents:
diff changeset
1901 dword_50B738[v20] = _50B744_view_transformed_ys[i];
Ritor1
parents:
diff changeset
1902 }
Ritor1
parents:
diff changeset
1903 //++i;
Ritor1
parents:
diff changeset
1904 thisa = v81;
Ritor1
parents:
diff changeset
1905 }
Ritor1
parents:
diff changeset
1906 v21 = v79;
Ritor1
parents:
diff changeset
1907 dword_50B918[v79] = dword_50B918[0];
Ritor1
parents:
diff changeset
1908 dword_50B828[v79] = dword_50B828[0];
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1909 dword_50B738[v79] = dword_50B738[0];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1910 for (ia = 0; ia < v79; ++ia)
0
Ritor1
parents:
diff changeset
1911 {
Ritor1
parents:
diff changeset
1912 v22 = ia;
Ritor1
parents:
diff changeset
1913 thisc = abs(dword_50B918[ia]);
Ritor1
parents:
diff changeset
1914 if ( abs(dword_50B828[ia]) >> 13 <= thisc )
Ritor1
parents:
diff changeset
1915 {
Ritor1
parents:
diff changeset
1916 v27 = dword_50B828[v22];
Ritor1
parents:
diff changeset
1917 LODWORD(v28) = v27 << 16;
Ritor1
parents:
diff changeset
1918 HIDWORD(v28) = v27 >> 16;
Ritor1
parents:
diff changeset
1919 v26 = v28 / dword_50B918[v22];
Ritor1
parents:
diff changeset
1920 v23 = 0;
Ritor1
parents:
diff changeset
1921 }
Ritor1
parents:
diff changeset
1922 else
Ritor1
parents:
diff changeset
1923 {
Ritor1
parents:
diff changeset
1924 v23 = 0;
Ritor1
parents:
diff changeset
1925 v24 = 0;
Ritor1
parents:
diff changeset
1926 if ( dword_50B828[v22] >= 0 )
Ritor1
parents:
diff changeset
1927 {
Ritor1
parents:
diff changeset
1928 LOBYTE(v24) = dword_50B918[v22] >= 0;
Ritor1
parents:
diff changeset
1929 v26 = ((v24 - 1) & 0xFF800000) + 0x400000;
Ritor1
parents:
diff changeset
1930 }
Ritor1
parents:
diff changeset
1931 else
Ritor1
parents:
diff changeset
1932 {
Ritor1
parents:
diff changeset
1933 LOBYTE(v24) = dword_50B918[v22] >= 0;
Ritor1
parents:
diff changeset
1934 v25 = v24 - 1;
Ritor1
parents:
diff changeset
1935 v26 = (v25 & 0x800000) - 0x400000;
Ritor1
parents:
diff changeset
1936 }
Ritor1
parents:
diff changeset
1937 }
Ritor1
parents:
diff changeset
1938 v29 = dword_50B738[v22];
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1939 dword_50BAF8_xs[v22] = v26;
0
Ritor1
parents:
diff changeset
1940 if ( abs(v29) >> 13 <= thisc )
Ritor1
parents:
diff changeset
1941 {
Ritor1
parents:
diff changeset
1942 v33 = dword_50B738[v22];
Ritor1
parents:
diff changeset
1943 LODWORD(v34) = v33 << 16;
Ritor1
parents:
diff changeset
1944 HIDWORD(v34) = v33 >> 16;
Ritor1
parents:
diff changeset
1945 v32 = v34 / dword_50B918[v22];
Ritor1
parents:
diff changeset
1946 }
Ritor1
parents:
diff changeset
1947 else
Ritor1
parents:
diff changeset
1948 {
Ritor1
parents:
diff changeset
1949 v30 = 0;
Ritor1
parents:
diff changeset
1950 if ( dword_50B738[v22] >= v23 )
Ritor1
parents:
diff changeset
1951 {
Ritor1
parents:
diff changeset
1952 LOBYTE(v30) = dword_50B918[v22] >= v23;
Ritor1
parents:
diff changeset
1953 v32 = ((v30 - 1) & 0xFF800000) + 0x400000;
Ritor1
parents:
diff changeset
1954 }
Ritor1
parents:
diff changeset
1955 else
Ritor1
parents:
diff changeset
1956 {
Ritor1
parents:
diff changeset
1957 LOBYTE(v30) = dword_50B918[v22] >= v23;
Ritor1
parents:
diff changeset
1958 v31 = v30 - 1;
Ritor1
parents:
diff changeset
1959 v32 = (v31 & 0x800000) - 0x400000;
Ritor1
parents:
diff changeset
1960 }
Ritor1
parents:
diff changeset
1961 }
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1962 dword_50BA08_ys[v22] = v32;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1963 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1964 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1965 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1966 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35;
0
Ritor1
parents:
diff changeset
1967 }
Ritor1
parents:
diff changeset
1968 v36 = 0;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1969 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1970 dword_50BA08_ys[v21] = dword_50BA08_ys[0];
0
Ritor1
parents:
diff changeset
1971 v37 = pBLVRenderParams->uViewportX;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1972 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1973 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX;
0
Ritor1
parents:
diff changeset
1974 v39 = 1;
Ritor1
parents:
diff changeset
1975 ib = 1;
Ritor1
parents:
diff changeset
1976 if ( v79 < 1 )
Ritor1
parents:
diff changeset
1977 return 0;
Ritor1
parents:
diff changeset
1978 do
Ritor1
parents:
diff changeset
1979 {
Ritor1
parents:
diff changeset
1980 v40 = v39;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1981 v41 = dword_50BAF8_xs[v40];
0
Ritor1
parents:
diff changeset
1982 v82 = v41 >= (signed int)v37;
Ritor1
parents:
diff changeset
1983 if ( v38 ^ v82 )
Ritor1
parents:
diff changeset
1984 {
Ritor1
parents:
diff changeset
1985 if ( v41 >= (signed int)v37 )
Ritor1
parents:
diff changeset
1986 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1987 v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1988 v42 = dword_50BA08_ys[v40 - 1];
0
Ritor1
parents:
diff changeset
1989 }
Ritor1
parents:
diff changeset
1990 else
Ritor1
parents:
diff changeset
1991 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1992 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1993 v42 = dword_50BA08_ys[v40];
0
Ritor1
parents:
diff changeset
1994 }
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1995 dword_50B9FC_ys[v36] = v67 + v42;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1996 v37 = pBLVRenderParams->uViewportX;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
1997 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX;
0
Ritor1
parents:
diff changeset
1998 ++v36;
Ritor1
parents:
diff changeset
1999 }
Ritor1
parents:
diff changeset
2000 v38 = v82;
Ritor1
parents:
diff changeset
2001 if ( v82 )
Ritor1
parents:
diff changeset
2002 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2003 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2004 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2005 ++v36;
0
Ritor1
parents:
diff changeset
2006 }
Ritor1
parents:
diff changeset
2007 v39 = ib++ + 1;
Ritor1
parents:
diff changeset
2008 }
Ritor1
parents:
diff changeset
2009 while ( ib <= v79 );
Ritor1
parents:
diff changeset
2010
486
Nomad
parents: 484
diff changeset
2011 if (v36 < 1)
0
Ritor1
parents:
diff changeset
2012 return 0;
Ritor1
parents:
diff changeset
2013
486
Nomad
parents: 484
diff changeset
2014 v43 = 0;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2015 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2016 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0];
486
Nomad
parents: 484
diff changeset
2017 v44 = pBLVRenderParams->uViewportZ;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2018 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ;
486
Nomad
parents: 484
diff changeset
2019 ic = 1;
Nomad
parents: 484
diff changeset
2020
0
Ritor1
parents:
diff changeset
2021 do
Ritor1
parents:
diff changeset
2022 {
Ritor1
parents:
diff changeset
2023 v45 = ic;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2024 v46 = dword_50BAEC_xs[ic];
0
Ritor1
parents:
diff changeset
2025 v83 = v46 <= (signed int)v44;
Ritor1
parents:
diff changeset
2026 if ( thisd ^ v83 )
Ritor1
parents:
diff changeset
2027 {
Ritor1
parents:
diff changeset
2028 if ( v46 <= (signed int)v44 )
Ritor1
parents:
diff changeset
2029 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2030 v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2031 v47 = dword_50B9FC_ys[v45 - 1];
0
Ritor1
parents:
diff changeset
2032 }
Ritor1
parents:
diff changeset
2033 else
Ritor1
parents:
diff changeset
2034 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2035 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2036 v47 = dword_50B9FC_ys[v45];
0
Ritor1
parents:
diff changeset
2037 }
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2038 dword_50B9F0[v43] = v68 + v47;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2039 v44 = pBLVRenderParams->uViewportZ;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2040 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ;
0
Ritor1
parents:
diff changeset
2041 ++v43;
Ritor1
parents:
diff changeset
2042 }
Ritor1
parents:
diff changeset
2043 if ( v83 )
Ritor1
parents:
diff changeset
2044 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2045 dword_50BAE0[v43] = dword_50BAEC_xs[v45];
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2046 dword_50B9F0[v43++] = dword_50B9FC_ys[v45];
0
Ritor1
parents:
diff changeset
2047 }
Ritor1
parents:
diff changeset
2048 ++ic;
Ritor1
parents:
diff changeset
2049 thisd = v83;
Ritor1
parents:
diff changeset
2050 }
Ritor1
parents:
diff changeset
2051 while ( ic <= v36 );
486
Nomad
parents: 484
diff changeset
2052
Nomad
parents: 484
diff changeset
2053 if (v43 < 1)
0
Ritor1
parents:
diff changeset
2054 return 0;
486
Nomad
parents: 484
diff changeset
2055
Nomad
parents: 484
diff changeset
2056 v48 = 0;
Nomad
parents: 484
diff changeset
2057 dword_50BAE0[v43] = dword_50BAE0[0];
Nomad
parents: 484
diff changeset
2058 dword_50B9F0[v43] = dword_50B9F0[0];
Nomad
parents: 484
diff changeset
2059 v49 = pBLVRenderParams->uViewportY;
Nomad
parents: 484
diff changeset
2060 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY;
Nomad
parents: 484
diff changeset
2061 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY;
Nomad
parents: 484
diff changeset
2062 v51 = 1;
Nomad
parents: 484
diff changeset
2063 id = 1;
0
Ritor1
parents:
diff changeset
2064 do
Ritor1
parents:
diff changeset
2065 {
Ritor1
parents:
diff changeset
2066 v52 = v51;
Ritor1
parents:
diff changeset
2067 v53 = dword_50B9F0[v52];
Ritor1
parents:
diff changeset
2068 v84 = v53 >= (signed int)v49;
Ritor1
parents:
diff changeset
2069 if ( v50 ^ v84 )
Ritor1
parents:
diff changeset
2070 {
Ritor1
parents:
diff changeset
2071 if ( v53 >= (signed int)v49 )
Ritor1
parents:
diff changeset
2072 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2073 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2074 v54 = dword_50BAE0[v52 - 1];
0
Ritor1
parents:
diff changeset
2075 }
Ritor1
parents:
diff changeset
2076 else
Ritor1
parents:
diff changeset
2077 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2078 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53);
0
Ritor1
parents:
diff changeset
2079 v54 = dword_50BAE0[v52];
Ritor1
parents:
diff changeset
2080 }
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2081 dword_50BAD4[v48] = v69 + v54;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2082 v49 = pBLVRenderParams->uViewportY;
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2083 dword_50B9E4[v48] = pBLVRenderParams->uViewportY;
0
Ritor1
parents:
diff changeset
2084 ++v48;
Ritor1
parents:
diff changeset
2085 }
Ritor1
parents:
diff changeset
2086 v50 = v84;
Ritor1
parents:
diff changeset
2087 if ( v84 )
Ritor1
parents:
diff changeset
2088 {
Ritor1
parents:
diff changeset
2089 dword_50BAD4[v48] = dword_50BAE0[v52];
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2090 dword_50B9E4[v48++] = dword_50B9F0[v52];
0
Ritor1
parents:
diff changeset
2091 }
Ritor1
parents:
diff changeset
2092 v51 = id++ + 1;
Ritor1
parents:
diff changeset
2093 }
Ritor1
parents:
diff changeset
2094 while ( id <= v43 );
486
Nomad
parents: 484
diff changeset
2095
Nomad
parents: 484
diff changeset
2096 if (v48 < 1)
0
Ritor1
parents:
diff changeset
2097 return 0;
486
Nomad
parents: 484
diff changeset
2098
Nomad
parents: 484
diff changeset
2099 v55 = 0;
Nomad
parents: 484
diff changeset
2100 dword_50BAD4[v48] = dword_50BAD4[0];
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2101 dword_50B9E4[v48] = dword_50B9E4[0];
486
Nomad
parents: 484
diff changeset
2102 v56 = pBLVRenderParams->uViewportW;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2103 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW;
486
Nomad
parents: 484
diff changeset
2104 ie = 1;
0
Ritor1
parents:
diff changeset
2105 do
Ritor1
parents:
diff changeset
2106 {
Ritor1
parents:
diff changeset
2107 v57 = ie;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2108 v58 = dword_50B9E4[ie];
0
Ritor1
parents:
diff changeset
2109 v85 = v58 <= (signed int)v56;
Ritor1
parents:
diff changeset
2110 if ( thise ^ v85 )
Ritor1
parents:
diff changeset
2111 {
Ritor1
parents:
diff changeset
2112 if ( v58 <= (signed int)v56 )
Ritor1
parents:
diff changeset
2113 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2114 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]);
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2115 v59 = dword_50BAD4[v57 - 1];
0
Ritor1
parents:
diff changeset
2116 }
Ritor1
parents:
diff changeset
2117 else
Ritor1
parents:
diff changeset
2118 {
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2119 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58);
0
Ritor1
parents:
diff changeset
2120 v59 = dword_50BAD4[v57];
Ritor1
parents:
diff changeset
2121 }
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2122 _50BAC8_screen_space_x[v55] = v70 + v59;
561
8b9cbf1f87fb Cave kinda works
Nomad
parents: 549
diff changeset
2123 v56 = pBLVRenderParams->uViewportW;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2124 _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW;
0
Ritor1
parents:
diff changeset
2125 ++v55;
Ritor1
parents:
diff changeset
2126 }
Ritor1
parents:
diff changeset
2127 if ( v85 )
Ritor1
parents:
diff changeset
2128 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2129 _50BAC8_screen_space_x[v55] = dword_50BAD4[v57];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2130 _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57];
0
Ritor1
parents:
diff changeset
2131 }
Ritor1
parents:
diff changeset
2132 ++ie;
Ritor1
parents:
diff changeset
2133 thise = v85;
Ritor1
parents:
diff changeset
2134 }
Ritor1
parents:
diff changeset
2135 while ( ie <= v48 );
486
Nomad
parents: 484
diff changeset
2136
0
Ritor1
parents:
diff changeset
2137 if ( !v55 )
Ritor1
parents:
diff changeset
2138 return 0;
Ritor1
parents:
diff changeset
2139 v61 = pRenderer->pRenderD3D == 0;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2140 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2141 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
0
Ritor1
parents:
diff changeset
2142 if ( v61 && v55 > 3 )
Ritor1
parents:
diff changeset
2143 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2144 _50BAC8_screen_space_x[v55 + 1] = _50BAC8_screen_space_x[1];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2145 _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1];
0
Ritor1
parents:
diff changeset
2146 thisf = 2 * (dword_50B700 != 0) - 1;
Ritor1
parents:
diff changeset
2147 if ( v55 > 0 )
Ritor1
parents:
diff changeset
2148 {
Ritor1
parents:
diff changeset
2149 v62 = 1;
Ritor1
parents:
diff changeset
2150 v71 = 1;
Ritor1
parents:
diff changeset
2151 do
Ritor1
parents:
diff changeset
2152 {
Ritor1
parents:
diff changeset
2153 v63 = v62 - 1;
Ritor1
parents:
diff changeset
2154 v64 = v62 + 1;
Ritor1
parents:
diff changeset
2155 v80 = v62 + 1;
Ritor1
parents:
diff changeset
2156 if ( v62 - 1 >= v55 )
Ritor1
parents:
diff changeset
2157 v63 -= v55;
Ritor1
parents:
diff changeset
2158 if ( v62 >= v55 )
Ritor1
parents:
diff changeset
2159 v62 -= v55;
Ritor1
parents:
diff changeset
2160 if ( v64 >= v55 )
Ritor1
parents:
diff changeset
2161 v64 -= v55;
Ritor1
parents:
diff changeset
2162 if ( thisf
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2163 * ((_50B9D8_screen_space_y[v64] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v62] - _50BAC8_screen_space_x[v63])
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2164 - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 )
0
Ritor1
parents:
diff changeset
2165 {
Ritor1
parents:
diff changeset
2166 v62 = v80;
Ritor1
parents:
diff changeset
2167 v71 = v80;
Ritor1
parents:
diff changeset
2168 }
Ritor1
parents:
diff changeset
2169 else
Ritor1
parents:
diff changeset
2170 {
Ritor1
parents:
diff changeset
2171 v62 = v71;
Ritor1
parents:
diff changeset
2172 v65 = v71;
Ritor1
parents:
diff changeset
2173 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) )
Ritor1
parents:
diff changeset
2174 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2175 memcpy(&_50B9D8_screen_space_y[v65], &_50B9D8_screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2176 memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
0
Ritor1
parents:
diff changeset
2177 }
Ritor1
parents:
diff changeset
2178 --v55;
Ritor1
parents:
diff changeset
2179 }
Ritor1
parents:
diff changeset
2180 }
Ritor1
parents:
diff changeset
2181 while ( v62 - 1 < v55 );
Ritor1
parents:
diff changeset
2182 }
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2183 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2184 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
0
Ritor1
parents:
diff changeset
2185 }
Ritor1
parents:
diff changeset
2186 return v55;
Ritor1
parents:
diff changeset
2187 }
Ritor1
parents:
diff changeset
2188
Ritor1
parents:
diff changeset
2189 //----- (00424579) --------------------------------------------------------
Ritor1
parents:
diff changeset
2190 int __fastcall sub_424579(int uFaceID, stru320 *a2)
Ritor1
parents:
diff changeset
2191 {
Ritor1
parents:
diff changeset
2192 __debugbreak();
Ritor1
parents:
diff changeset
2193 return 0;
Ritor1
parents:
diff changeset
2194 /*BLVFace *v2; // eax@1
Ritor1
parents:
diff changeset
2195 Vec3_short_ *v3; // ebx@1
Ritor1
parents:
diff changeset
2196 Vec3_short_ *v4; // esi@1
Ritor1
parents:
diff changeset
2197 unsigned int v5; // esi@3
Ritor1
parents:
diff changeset
2198 int v7; // ST1C_4@5
Ritor1
parents:
diff changeset
2199 int v8; // ST1C_4@5
Ritor1
parents:
diff changeset
2200 int v9; // ST1C_4@5
Ritor1
parents:
diff changeset
2201 int v10; // ST1C_4@5
Ritor1
parents:
diff changeset
2202 int v11; // esi@5
Ritor1
parents:
diff changeset
2203 int v12; // ST1C_4@5
Ritor1
parents:
diff changeset
2204 unsigned int v15; // ecx@8
Ritor1
parents:
diff changeset
2205 unsigned int v19; // ecx@13
Ritor1
parents:
diff changeset
2206 signed int v20; // ecx@16
Ritor1
parents:
diff changeset
2207 signed int result; // eax@20
Ritor1
parents:
diff changeset
2208 signed int v24; // edx@22
Ritor1
parents:
diff changeset
2209 unsigned int v25; // [sp+Ch] [bp-1Ch]@3
Ritor1
parents:
diff changeset
2210 float v26; // [sp+14h] [bp-14h]@3
Ritor1
parents:
diff changeset
2211 float v27; // [sp+1Ch] [bp-Ch]@3
Ritor1
parents:
diff changeset
2212 float v28; // [sp+20h] [bp-8h]@3
Ritor1
parents:
diff changeset
2213 signed int v29; // [sp+24h] [bp-4h]@3
Ritor1
parents:
diff changeset
2214
Ritor1
parents:
diff changeset
2215 v2 = &pIndoor->pFaces[uFaceID];
Ritor1
parents:
diff changeset
2216 v3 = pIndoor->pVertices;
Ritor1
parents:
diff changeset
2217 v4 = &pIndoor->pVertices[*v2->pVertexIDs];
Ritor1
parents:
diff changeset
2218 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x)
Ritor1
parents:
diff changeset
2219 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y)
Ritor1
parents:
diff changeset
2220 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 )
Ritor1
parents:
diff changeset
2221 {
Ritor1
parents:
diff changeset
2222 dword_50B700 = 1;
Ritor1
parents:
diff changeset
2223 }
Ritor1
parents:
diff changeset
2224 else
Ritor1
parents:
diff changeset
2225 {
Ritor1
parents:
diff changeset
2226 dword_50B700 = 0;
Ritor1
parents:
diff changeset
2227 if ( !(v2->uAttributes & 1) )
Ritor1
parents:
diff changeset
2228 return 0;
Ritor1
parents:
diff changeset
2229 }
Ritor1
parents:
diff changeset
2230 v29 = 0;
Ritor1
parents:
diff changeset
2231 v5 = v2->uNumVertices;
Ritor1
parents:
diff changeset
2232 __asm { fld pBLVRenderParams->fCosineY }
Ritor1
parents:
diff changeset
2233 v28 = pBLVRenderParams->fSineY;
Ritor1
parents:
diff changeset
2234 v26 = pBLVRenderParams->fCosineNegX;
Ritor1
parents:
diff changeset
2235 v27 = pBLVRenderParams->fSineNegX;
Ritor1
parents:
diff changeset
2236 v25 = v5;
Ritor1
parents:
diff changeset
2237 if ( (signed int)v5 > 0 )
Ritor1
parents:
diff changeset
2238 {
Ritor1
parents:
diff changeset
2239 _ECX = (char *)&array_50AC10[0].vWorldPosition.z;
Ritor1
parents:
diff changeset
2240 do
Ritor1
parents:
diff changeset
2241 {
Ritor1
parents:
diff changeset
2242 v7 = v3[v2->pVertexIDs[v29]].x;
Ritor1
parents:
diff changeset
2243 __asm
Ritor1
parents:
diff changeset
2244 {
Ritor1
parents:
diff changeset
2245 fild [ebp+var_10]
Ritor1
parents:
diff changeset
2246 fstp dword ptr [ecx-8]
Ritor1
parents:
diff changeset
2247 }
Ritor1
parents:
diff changeset
2248 v8 = v3[v2->pVertexIDs[v29]].y;
Ritor1
parents:
diff changeset
2249 __asm
Ritor1
parents:
diff changeset
2250 {
Ritor1
parents:
diff changeset
2251 fild [ebp+var_10]
Ritor1
parents:
diff changeset
2252 fstp dword ptr [ecx-4]
Ritor1
parents:
diff changeset
2253 }
Ritor1
parents:
diff changeset
2254 v9 = v3[v2->pVertexIDs[v29]].z;
Ritor1
parents:
diff changeset
2255 __asm
Ritor1
parents:
diff changeset
2256 {
Ritor1
parents:
diff changeset
2257 fild [ebp+var_10]
Ritor1
parents:
diff changeset
2258 fstp dword ptr [ecx]
Ritor1
parents:
diff changeset
2259 }
Ritor1
parents:
diff changeset
2260 _ECX += 48;
Ritor1
parents:
diff changeset
2261 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29];
Ritor1
parents:
diff changeset
2262 __asm
Ritor1
parents:
diff changeset
2263 {
Ritor1
parents:
diff changeset
2264 fild [ebp+var_10]
Ritor1
parents:
diff changeset
2265 fstp dword ptr [ecx-14h]
Ritor1
parents:
diff changeset
2266 }
Ritor1
parents:
diff changeset
2267 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++];
Ritor1
parents:
diff changeset
2268 v12 = v11;
Ritor1
parents:
diff changeset
2269 v5 = v25;
Ritor1
parents:
diff changeset
2270 __asm
Ritor1
parents:
diff changeset
2271 {
Ritor1
parents:
diff changeset
2272 fild [ebp+var_10]
Ritor1
parents:
diff changeset
2273 fstp dword ptr [ecx-10h]
Ritor1
parents:
diff changeset
2274 }
Ritor1
parents:
diff changeset
2275 }
Ritor1
parents:
diff changeset
2276 while ( v29 < (signed int)v25 );
Ritor1
parents:
diff changeset
2277 }
Ritor1
parents:
diff changeset
2278 _EDX = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
2279 if ( pBLVRenderParams->sPartyRotX )
Ritor1
parents:
diff changeset
2280 {
Ritor1
parents:
diff changeset
2281 if ( (signed int)v5 > 0 )
Ritor1
parents:
diff changeset
2282 {
Ritor1
parents:
diff changeset
2283 __asm
Ritor1
parents:
diff changeset
2284 {
Ritor1
parents:
diff changeset
2285 fild pBLVRenderParams->vPartyPos.x
Ritor1
parents:
diff changeset
2286 fild pBLVRenderParams->vPartyPos.y
Ritor1
parents:
diff changeset
2287 fild pBLVRenderParams->vPartyPos.z
Ritor1
parents:
diff changeset
2288 }
Ritor1
parents:
diff changeset
2289 _EAX = (char *)&array_50AC10[0].vWorldPosition.z;
Ritor1
parents:
diff changeset
2290 v15 = v5;
Ritor1
parents:
diff changeset
2291 do
Ritor1
parents:
diff changeset
2292 {
Ritor1
parents:
diff changeset
2293 __asm
Ritor1
parents:
diff changeset
2294 {
Ritor1
parents:
diff changeset
2295 fld dword ptr [eax-8]
Ritor1
parents:
diff changeset
2296 fsub st, st(3)
Ritor1
parents:
diff changeset
2297 fld dword ptr [eax-4]
Ritor1
parents:
diff changeset
2298 fsub st, st(3)
Ritor1
parents:
diff changeset
2299 fld st(1)
Ritor1
parents:
diff changeset
2300 fmul st, st(6)
Ritor1
parents:
diff changeset
2301 fld st(1)
Ritor1
parents:
diff changeset
2302 fmul [ebp+var_8]
Ritor1
parents:
diff changeset
2303 fsubp st(1), st
Ritor1
parents:
diff changeset
2304 fstp [ebp+var_4]
Ritor1
parents:
diff changeset
2305 fld dword ptr [eax]
Ritor1
parents:
diff changeset
2306 fsub st, st(3)
Ritor1
parents:
diff changeset
2307 }
Ritor1
parents:
diff changeset
2308 _EAX += 48;
Ritor1
parents:
diff changeset
2309 --v15;
Ritor1
parents:
diff changeset
2310 __asm
Ritor1
parents:
diff changeset
2311 {
Ritor1
parents:
diff changeset
2312 fstp [ebp+var_10]
Ritor1
parents:
diff changeset
2313 fld [ebp+var_4]
Ritor1
parents:
diff changeset
2314 fmul [ebp+var_14]
Ritor1
parents:
diff changeset
2315 fld [ebp+var_10]
Ritor1
parents:
diff changeset
2316 fmul [ebp+var_C]
Ritor1
parents:
diff changeset
2317 fsubp st(1), st
Ritor1
parents:
diff changeset
2318 fstp dword ptr [eax-2Ch]
Ritor1
parents:
diff changeset
2319 fld st(1)
Ritor1
parents:
diff changeset
2320 fmul [ebp+var_8]
Ritor1
parents:
diff changeset
2321 fld st(1)
Ritor1
parents:
diff changeset
2322 fmul st, st(7)
Ritor1
parents:
diff changeset
2323 faddp st(1), st
Ritor1
parents:
diff changeset
2324 fstp dword ptr [eax-28h]
Ritor1
parents:
diff changeset
2325 fstp st
Ritor1
parents:
diff changeset
2326 fstp st
Ritor1
parents:
diff changeset
2327 fld [ebp+var_4]
Ritor1
parents:
diff changeset
2328 fmul [ebp+var_C]
Ritor1
parents:
diff changeset
2329 fld [ebp+var_10]
Ritor1
parents:
diff changeset
2330 fmul [ebp+var_14]
Ritor1
parents:
diff changeset
2331 faddp st(1), st
Ritor1
parents:
diff changeset
2332 fstp dword ptr [eax-24h]
Ritor1
parents:
diff changeset
2333 }
Ritor1
parents:
diff changeset
2334 }
Ritor1
parents:
diff changeset
2335 while ( v15 );
Ritor1
parents:
diff changeset
2336 LABEL_15:
Ritor1
parents:
diff changeset
2337 __asm
Ritor1
parents:
diff changeset
2338 {
Ritor1
parents:
diff changeset
2339 fstp st
Ritor1
parents:
diff changeset
2340 fstp st
Ritor1
parents:
diff changeset
2341 fstp st
Ritor1
parents:
diff changeset
2342 }
Ritor1
parents:
diff changeset
2343 goto LABEL_16;
Ritor1
parents:
diff changeset
2344 }
Ritor1
parents:
diff changeset
2345 }
Ritor1
parents:
diff changeset
2346 else
Ritor1
parents:
diff changeset
2347 {
Ritor1
parents:
diff changeset
2348 if ( (signed int)v5 > 0 )
Ritor1
parents:
diff changeset
2349 {
Ritor1
parents:
diff changeset
2350 __asm
Ritor1
parents:
diff changeset
2351 {
Ritor1
parents:
diff changeset
2352 fild pBLVRenderParams->vPartyPos.x
Ritor1
parents:
diff changeset
2353 fild pBLVRenderParams->vPartyPos.y
Ritor1
parents:
diff changeset
2354 fild pBLVRenderParams->vPartyPos.z
Ritor1
parents:
diff changeset
2355 }
Ritor1
parents:
diff changeset
2356 _EAX = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
2357 v19 = v5;
Ritor1
parents:
diff changeset
2358 do
Ritor1
parents:
diff changeset
2359 {
Ritor1
parents:
diff changeset
2360 __asm
Ritor1
parents:
diff changeset
2361 {
Ritor1
parents:
diff changeset
2362 fld dword ptr [eax-0Ch]
Ritor1
parents:
diff changeset
2363 fsub st, st(3)
Ritor1
parents:
diff changeset
2364 fld dword ptr [eax-8]
Ritor1
parents:
diff changeset
2365 fsub st, st(3)
Ritor1
parents:
diff changeset
2366 fld st(1)
Ritor1
parents:
diff changeset
2367 fmul st, st(6)
Ritor1
parents:
diff changeset
2368 fld st(1)
Ritor1
parents:
diff changeset
2369 fmul [ebp+var_8]
Ritor1
parents:
diff changeset
2370 fsubp st(1), st
Ritor1
parents:
diff changeset
2371 fstp dword ptr [eax]
Ritor1
parents:
diff changeset
2372 fld st(1)
Ritor1
parents:
diff changeset
2373 fmul [ebp+var_8]
Ritor1
parents:
diff changeset
2374 fld st(1)
Ritor1
parents:
diff changeset
2375 fmul st, st(7)
Ritor1
parents:
diff changeset
2376 }
Ritor1
parents:
diff changeset
2377 _EAX += 48;
Ritor1
parents:
diff changeset
2378 --v19;
Ritor1
parents:
diff changeset
2379 __asm
Ritor1
parents:
diff changeset
2380 {
Ritor1
parents:
diff changeset
2381 faddp st(1), st
Ritor1
parents:
diff changeset
2382 fstp dword ptr [eax-2Ch]
Ritor1
parents:
diff changeset
2383 fstp st
Ritor1
parents:
diff changeset
2384 fstp st
Ritor1
parents:
diff changeset
2385 fld dword ptr [eax-34h]
Ritor1
parents:
diff changeset
2386 fsub st, st(1)
Ritor1
parents:
diff changeset
2387 fstp dword ptr [eax-28h]
Ritor1
parents:
diff changeset
2388 }
Ritor1
parents:
diff changeset
2389 }
Ritor1
parents:
diff changeset
2390 while ( v19 );
Ritor1
parents:
diff changeset
2391 goto LABEL_15;
Ritor1
parents:
diff changeset
2392 }
Ritor1
parents:
diff changeset
2393 }
Ritor1
parents:
diff changeset
2394 LABEL_16:
Ritor1
parents:
diff changeset
2395 v20 = 0;
Ritor1
parents:
diff changeset
2396 __asm { fstp st }
Ritor1
parents:
diff changeset
2397 if ( (signed int)v5 <= 0 )
Ritor1
parents:
diff changeset
2398 return 0;
Ritor1
parents:
diff changeset
2399 do
Ritor1
parents:
diff changeset
2400 {
Ritor1
parents:
diff changeset
2401 __asm
Ritor1
parents:
diff changeset
2402 {
Ritor1
parents:
diff changeset
2403 fld dword ptr [edx]
Ritor1
parents:
diff changeset
2404 fcomp ds:flt_4D8524
Ritor1
parents:
diff changeset
2405 fnstsw ax
Ritor1
parents:
diff changeset
2406 }
Ritor1
parents:
diff changeset
2407 if ( !(HIBYTE(_AX) & 1) )
Ritor1
parents:
diff changeset
2408 break;
Ritor1
parents:
diff changeset
2409 ++v20;
Ritor1
parents:
diff changeset
2410 _EDX += 48;
Ritor1
parents:
diff changeset
2411 }
Ritor1
parents:
diff changeset
2412 while ( v20 < (signed int)v5 );
Ritor1
parents:
diff changeset
2413 if ( v20 >= (signed int)v5 )
Ritor1
parents:
diff changeset
2414 return 0;
Ritor1
parents:
diff changeset
2415 result = sr_424CD7(v5);
Ritor1
parents:
diff changeset
2416 if ( result > 0 )
Ritor1
parents:
diff changeset
2417 {
Ritor1
parents:
diff changeset
2418 __asm { fild pBLVRenderParams->field_40 }
Ritor1
parents:
diff changeset
2419 _ECX = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
2420 v24 = result;
Ritor1
parents:
diff changeset
2421 __asm
Ritor1
parents:
diff changeset
2422 {
Ritor1
parents:
diff changeset
2423 fmul ds:flt_4D84A4
Ritor1
parents:
diff changeset
2424 fild pBLVRenderParams->uViewportCenterX
Ritor1
parents:
diff changeset
2425 fild pBLVRenderParams->uViewportCenterY
Ritor1
parents:
diff changeset
2426 }
Ritor1
parents:
diff changeset
2427 do
Ritor1
parents:
diff changeset
2428 {
Ritor1
parents:
diff changeset
2429 __asm
Ritor1
parents:
diff changeset
2430 {
Ritor1
parents:
diff changeset
2431 fld1
Ritor1
parents:
diff changeset
2432 fdiv dword ptr [ecx]
Ritor1
parents:
diff changeset
2433 }
Ritor1
parents:
diff changeset
2434 _ECX += 48;
Ritor1
parents:
diff changeset
2435 --v24;
Ritor1
parents:
diff changeset
2436 __asm
Ritor1
parents:
diff changeset
2437 {
Ritor1
parents:
diff changeset
2438 fld st
Ritor1
parents:
diff changeset
2439 fmul dword ptr [ecx-2Ch]
Ritor1
parents:
diff changeset
2440 fmul st, st(4)
Ritor1
parents:
diff changeset
2441 fsubr st, st(3)
Ritor1
parents:
diff changeset
2442 fstp dword ptr [ecx-24h]
Ritor1
parents:
diff changeset
2443 fmul dword ptr [ecx-28h]
Ritor1
parents:
diff changeset
2444 fmul st, st(3)
Ritor1
parents:
diff changeset
2445 fsubr st, st(1)
Ritor1
parents:
diff changeset
2446 fstp dword ptr [ecx-20h]
Ritor1
parents:
diff changeset
2447 }
Ritor1
parents:
diff changeset
2448 }
Ritor1
parents:
diff changeset
2449 while ( v24 );
Ritor1
parents:
diff changeset
2450 __asm
Ritor1
parents:
diff changeset
2451 {
Ritor1
parents:
diff changeset
2452 fstp st
Ritor1
parents:
diff changeset
2453 fstp st
Ritor1
parents:
diff changeset
2454 fstp st
Ritor1
parents:
diff changeset
2455 }
Ritor1
parents:
diff changeset
2456 }
Ritor1
parents:
diff changeset
2457 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result]));
Ritor1
parents:
diff changeset
2458 return result;*/
Ritor1
parents:
diff changeset
2459 }
Ritor1
parents:
diff changeset
2460
Ritor1
parents:
diff changeset
2461
Ritor1
parents:
diff changeset
2462 //----- (00424829) --------------------------------------------------------
Ritor1
parents:
diff changeset
2463 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4)
Ritor1
parents:
diff changeset
2464 {
Ritor1
parents:
diff changeset
2465 int v4; // edi@1
Ritor1
parents:
diff changeset
2466 BspRenderer_stru2 *v5; // ebx@1
Ritor1
parents:
diff changeset
2467 int v6; // eax@3
Ritor1
parents:
diff changeset
2468 int v7; // esi@5
Ritor1
parents:
diff changeset
2469 int v8; // edx@5
Ritor1
parents:
diff changeset
2470 int v9; // ecx@6
Ritor1
parents:
diff changeset
2471 int v10; // eax@12
Ritor1
parents:
diff changeset
2472 int v11; // edi@13
Ritor1
parents:
diff changeset
2473 int v12; // edx@18
Ritor1
parents:
diff changeset
2474 int v13; // eax@22
Ritor1
parents:
diff changeset
2475 int v14; // edi@28
Ritor1
parents:
diff changeset
2476 int v15; // ecx@29
Ritor1
parents:
diff changeset
2477 int v16; // edi@30
Ritor1
parents:
diff changeset
2478 int v17; // edx@35
Ritor1
parents:
diff changeset
2479 int v18; // eax@39
Ritor1
parents:
diff changeset
2480 int v19; // eax@44
Ritor1
parents:
diff changeset
2481 int v20; // ecx@44
Ritor1
parents:
diff changeset
2482 int v21; // edi@45
Ritor1
parents:
diff changeset
2483 int v22; // edi@46
Ritor1
parents:
diff changeset
2484 __int16 *v23; // ecx@47
Ritor1
parents:
diff changeset
2485 int v24; // edx@48
Ritor1
parents:
diff changeset
2486 int v25; // eax@50
Ritor1
parents:
diff changeset
2487 int v26; // eax@55
Ritor1
parents:
diff changeset
2488 signed int v27; // edi@55
Ritor1
parents:
diff changeset
2489 int v28; // edx@56
Ritor1
parents:
diff changeset
2490 int v29; // edx@57
Ritor1
parents:
diff changeset
2491 int v30; // eax@59
Ritor1
parents:
diff changeset
2492 int v31; // eax@64
Ritor1
parents:
diff changeset
2493 signed int v32; // edi@64
Ritor1
parents:
diff changeset
2494 int v33; // edx@65
Ritor1
parents:
diff changeset
2495 __int16 *v34; // eax@66
Ritor1
parents:
diff changeset
2496 __int16 v35; // dx@66
Ritor1
parents:
diff changeset
2497 __int16 v36; // dx@67
Ritor1
parents:
diff changeset
2498 __int16 v37; // di@67
Ritor1
parents:
diff changeset
2499 __int16 v38; // dx@67
Ritor1
parents:
diff changeset
2500 BspRenderer_stru2 *v39; // ecx@69
Ritor1
parents:
diff changeset
2501 int v40; // edx@69
Ritor1
parents:
diff changeset
2502 int v41; // edi@70
Ritor1
parents:
diff changeset
2503 __int16 *v42; // eax@76
Ritor1
parents:
diff changeset
2504 __int16 *v43; // eax@81
Ritor1
parents:
diff changeset
2505 __int16 *v45; // eax@87
Ritor1
parents:
diff changeset
2506 int v46; // edx@87
Ritor1
parents:
diff changeset
2507 __int16 v47; // cx@88
Ritor1
parents:
diff changeset
2508 int v48; // eax@93
Ritor1
parents:
diff changeset
2509 int v49; // esi@93
Ritor1
parents:
diff changeset
2510 __int16 *v50; // ecx@94
Ritor1
parents:
diff changeset
2511 int v51; // eax@95
Ritor1
parents:
diff changeset
2512 int v52; // eax@97
Ritor1
parents:
diff changeset
2513 int v53; // [sp+Ch] [bp-34h]@44
Ritor1
parents:
diff changeset
2514 int v54; // [sp+10h] [bp-30h]@0
Ritor1
parents:
diff changeset
2515 int v55; // [sp+14h] [bp-2Ch]@12
Ritor1
parents:
diff changeset
2516 __int16 *v56; // [sp+14h] [bp-2Ch]@47
Ritor1
parents:
diff changeset
2517 __int16 *v57; // [sp+14h] [bp-2Ch]@76
Ritor1
parents:
diff changeset
2518 __int16 *v58; // [sp+14h] [bp-2Ch]@81
Ritor1
parents:
diff changeset
2519 __int16 *v59; // [sp+14h] [bp-2Ch]@87
Ritor1
parents:
diff changeset
2520 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1
Ritor1
parents:
diff changeset
2521 int v61; // [sp+1Ch] [bp-24h]@29
Ritor1
parents:
diff changeset
2522 int v62; // [sp+20h] [bp-20h]@0
Ritor1
parents:
diff changeset
2523 signed int v63; // [sp+24h] [bp-1Ch]@3
Ritor1
parents:
diff changeset
2524 signed int v64; // [sp+28h] [bp-18h]@3
Ritor1
parents:
diff changeset
2525 int v65; // [sp+2Ch] [bp-14h]@5
Ritor1
parents:
diff changeset
2526 int v66; // [sp+2Ch] [bp-14h]@39
Ritor1
parents:
diff changeset
2527 int v67; // [sp+30h] [bp-10h]@22
Ritor1
parents:
diff changeset
2528 int v68; // [sp+34h] [bp-Ch]@12
Ritor1
parents:
diff changeset
2529 int v69; // [sp+34h] [bp-Ch]@29
Ritor1
parents:
diff changeset
2530 int v70; // [sp+34h] [bp-Ch]@46
Ritor1
parents:
diff changeset
2531 int v71; // [sp+34h] [bp-Ch]@75
Ritor1
parents:
diff changeset
2532 int v72; // [sp+34h] [bp-Ch]@80
Ritor1
parents:
diff changeset
2533 int v73; // [sp+38h] [bp-8h]@11
Ritor1
parents:
diff changeset
2534 int v74; // [sp+3Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
2535 int a3a; // [sp+48h] [bp+8h]@76
Ritor1
parents:
diff changeset
2536 int a3b; // [sp+48h] [bp+8h]@87
Ritor1
parents:
diff changeset
2537
Ritor1
parents:
diff changeset
2538 v4 = a1;
Ritor1
parents:
diff changeset
2539 v5 = a2;
Ritor1
parents:
diff changeset
2540 v74 = a1;
Ritor1
parents:
diff changeset
2541 v60 = a2;
Ritor1
parents:
diff changeset
2542 if ( !a1
Ritor1
parents:
diff changeset
2543 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1),
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2544 v7 = _50B9D8_screen_space_y[0],
0
Ritor1
parents:
diff changeset
2545 v65 = 0,
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2546 v8 = _50B9D8_screen_space_y[0],
0
Ritor1
parents:
diff changeset
2547 a1 <= v6) )
Ritor1
parents:
diff changeset
2548 return 0;
Ritor1
parents:
diff changeset
2549 do
Ritor1
parents:
diff changeset
2550 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2551 v9 = _50B9D8_screen_space_y[v6];
0
Ritor1
parents:
diff changeset
2552 if ( v9 >= v7 )
Ritor1
parents:
diff changeset
2553 {
Ritor1
parents:
diff changeset
2554 if ( v9 > v8 )
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2555 v8 = _50B9D8_screen_space_y[v6];
0
Ritor1
parents:
diff changeset
2556 }
Ritor1
parents:
diff changeset
2557 else
Ritor1
parents:
diff changeset
2558 {
Ritor1
parents:
diff changeset
2559 v65 = v6;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2560 v7 = _50B9D8_screen_space_y[v6];
0
Ritor1
parents:
diff changeset
2561 }
Ritor1
parents:
diff changeset
2562 ++v6;
Ritor1
parents:
diff changeset
2563 }
Ritor1
parents:
diff changeset
2564 while ( v6 < v4 );
Ritor1
parents:
diff changeset
2565 v73 = v8;
Ritor1
parents:
diff changeset
2566 if ( v8 == v7 )
Ritor1
parents:
diff changeset
2567 return 0;
Ritor1
parents:
diff changeset
2568 v10 = v65;
Ritor1
parents:
diff changeset
2569 v68 = 0;
Ritor1
parents:
diff changeset
2570 v5->_viewport_space_y = v7;
Ritor1
parents:
diff changeset
2571 v5->_viewport_space_w = v8;
Ritor1
parents:
diff changeset
2572 v55 = v65;
Ritor1
parents:
diff changeset
2573 if ( v4 > 0 )
Ritor1
parents:
diff changeset
2574 {
Ritor1
parents:
diff changeset
2575 v11 = v65;
Ritor1
parents:
diff changeset
2576 do
Ritor1
parents:
diff changeset
2577 {
Ritor1
parents:
diff changeset
2578 v10 += v64;
Ritor1
parents:
diff changeset
2579 if ( v10 < v74 )
Ritor1
parents:
diff changeset
2580 {
Ritor1
parents:
diff changeset
2581 if ( v10 < 0 )
Ritor1
parents:
diff changeset
2582 v10 += v74;
Ritor1
parents:
diff changeset
2583 }
Ritor1
parents:
diff changeset
2584 else
Ritor1
parents:
diff changeset
2585 {
Ritor1
parents:
diff changeset
2586 v10 -= v74;
Ritor1
parents:
diff changeset
2587 }
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2588 v12 = _50B9D8_screen_space_y[v10];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2589 if ( v12 <= _50B9D8_screen_space_y[v11] )
0
Ritor1
parents:
diff changeset
2590 {
Ritor1
parents:
diff changeset
2591 v55 = v10;
Ritor1
parents:
diff changeset
2592 v11 = v10;
Ritor1
parents:
diff changeset
2593 }
Ritor1
parents:
diff changeset
2594 if ( v12 == v73 )
Ritor1
parents:
diff changeset
2595 break;
Ritor1
parents:
diff changeset
2596 ++v68;
Ritor1
parents:
diff changeset
2597 }
Ritor1
parents:
diff changeset
2598 while ( v68 < v74 );
Ritor1
parents:
diff changeset
2599 }
Ritor1
parents:
diff changeset
2600 v13 = v55 + v64;
Ritor1
parents:
diff changeset
2601 v67 = v55 + v64;
Ritor1
parents:
diff changeset
2602 if ( v55 + v64 < v74 )
Ritor1
parents:
diff changeset
2603 {
Ritor1
parents:
diff changeset
2604 if ( v13 >= 0 )
Ritor1
parents:
diff changeset
2605 goto LABEL_27;
Ritor1
parents:
diff changeset
2606 v13 += v74;
Ritor1
parents:
diff changeset
2607 }
Ritor1
parents:
diff changeset
2608 else
Ritor1
parents:
diff changeset
2609 {
Ritor1
parents:
diff changeset
2610 v13 -= v74;
Ritor1
parents:
diff changeset
2611 }
Ritor1
parents:
diff changeset
2612 v67 = v13;
Ritor1
parents:
diff changeset
2613 LABEL_27:
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2614 if ( _50B9D8_screen_space_y[v13] != _50B9D8_screen_space_y[v55] )
0
Ritor1
parents:
diff changeset
2615 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2616 v14 = _50BAC8_screen_space_x[v55];
0
Ritor1
parents:
diff changeset
2617 v62 = v14 << 16;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2618 v54 = ((_50BAC8_screen_space_x[v13] - v14) << 16) / (_50B9D8_screen_space_y[v13] - _50B9D8_screen_space_y[v55]);
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2619 v5->array_18[v7] = LOWORD(_50BAC8_screen_space_x[v55]);
0
Ritor1
parents:
diff changeset
2620 }
Ritor1
parents:
diff changeset
2621 v15 = v65;
Ritor1
parents:
diff changeset
2622 v69 = 0;
Ritor1
parents:
diff changeset
2623 v61 = v65;
Ritor1
parents:
diff changeset
2624 if ( v74 > 0 )
Ritor1
parents:
diff changeset
2625 {
Ritor1
parents:
diff changeset
2626 v16 = v65;
Ritor1
parents:
diff changeset
2627 do
Ritor1
parents:
diff changeset
2628 {
Ritor1
parents:
diff changeset
2629 v15 += v63;
Ritor1
parents:
diff changeset
2630 if ( v15 < v74 )
Ritor1
parents:
diff changeset
2631 {
Ritor1
parents:
diff changeset
2632 if ( v15 < 0 )
Ritor1
parents:
diff changeset
2633 v15 += v74;
Ritor1
parents:
diff changeset
2634 }
Ritor1
parents:
diff changeset
2635 else
Ritor1
parents:
diff changeset
2636 {
Ritor1
parents:
diff changeset
2637 v15 -= v74;
Ritor1
parents:
diff changeset
2638 }
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2639 v17 = _50B9D8_screen_space_y[v15];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2640 if ( v17 <= _50B9D8_screen_space_y[v16] )
0
Ritor1
parents:
diff changeset
2641 {
Ritor1
parents:
diff changeset
2642 v61 = v15;
Ritor1
parents:
diff changeset
2643 v16 = v15;
Ritor1
parents:
diff changeset
2644 }
Ritor1
parents:
diff changeset
2645 if ( v17 == v73 )
Ritor1
parents:
diff changeset
2646 break;
Ritor1
parents:
diff changeset
2647 ++v69;
Ritor1
parents:
diff changeset
2648 }
Ritor1
parents:
diff changeset
2649 while ( v69 < v74 );
Ritor1
parents:
diff changeset
2650 }
Ritor1
parents:
diff changeset
2651 v18 = v63 + v61;
Ritor1
parents:
diff changeset
2652 v66 = v63 + v61;
Ritor1
parents:
diff changeset
2653 if ( v63 + v61 < v74 )
Ritor1
parents:
diff changeset
2654 {
Ritor1
parents:
diff changeset
2655 if ( v18 >= 0 )
Ritor1
parents:
diff changeset
2656 goto LABEL_44;
Ritor1
parents:
diff changeset
2657 v18 += v74;
Ritor1
parents:
diff changeset
2658 }
Ritor1
parents:
diff changeset
2659 else
Ritor1
parents:
diff changeset
2660 {
Ritor1
parents:
diff changeset
2661 v18 -= v74;
Ritor1
parents:
diff changeset
2662 }
Ritor1
parents:
diff changeset
2663 v66 = v18;
Ritor1
parents:
diff changeset
2664 LABEL_44:
Ritor1
parents:
diff changeset
2665 v19 = v18;
Ritor1
parents:
diff changeset
2666 v20 = v61;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2667 v53 = _50B9D8_screen_space_y[v19] - _50B9D8_screen_space_y[v61];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2668 if ( _50B9D8_screen_space_y[v19] != _50B9D8_screen_space_y[v61] )
0
Ritor1
parents:
diff changeset
2669 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2670 v21 = _50BAC8_screen_space_x[v20];
0
Ritor1
parents:
diff changeset
2671 v5 = v60;
Ritor1
parents:
diff changeset
2672 v61 = v21 << 16;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2673 v53 = ((_50BAC8_screen_space_x[v19] - v21) << 16) / v53;
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2674 v60->array_3D8[v73] = LOWORD(_50BAC8_screen_space_x[v20]);
0
Ritor1
parents:
diff changeset
2675 }
Ritor1
parents:
diff changeset
2676 v22 = v7;
Ritor1
parents:
diff changeset
2677 v70 = v7;
Ritor1
parents:
diff changeset
2678 if ( v7 <= v73 )
Ritor1
parents:
diff changeset
2679 {
Ritor1
parents:
diff changeset
2680 v56 = &v5->array_3D8[v7];
Ritor1
parents:
diff changeset
2681 v23 = &v5->array_18[v7];
Ritor1
parents:
diff changeset
2682 do
Ritor1
parents:
diff changeset
2683 {
Ritor1
parents:
diff changeset
2684 v24 = v67;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2685 if ( v22 < _50B9D8_screen_space_y[v67] || v22 == v73 )
0
Ritor1
parents:
diff changeset
2686 goto LABEL_57;
Ritor1
parents:
diff changeset
2687 v25 = v64 + v67;
Ritor1
parents:
diff changeset
2688 v67 = v25;
Ritor1
parents:
diff changeset
2689 if ( v25 < v74 )
Ritor1
parents:
diff changeset
2690 {
Ritor1
parents:
diff changeset
2691 if ( v25 >= 0 )
Ritor1
parents:
diff changeset
2692 goto LABEL_55;
Ritor1
parents:
diff changeset
2693 v25 += v74;
Ritor1
parents:
diff changeset
2694 }
Ritor1
parents:
diff changeset
2695 else
Ritor1
parents:
diff changeset
2696 {
Ritor1
parents:
diff changeset
2697 v25 -= v74;
Ritor1
parents:
diff changeset
2698 }
Ritor1
parents:
diff changeset
2699 v67 = v25;
Ritor1
parents:
diff changeset
2700 LABEL_55:
Ritor1
parents:
diff changeset
2701 v26 = v25;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2702 v27 = _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2703 if ( _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24] > 0 )
0
Ritor1
parents:
diff changeset
2704 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2705 v28 = _50BAC8_screen_space_x[v24];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2706 v54 = ((_50BAC8_screen_space_x[v26] - v28) << 16) / v27;
0
Ritor1
parents:
diff changeset
2707 v62 = v28 << 16;
Ritor1
parents:
diff changeset
2708 }
Ritor1
parents:
diff changeset
2709 LABEL_57:
Ritor1
parents:
diff changeset
2710 v29 = v66;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2711 if ( v70 >= _50B9D8_screen_space_y[v66] && v70 != v73 )
0
Ritor1
parents:
diff changeset
2712 {
Ritor1
parents:
diff changeset
2713 v30 = v63 + v66;
Ritor1
parents:
diff changeset
2714 v66 += v63;
Ritor1
parents:
diff changeset
2715 if ( v66 >= v74 )
Ritor1
parents:
diff changeset
2716 {
Ritor1
parents:
diff changeset
2717 v30 -= v74;
Ritor1
parents:
diff changeset
2718 goto LABEL_63;
Ritor1
parents:
diff changeset
2719 }
Ritor1
parents:
diff changeset
2720 if ( v30 < 0 )
Ritor1
parents:
diff changeset
2721 {
Ritor1
parents:
diff changeset
2722 v30 += v74;
Ritor1
parents:
diff changeset
2723 LABEL_63:
Ritor1
parents:
diff changeset
2724 v66 = v30;
Ritor1
parents:
diff changeset
2725 }
Ritor1
parents:
diff changeset
2726 v31 = v30;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2727 v32 = _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2728 if ( _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29] > 0 )
0
Ritor1
parents:
diff changeset
2729 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2730 v33 = _50BAC8_screen_space_x[v29];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 652
diff changeset
2731 v53 = ((_50BAC8_screen_space_x[v31] - v33) << 16) / v32;
0
Ritor1
parents:
diff changeset
2732 v61 = v33 << 16;
Ritor1
parents:
diff changeset
2733 }
Ritor1
parents:
diff changeset
2734 }
Ritor1
parents:
diff changeset
2735 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62);
Ritor1
parents:
diff changeset
2736 *v56 = HIWORD(v61);
Ritor1
parents:
diff changeset
2737 v34 = v23 + 480;
Ritor1
parents:
diff changeset
2738 v35 = v23[480];
Ritor1
parents:
diff changeset
2739 if ( *v23 > v35 )
Ritor1
parents:
diff changeset
2740 {
Ritor1
parents:
diff changeset
2741 v36 = *v23 ^ v35;
Ritor1
parents:
diff changeset
2742 v37 = *v34;
Ritor1
parents:
diff changeset
2743 *v23 = v36;
Ritor1
parents:
diff changeset
2744 v38 = v37 ^ v36;
Ritor1
parents:
diff changeset
2745 *v23 ^= v38;
Ritor1
parents:
diff changeset
2746 *v34 = v38;
Ritor1
parents:
diff changeset
2747 }
Ritor1
parents:
diff changeset
2748 ++v56;
Ritor1
parents:
diff changeset
2749 v62 += v54;
Ritor1
parents:
diff changeset
2750 v22 = v70 + 1;
Ritor1
parents:
diff changeset
2751 v61 += v53;
Ritor1
parents:
diff changeset
2752 ++v23;
Ritor1
parents:
diff changeset
2753 ++v70;
Ritor1
parents:
diff changeset
2754 }
Ritor1
parents:
diff changeset
2755 while ( v70 <= v73 );
Ritor1
parents:
diff changeset
2756 }
Ritor1
parents:
diff changeset
2757 v39 = a3;
Ritor1
parents:
diff changeset
2758 v40 = v73;
Ritor1
parents:
diff changeset
2759 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) )
Ritor1
parents:
diff changeset
2760 return 0;
Ritor1
parents:
diff changeset
2761 if ( v7 < a3->_viewport_space_y )
Ritor1
parents:
diff changeset
2762 v7 = a3->_viewport_space_y;
Ritor1
parents:
diff changeset
2763 if ( v73 > v41 )
Ritor1
parents:
diff changeset
2764 {
Ritor1
parents:
diff changeset
2765 v40 = a3->_viewport_space_w;
Ritor1
parents:
diff changeset
2766 v73 = a3->_viewport_space_w;
Ritor1
parents:
diff changeset
2767 }
Ritor1
parents:
diff changeset
2768 v71 = v7;
Ritor1
parents:
diff changeset
2769 if ( v7 <= v40 )
Ritor1
parents:
diff changeset
2770 {
Ritor1
parents:
diff changeset
2771 a3a = (char *)v5 - (char *)a3;
Ritor1
parents:
diff changeset
2772 v57 = &v5->array_18[v7];
Ritor1
parents:
diff changeset
2773 v42 = &v39->array_3D8[v7];
Ritor1
parents:
diff changeset
2774 do
Ritor1
parents:
diff changeset
2775 {
Ritor1
parents:
diff changeset
2776 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 )
Ritor1
parents:
diff changeset
2777 break;
Ritor1
parents:
diff changeset
2778 ++v57;
Ritor1
parents:
diff changeset
2779 ++v7;
Ritor1
parents:
diff changeset
2780 ++v71;
Ritor1
parents:
diff changeset
2781 ++v42;
Ritor1
parents:
diff changeset
2782 }
Ritor1
parents:
diff changeset
2783 while ( v71 <= v40 );
Ritor1
parents:
diff changeset
2784 }
Ritor1
parents:
diff changeset
2785 v72 = v40;
Ritor1
parents:
diff changeset
2786 if ( v40 < v7 )
Ritor1
parents:
diff changeset
2787 return 0;
Ritor1
parents:
diff changeset
2788 v58 = &v5->array_18[v40];
Ritor1
parents:
diff changeset
2789 v43 = &v39->array_3D8[v40];
Ritor1
parents:
diff changeset
2790 do
Ritor1
parents:
diff changeset
2791 {
Ritor1
parents:
diff changeset
2792 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 )
Ritor1
parents:
diff changeset
2793 break;
Ritor1
parents:
diff changeset
2794 --v58;
Ritor1
parents:
diff changeset
2795 --v40;
Ritor1
parents:
diff changeset
2796 --v72;
Ritor1
parents:
diff changeset
2797 --v43;
Ritor1
parents:
diff changeset
2798 v73 = v40;
Ritor1
parents:
diff changeset
2799 }
Ritor1
parents:
diff changeset
2800 while ( v72 >= v7 );
Ritor1
parents:
diff changeset
2801 if ( v7 >= v40 )
Ritor1
parents:
diff changeset
2802 return 0;
Ritor1
parents:
diff changeset
2803 a3b = (char *)v39 - (char *)v5;
Ritor1
parents:
diff changeset
2804 v59 = &v39->array_3D8[v7];
Ritor1
parents:
diff changeset
2805 v45 = &v5->array_18[v7];
Ritor1
parents:
diff changeset
2806 v46 = v73 - v7 + 1;
Ritor1
parents:
diff changeset
2807 do
Ritor1
parents:
diff changeset
2808 {
Ritor1
parents:
diff changeset
2809 v47 = *(__int16 *)((char *)v45 + a3b);
Ritor1
parents:
diff changeset
2810 if ( *v45 < v47 )
Ritor1
parents:
diff changeset
2811 *v45 = v47;
Ritor1
parents:
diff changeset
2812 if ( v45[480] > *v59 )
Ritor1
parents:
diff changeset
2813 v45[480] = *v59;
Ritor1
parents:
diff changeset
2814 ++v59;
Ritor1
parents:
diff changeset
2815 ++v45;
Ritor1
parents:
diff changeset
2816 --v46;
Ritor1
parents:
diff changeset
2817 }
Ritor1
parents:
diff changeset
2818 while ( v46 );
Ritor1
parents:
diff changeset
2819 v5->_viewport_space_y = v7;
Ritor1
parents:
diff changeset
2820 v5->_viewport_space_w = v73;
Ritor1
parents:
diff changeset
2821 v5->field_8 = v5->array_18[v7];
Ritor1
parents:
diff changeset
2822 v48 = v5->array_3D8[v7];
Ritor1
parents:
diff changeset
2823 v5->field_10 = v7;
Ritor1
parents:
diff changeset
2824 v5->field_14 = v7;
Ritor1
parents:
diff changeset
2825 v49 = v7 + 1;
Ritor1
parents:
diff changeset
2826 v5->field_C = v48;
Ritor1
parents:
diff changeset
2827 if ( v49 <= v73 )
Ritor1
parents:
diff changeset
2828 {
Ritor1
parents:
diff changeset
2829 v50 = &v5->array_3D8[v49];
Ritor1
parents:
diff changeset
2830 do
Ritor1
parents:
diff changeset
2831 {
Ritor1
parents:
diff changeset
2832 v51 = *(v50 - 480);
Ritor1
parents:
diff changeset
2833 if ( v51 < v5->field_8 )
Ritor1
parents:
diff changeset
2834 {
Ritor1
parents:
diff changeset
2835 v5->field_8 = v51;
Ritor1
parents:
diff changeset
2836 v5->field_10 = v49;
Ritor1
parents:
diff changeset
2837 }
Ritor1
parents:
diff changeset
2838 v52 = *v50;
Ritor1
parents:
diff changeset
2839 if ( v52 > v5->field_C )
Ritor1
parents:
diff changeset
2840 {
Ritor1
parents:
diff changeset
2841 v5->field_C = v52;
Ritor1
parents:
diff changeset
2842 v5->field_14 = v49;
Ritor1
parents:
diff changeset
2843 }
Ritor1
parents:
diff changeset
2844 ++v49;
Ritor1
parents:
diff changeset
2845 ++v50;
Ritor1
parents:
diff changeset
2846 }
Ritor1
parents:
diff changeset
2847 while ( v49 <= v73 );
Ritor1
parents:
diff changeset
2848 }
Ritor1
parents:
diff changeset
2849 return 1;
Ritor1
parents:
diff changeset
2850 }
Ritor1
parents:
diff changeset
2851 // 50B700: using guessed type int dword_50B700;
Ritor1
parents:
diff changeset
2852
Ritor1
parents:
diff changeset
2853 //----- (00424CD7) --------------------------------------------------------
Ritor1
parents:
diff changeset
2854 signed int __fastcall sr_424CD7(unsigned int uVertexID)
Ritor1
parents:
diff changeset
2855 {
Ritor1
parents:
diff changeset
2856 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
2857 signed int v2; // edi@1
Ritor1
parents:
diff changeset
2858 char *v3; // esi@4
Ritor1
parents:
diff changeset
2859 char *v4; // ecx@4
Ritor1
parents:
diff changeset
2860 unsigned int v5; // eax@4
Ritor1
parents:
diff changeset
2861 char *v6; // edx@4
Ritor1
parents:
diff changeset
2862 double v7; // st6@10
Ritor1
parents:
diff changeset
2863 double v8; // st5@10
Ritor1
parents:
diff changeset
2864 double v9; // st6@11
Ritor1
parents:
diff changeset
2865 unsigned __int8 v10; // c2@15
Ritor1
parents:
diff changeset
2866 unsigned __int8 v11; // c3@15
Ritor1
parents:
diff changeset
2867 RenderVertexSoft *v12; // edi@22
Ritor1
parents:
diff changeset
2868 char *v13; // eax@22
Ritor1
parents:
diff changeset
2869 double v14; // st6@22
Ritor1
parents:
diff changeset
2870 signed int result; // eax@24
Ritor1
parents:
diff changeset
2871 unsigned int v16; // [sp+8h] [bp-28h]@4
Ritor1
parents:
diff changeset
2872 bool v17; // [sp+Ch] [bp-24h]@6
Ritor1
parents:
diff changeset
2873 char *v18; // [sp+10h] [bp-20h]@4
Ritor1
parents:
diff changeset
2874 char *v19; // [sp+14h] [bp-1Ch]@4
Ritor1
parents:
diff changeset
2875 signed int v20; // [sp+18h] [bp-18h]@1
Ritor1
parents:
diff changeset
2876 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4
Ritor1
parents:
diff changeset
2877 char *v22; // [sp+20h] [bp-10h]@4
Ritor1
parents:
diff changeset
2878 char *v23; // [sp+24h] [bp-Ch]@4
Ritor1
parents:
diff changeset
2879 char *v24; // [sp+28h] [bp-8h]@4
Ritor1
parents:
diff changeset
2880 char *v25; // [sp+2Ch] [bp-4h]@4
Ritor1
parents:
diff changeset
2881
Ritor1
parents:
diff changeset
2882 v1 = uVertexID;
Ritor1
parents:
diff changeset
2883 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
2884 v2 = 0;
Ritor1
parents:
diff changeset
2885 v20 = 0;
Ritor1
parents:
diff changeset
2886 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 )
Ritor1
parents:
diff changeset
2887 v2 = 1;
Ritor1
parents:
diff changeset
2888 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
2889 return 0;
Ritor1
parents:
diff changeset
2890 v3 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
2891 v4 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
2892 v5 = v1;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 144
diff changeset
2893 v23 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
2894 v21 = array_507D30;
Ritor1
parents:
diff changeset
2895 v18 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
2896 v19 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
2897 v22 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
2898 v24 = (char *)&array_507D30[0].v;
Ritor1
parents:
diff changeset
2899 v25 = (char *)&array_507D30[0].u;
Ritor1
parents:
diff changeset
2900 v6 = (char *)&array_50AC10[0].v;
Ritor1
parents:
diff changeset
2901 v16 = v5;
Ritor1
parents:
diff changeset
2902 do
Ritor1
parents:
diff changeset
2903 {
Ritor1
parents:
diff changeset
2904 v17 = *((float *)v6 + 5) >= 8.0;
Ritor1
parents:
diff changeset
2905 if ( v2 != v17 )
Ritor1
parents:
diff changeset
2906 {
Ritor1
parents:
diff changeset
2907 if ( v17 )
Ritor1
parents:
diff changeset
2908 {
Ritor1
parents:
diff changeset
2909 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7));
Ritor1
parents:
diff changeset
2910 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6);
Ritor1
parents:
diff changeset
2911 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5);
Ritor1
parents:
diff changeset
2912 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1);
Ritor1
parents:
diff changeset
2913 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6;
Ritor1
parents:
diff changeset
2914 }
Ritor1
parents:
diff changeset
2915 else
Ritor1
parents:
diff changeset
2916 {
Ritor1
parents:
diff changeset
2917 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5));
Ritor1
parents:
diff changeset
2918 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6);
Ritor1
parents:
diff changeset
2919 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7);
Ritor1
parents:
diff changeset
2920 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11);
Ritor1
parents:
diff changeset
2921 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12);
Ritor1
parents:
diff changeset
2922 }
Ritor1
parents:
diff changeset
2923 *(float *)v24 = v8;
Ritor1
parents:
diff changeset
2924 *(float *)v22 = 8.0;
Ritor1
parents:
diff changeset
2925 *(int *)v23 = 0x3E000000u;
Ritor1
parents:
diff changeset
2926 if ( v2 )
Ritor1
parents:
diff changeset
2927 {
Ritor1
parents:
diff changeset
2928 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) )
Ritor1
parents:
diff changeset
2929 {
Ritor1
parents:
diff changeset
2930 v10 = 0;
Ritor1
parents:
diff changeset
2931 v11 = *(float *)v3 == *((float *)v6 - 5);
Ritor1
parents:
diff changeset
2932 goto LABEL_19;
Ritor1
parents:
diff changeset
2933 }
Ritor1
parents:
diff changeset
2934 }
Ritor1
parents:
diff changeset
2935 else
Ritor1
parents:
diff changeset
2936 {
Ritor1
parents:
diff changeset
2937 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) )
Ritor1
parents:
diff changeset
2938 {
Ritor1
parents:
diff changeset
2939 v10 = 0;
Ritor1
parents:
diff changeset
2940 v11 = *(float *)v3 == *((float *)v6 + 7);
Ritor1
parents:
diff changeset
2941 LABEL_19:
Ritor1
parents:
diff changeset
2942 if ( v11 | v10 )
Ritor1
parents:
diff changeset
2943 goto LABEL_21;
Ritor1
parents:
diff changeset
2944 goto LABEL_20;
Ritor1
parents:
diff changeset
2945 }
Ritor1
parents:
diff changeset
2946 }
Ritor1
parents:
diff changeset
2947 LABEL_20:
Ritor1
parents:
diff changeset
2948 ++v21;
Ritor1
parents:
diff changeset
2949 v22 += 48;
Ritor1
parents:
diff changeset
2950 v24 += 48;
Ritor1
parents:
diff changeset
2951 v25 += 48;
Ritor1
parents:
diff changeset
2952 v4 += 48;
Ritor1
parents:
diff changeset
2953 v3 += 48;
Ritor1
parents:
diff changeset
2954 ++v20;
Ritor1
parents:
diff changeset
2955 v23 += 48;
Ritor1
parents:
diff changeset
2956 v19 = v4;
Ritor1
parents:
diff changeset
2957 v18 = v3;
Ritor1
parents:
diff changeset
2958 }
Ritor1
parents:
diff changeset
2959 LABEL_21:
Ritor1
parents:
diff changeset
2960 if ( v17 )
Ritor1
parents:
diff changeset
2961 {
Ritor1
parents:
diff changeset
2962 v12 = v21;
Ritor1
parents:
diff changeset
2963 v13 = v23;
Ritor1
parents:
diff changeset
2964 v19 += 48;
Ritor1
parents:
diff changeset
2965 v18 += 48;
Ritor1
parents:
diff changeset
2966 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001);
Ritor1
parents:
diff changeset
2967 ++v20;
Ritor1
parents:
diff changeset
2968 v25 += 48;
Ritor1
parents:
diff changeset
2969 v24 += 48;
Ritor1
parents:
diff changeset
2970 v22 += 48;
Ritor1
parents:
diff changeset
2971 ++v21;
Ritor1
parents:
diff changeset
2972 v23 += 48;
Ritor1
parents:
diff changeset
2973 memcpy(v12, v6 + 8, 0x30u);
Ritor1
parents:
diff changeset
2974 v4 = v19;
Ritor1
parents:
diff changeset
2975 v3 = v18;
Ritor1
parents:
diff changeset
2976 *(float *)v13 = v14;
Ritor1
parents:
diff changeset
2977 }
Ritor1
parents:
diff changeset
2978 v2 = v17;
Ritor1
parents:
diff changeset
2979 v6 += 48;
Ritor1
parents:
diff changeset
2980 --v16;
Ritor1
parents:
diff changeset
2981 }
Ritor1
parents:
diff changeset
2982 while ( v16 );
Ritor1
parents:
diff changeset
2983 result = v20;
Ritor1
parents:
diff changeset
2984 if ( v20 < 3 )
Ritor1
parents:
diff changeset
2985 return 0;
Ritor1
parents:
diff changeset
2986 return result;
Ritor1
parents:
diff changeset
2987 }