annotate mm7_1.cpp @ 1281:21a46b38ca24

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