annotate Mouse.cpp @ 1:ac0fb48cd27a

Texture, hwl loading, video player
author Nomad
date Tue, 09 Oct 2012 13:09:08 +0200
parents 8b8875f5b359
children 2ca04ccb612a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "OSAPI.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Mouse.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Items.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Texture.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 Mouse *pMouse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 AsyncMouse *pAsyncMouse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 //----- (00469860) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 void Mouse::GetClickPos(unsigned int *pX, unsigned int *pY)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 *pX = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 v3 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 *pX = this->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 v3 = this->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 *pY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 //----- (004698A6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 void Mouse::RemoveHoldingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 Mouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 pParty->pPickedItem.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 if ( _strcmpi(v1->pCurrentCursorName, "MICON2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 //----- (004698D8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 void Mouse::SetCursorBitmapFromItemID(unsigned int uItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 pMouse->SetCursorBitmap(pItemsTable->pItems[uItemID].pIconName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 //----- (004698F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 void Mouse::SetCurrentCursorBitmap()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 SetCursorBitmap(pCurrentCursorName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 //----- (00469903) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 void Mouse::SetCursorBitmap(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 Mouse *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 HCURSOR v3; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 int v4; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 double v5; // st7@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 float v6; // ST04_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 LONG v7; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 LONG v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 unsigned int v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 float v10; // [sp+4h] [bp-18h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 struct tagPOINT Point; // [sp+14h] [bp-8h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 if ( !this->bInitialized || !pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 if ( _strcmpi("MICON2", pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 pGame->uFlags2 &= 0xFFFFFFEFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 pGame->uFlags2 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 if ( _strcmpi(v2->pCurrentCursorName, pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 strcpy(v2->pCurrentCursorName, pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 ClearCursor();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 if ( _strnicmp(pName, "MICON1", 5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v9 = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 v2->uCursorTextureID = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 v2->uCursorTextureID_2 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 v2->AllocCursorSystemMem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 v2->field_C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 v2->field_14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 v2->bActive = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 if ( !areWeLoadingTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 if (uCursorTextureID != -1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 pIcons_LOD->pTextures[uCursorTextureID].Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 v2->bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 v2->field_C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 if ( !strcmp(pName, "MICON1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 v3 = LoadCursorA(GetModuleHandleW(nullptr), "Arrow");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 SetClassLongA(hWnd, GCL_HCURSOR, (LONG)v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 v4 = (int)pAsyncMouse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 v10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 v5 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 pAsyncMouse->SetHotspot(v6, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 if ( !strcmp(pName, "MICON2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v7 = (LONG)LoadCursorA(GetModuleHandleW(nullptr), "Target");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 SetClassLongA(hWnd, -12, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 v4 = (int)pAsyncMouse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 v10 = 14.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 v5 = 14.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 GetCursorPos(&Point);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 SetCursorPos(Point.x, Point.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 if ( !strcmp(pName, "MICON3") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 v8 = (LONG)LoadCursorA(0, (LPCSTR)IDC_WAIT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 SetClassLongA(hWnd, -12, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 // 506128: using guessed type int areWeLoadingTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 //----- (00469AE4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 LONG Mouse::_469AE4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 Mouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 LONG v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 LONG result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 struct tagPOINT Point; // [sp+Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 this->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v2 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 Point.x = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 result = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 GetCursorPos(&Point);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 ScreenToClient(hWnd, &Point);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 result = Point.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v2 = Point.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 v1->uMouseClickX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 v1->uMouseClickY = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 if ( v2 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 if ( v2 > 639 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 v2 = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 if ( result > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 result = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 if ( pRenderer->bWindowMode && (v2 < 0 || result < 0 || v2 > 639 || result > 479) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 if ( v1->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 v1->bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 v1->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 //----- (00469BA3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 void Mouse::ClearCursor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 Mouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 void *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 void **v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v2 = this->pCursorBitmap_sysmem;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 this->bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 v1->pCursorBitmap_sysmem = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 if ( v1->pCursorBitmap2_sysmem )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 free(v1->pCursorBitmap2_sysmem);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 v1->pCursorBitmap2_sysmem = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 v3 = &v1->ptr_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 if ( *v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 free(*v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 //----- (00469BE6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 void Mouse::AllocCursorSystemMem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 if (!pCursorBitmap_sysmem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 pCursorBitmap_sysmem = (unsigned __int16 *)DoAllocCursorMem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 if (!pCursorBitmap2_sysmem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 pCursorBitmap2_sysmem = (unsigned __int8 *)DoAllocCursorMem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 //----- (00469C0D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 void *Mouse::DoAllocCursorMem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 return malloc(4 * (this->uCursorTextureID != -1 ? pIcons_LOD->pTextures[this->uCursorTextureID].uTextureWidth : 24)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 * (this->uCursorTextureID != -1 ? pIcons_LOD->pTextures[this->uCursorTextureID].uTextureHeight : 26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 //----- (00469C39) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 POINT *Mouse::GetCursorPos(POINT *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 void *v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 POINT *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 unsigned int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 unsigned int v5; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 v2 = pAsyncMouse;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 a2->x = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v4 = *((int *)v2 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 v5 = this->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 v4 = this->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 a2->x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 a2->y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 //----- (00469C65) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 void Mouse::Initialize(HWND hWnd)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 this->hWnd = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 this->bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 this->bInitialized = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 this->pCursorBitmapPos.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 this->pCursorBitmapPos.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 this->uMouseClickX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 this->uMouseClickY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 this->pCursorBitmap_sysmem = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 this->field_34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 this->pCursorBitmap2_sysmem = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 SetCursorBitmap("MICON3");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 SetCursorBitmap("MICON2");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 SetCursorBitmap("MICON1");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 //----- (00469CC2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 void Mouse::Deactivate()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 if (bInitialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 bActive = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 //----- (00469CCD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 void Mouse::DrawCursor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 Mouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 char v11; // zf@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 signed int v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 signed int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 Vec4_int_ *v5; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 int v6; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 int v7; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 int v8; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 unsigned int v9; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 if ( this->bInitialized )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 if ( !this->field_8 && this->bActive && !this->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 pMouse->_469AE4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 v11 = v1->field_C == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 v3 = v1->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 v4 = v1->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 v1->field_F4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 if ( v3 < 0 || v4 < 0 || v3 > 639 || v4 > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v1->field_F4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 if ( v3 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 if ( v4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 if ( v3 > 639 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 v3 = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 if ( v4 > 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 v4 = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 v5 = &v1->pCursorBitmapRect;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 v6 = v3 + v1->uCursorBitmapPitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 v7 = v4 + v1->field_5C[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 v1->pCursorBitmapRect.y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 v1->pCursorBitmapRect.x = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 v1->pCursorBitmapRect.z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 v1->pCursorBitmapRect.w = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 if ( v3 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 v5->x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 if ( v4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 v1->pCursorBitmapRect.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 if ( v6 > 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 v1->pCursorBitmapRect.z = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 if ( v7 > 480 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 v1->pCursorBitmapRect.w = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 v8 = v1->pCursorBitmapRect.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 v1->bActive = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 v1->uCursorBitmapWidth = v8 - v5->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 v11 = v1->field_14 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 v1->uCursorBitmapHeight = v1->pCursorBitmapRect.w - v1->pCursorBitmapRect.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 if ( pMouse->ptr_90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 v9 = 2 * pMouse->uCursorBitmapPitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 pRenderer->_4A6DF5(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 v1->pCursorBitmap_sysmem,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 &v1->pCursorBitmapPos,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 pRenderer->pTargetSurface,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 pRenderer->uTargetSurfacePitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 &v1->pCursorBitmapRect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 v1->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 //----- (00469E1C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 void Mouse::_469E1C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 bActive = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 //----- (00469E24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 void Mouse::_469E24()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 if (pCursorBitmap3_sysmembits_16bit)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 free(pCursorBitmap3_sysmembits_16bit);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 pCursorBitmap3_sysmembits_16bit = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 //----- (00469E3B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 unsigned __int16 *Mouse::_469E3B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 unsigned __int16 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 unsigned int v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 unsigned __int16 *v5; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 unsigned __int16 *v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 unsigned int v7; // [sp+4h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 unsigned __int16 *v8; // [sp+8h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 unsigned __int16 *v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 result = this->pCursorBitmap3_sysmembits_16bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v9 = this->pCursorBitmap3_sysmembits_16bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v7 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v8 = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 result = (unsigned __int16 *)this->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 if ( (signed int)result < this->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 v2 = this->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 v3 = pRenderer->uTargetSurfacePitch * (int)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 v4 = this->field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 if ( v4 < v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 v5 = &v8[v3 + v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 *v5 = *v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 v2 = this->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 while ( v4 < v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 v3 += v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 result = (unsigned __int16 *)((char *)result + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 while ( (signed int)result < this->field_4C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 //----- (00469EA4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 void Mouse::_469EA4()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 Mouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 Texture *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 unsigned int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 unsigned int v6; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 int v7; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 int v8; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 int v9; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 unsigned int v10; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 int v11; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 unsigned __int16 *v12; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 unsigned __int16 *v13; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 unsigned int a2; // [sp+Ch] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 unsigned int v15; // [sp+10h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 unsigned int v16; // [sp+14h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 unsigned __int16 *v17; // [sp+18h] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 int v18; // [sp+1Ch] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 int v19; // [sp+20h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 unsigned __int16 *v20; // [sp+20h] [bp-8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 int v21; // [sp+24h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 unsigned __int16 *v22; // [sp+24h] [bp-4h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 if ( pParty->pPickedItem.uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 v2 = pIcons_LOD->LoadTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 v4 = *((int *)pAsyncMouse + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v5 = *((int *)pAsyncMouse + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 v4 = pMouse->uMouseClickX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 v5 = pMouse->uMouseClickY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 v15 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 if ( (signed int)v4 <= 639 && (signed int)v5 <= 479 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 if ( (v4 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 if ( (v5 & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 if ( (signed int)(v3->uTextureWidth + a2) <= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 v21 = v3->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 v21 = 640 - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 if ( (signed int)(v3->uTextureHeight + v6) <= 480 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 v19 = v3->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 v7 = v3->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 v7 = 480 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 v19 = 480 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 if ( !v1->pCursorBitmap3_sysmembits_16bit
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 || a2 != v1->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 || v6 != v1->field_44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 || a2 + v21 != v1->field_48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 || v6 + v7 != v1->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 if ( v1->pCursorBitmap3_sysmembits_16bit )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 free(v1->pCursorBitmap3_sysmembits_16bit);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 v1->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * v3->uTextureHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 * v3->uTextureWidth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 v1->field_40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 v1->field_48 = a2 + v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 v1->field_44 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 v1->field_4C = v6 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v8 = v1->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 v22 = v1->pCursorBitmap3_sysmembits_16bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 v17 = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 v16 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 if ( v8 < v1->field_4C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 v9 = v1->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 v10 = pRenderer->uTargetSurfacePitch * v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 v11 = v1->field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 v18 = v1->field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 if ( v11 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 v20 = &v17[v10 + v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 v12 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 *v13 = *v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 v9 = v1->field_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 while ( v18 < v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 v10 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 while ( v8 < v1->field_4C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 v6 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 if ( pParty->pPickedItem.uAttributtes & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 pRenderer->_4A6776(a2, v6, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 if ( pParty->pPickedItem.uAttributtes & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 pRenderer->DrawTextureTransparent(a2, v6, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 pRenderer->DrawTransparentGreenShade(a2, v6, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 if ( this->pCursorBitmap3_sysmembits_16bit )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 free(this->pCursorBitmap3_sysmembits_16bit);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 v1->pCursorBitmap3_sysmembits_16bit = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 //----- (0046A080) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 void Mouse::Activate(int bActive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 bActive = bActive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 //----- (0046A08A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 void Mouse::SetMouseClick(int x, int y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 uMouseClickX = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 uMouseClickY = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 //----- (00409E3D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 void AsyncMouse::_409E3D(char a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 if ( *((unsigned char *)this + 128) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 *((unsigned char *)this + 103) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 *((unsigned char *)this + 103) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 *((unsigned int *)this + 32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 *((unsigned int *)this + 32) &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 //----- (00465C2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 void AsyncMouse::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 (**(void (__stdcall ***)(int))pAsyncMouse)(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 pAsyncMouse = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 //----- (0046ACA9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 AsyncMouse::AsyncMouse(IDirectDrawSurface *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 IDirectDrawSurface *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 void *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 char *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 double v5; // ST14_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 double v6; // ST14_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 v2 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 *((int *)this + 16) = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 *((int *)this + 3) = (int)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 LOBYTE(v2) = BYTE3(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 v4 = (char *)this + 104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 *((int *)this + 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 *((char *)this + 20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 *((int *)this + 17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 *((int *)this + 18) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 *((char *)this + 88) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 *((char *)this + 91) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 *((char *)this + 93) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 *((char *)this + 94) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 *((char *)this + 95) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 *((char *)this + 96) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 *((char *)this + 97) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 *((char *)this + 98) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 *((char *)this + 99) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 *((char *)this + 100) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 *((char *)this + 101) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 *((char *)this + 102) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 *((char *)this + 104) = (char)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 *((int *)this + 27) = (int)AsyncMouse::unk_46BD09(0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 *((int *)v4 + 2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 *((char *)v3 + 116) = BYTE3(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 *((int *)v3 + 30) = (int)AsyncMouse::unk_46BD09(0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 *((int *)v3 + 31) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 *((int *)v3 + 32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 *((int *)v3 + 33) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 *(int *)v3 = 5080880;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 if ( !Initialize(this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 MessageBoxW(nullptr, L"Could not initialize CMouseAsync object", nullptr, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 *((int *)v3 + 12) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 *((int *)v3 + 13) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 *((int *)v3 + 14) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 *((int *)v3 + 15) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 v5 = (float)0.0 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 *((int *)v3 + 10) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 v6 = (float)0.0 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 a2 = (IDirectDrawSurface *)LODWORD(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 *((int *)v3 + 32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 *((int *)v3 + 11) = LODWORD(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 *((char *)v3 + 103) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 // 4DBD94: using guessed type int dword_4DBD94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 //----- (0046ADE2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 AsyncMouse::~AsyncMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 //*(int *)this = AsyncMouse_pvdtor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 v2 = (char *)this + 132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v3 = *((int *)this + 33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 (**(void (__stdcall ***)(int))v3)(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 *(int *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 TerminateThread(*((HANDLE *)v1 + 4), 0xFAu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 SetWindowPos(hWnd, (HWND)0xFFFFFFFE, uWindowX, uWindowY, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 //AsyncMouse::dtor_sub_46BC73((int)((char *)v1 + 116));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 //AsyncMouse::dtor_sub_46BC73((int)((char *)v1 + 104));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 // 4D8730: using guessed type int (__stdcall *AsyncMouse_pvdtor[2])(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 //----- (0046AE6E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 char AsyncMouse::Initialize(LPVOID lpParameter)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 v1 = lpParameter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 if ( LoadCursorImage() && _46B072() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 result = CreateDisrectInputMouse() != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 //----- (0046AE97) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 char AsyncMouse::LoadCursor(const char *pContainer)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 HRESULT v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 HRESULT a2; // [sp+8h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 int v7; // [sp+58h] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 char v9; // [sp+B4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 EnterCriticalSection(&pGame->pThreadWardInstance->cs2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 v3 = *((int *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 a2 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 v4 = (*(int (__stdcall **)(int, int, int, int, signed int, HRESULT *))(*(int *)v3 + 20))(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 1024,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 ErrHR(v4, "DirectInput", __FUNCTION__, __FILE__, __LINE__);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 Texture thisa; // [sp+6Ch] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 //Texture::Texture(&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 if ( pIcons_LOD->LoadTextureFromLOD(&thisa, pContainer, TEXTURE_16BIT_PALETTE) != -1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 && DrawCursor(&thisa, *((IDirectDrawSurface4 **)v2 + 1), 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 thisa.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 LeaveCriticalSection(&pGame->pThreadWardInstance->cs2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 //----- (0046AF50) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 char AsyncMouse::LoadCursorImage()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 void *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 int v3; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 const char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 std::string v6; // [sp-18h] [bp-12Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 const char *v7; // [sp-8h] [bp-11Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 int v8; // [sp-4h] [bp-118h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 DDSURFACEDESC2 Dst; // [sp+Ch] [bp-108h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 int v10; // [sp+88h] [bp-8Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 int v11; // [sp+8Ch] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 int v12; // [sp+90h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 int v13; // [sp+94h] [bp-80h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 char v14; // [sp+D0h] [bp-44h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 int v15; // [sp+F0h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 int v16; // [sp+104h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 int v17; // [sp+108h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 std::string *v18; // [sp+10Ch] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 int a3; // [sp+113h] [bp-1h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 if ( pRenderer->pDirectDraw4->GetDisplayMode(&Dst)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 || (memset(&v10, 0, 0x7Cu),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 v10 = 124,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 v11 = 4103,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 v15 = 2112,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 v12 = 32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 v13 = 32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 v2 = *((int *)v1 + 3),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 memcpy(&v14, &Dst.ddpfPixelFormat, 0x20u),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 (*(int (__stdcall **)(int, int *, char *, int))(**(int **)v2 + 24))(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 *(int *)v2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 &v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 (char *)v1 + 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 || (*(int (__stdcall **)(int, int *, char *, int))(***((int ***)v1 + 3) + 24))(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 **((int **)v1 + 3),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 &v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 (char *)v1 + 8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 || (v3 = *((int *)v1 + 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v16 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 v17 = 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 (*(int (__stdcall **)(int, signed int, int *))(*(int *)v3 + 116))(v3, 8, &v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 return false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v5 = std__string_720990.c_str();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 if ( !std__string_720990.size() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v5 = (const char *)&dword_4D86F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 if ( !LoadCursor(v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 MessageBoxW(nullptr, L"Could not load async mouse cursor image", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MouseAsync.cpp:182", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 return true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 // 4D86F0: using guessed type int dword_4D86F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 //----- (0046B072) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 char AsyncMouse::_46B072()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 DWORD v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 DWORD ThreadId; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 ThreadId = (DWORD)this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v1 = (DWORD)this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 v2 = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AsyncMouseThread, this, 4u, &ThreadId);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 *(int *)(v1 + 16) = (int)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 result = SetThreadPriority(v2, 15) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 //----- (0046B0A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 char AsyncMouse::CreateDisrectInputMouse()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 DirectInputMouse *v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 DirectInputMouse *v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 v2 = (DirectInputMouse *)operator new(0x2Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 v3 = DirectInputMouse::DirectInputMouse(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 *((int *)v1 + 33) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 return v3 != 0;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 //----- (0046B0ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 int AsyncMouse::_46B0ED()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 v1 = this + 132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 v2 = *(int *)(this + 132);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 result = (**(int (__stdcall ***)(int))v2)(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 // 46B0ED: using guessed type int __thiscall AsyncMouse__46B0ED(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 //----- (0046B105) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 void AsyncMouse::Resume()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 EnterCriticalSection(&pGame->pThreadWardInstance->cs3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 AsyncMouse::CreateDisrectInputMouse(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 AsyncMouse::Clip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 ResumeThread(*((HANDLE *)v1 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 *((char *)v1 + 88) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 LeaveCriticalSection(&pGame->pThreadWardInstance->cs3);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 //----- (0046B14F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 void AsyncMouse::Suspend()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 Vis *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 std::string v3; // [sp-18h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 const char *v4; // [sp-8h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 int v5; // [sp-4h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 std::string *v6; // [sp+4h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 int a3; // [sp+Bh] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 if ( *((int *)this + 33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 v2 = pGame->pVisInstance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 v2->stru1.uNumPointers = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 EnterCriticalSection(&pGame->pThreadWardInstance->cs3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 SuspendThread(*((HANDLE *)v1 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 _46B0ED();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 LeaveCriticalSection(&pGame->pThreadWardInstance->cs3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 MessageBoxW(nullptr, L"DI_Mouse pointer invalid; bailing out from suspend()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MouseAsync.cpp:233", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 // 46B0ED: using guessed type int __thiscall AsyncMouse__46B0ED(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 //----- (0046B1DD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 char AsyncMouse::_46B1DD()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 *((char *)this + 20) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 Sleep(118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 //----- (0046B1EC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 bool AsyncMouse::DrawCursor(Texture *a1, IDirectDrawSurface4 *a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 unsigned __int16 *v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 unsigned __int8 *v6; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 int v7; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 int v8; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 LPVOID v9; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 DDSURFACEDESC2 Dst; // [sp+0h] [bp-84h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 __int32 v12; // [sp+7Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 int v13; // [sp+80h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 result = pRenderer->LockSurface_DDraw4(a2, &Dst, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 v5 = a1->pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 v6 = a1->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 v7 = a1->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 v8 = a1->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 v9 = Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 v12 = 2 * (Dst.lPitch / 2 - v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 v13 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 if ( v5[*v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 *(short *)v9 = v5[*v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 v9 = (char *)v9 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 --v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 while ( v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 v9 = (char *)v9 + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 --v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 while ( v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 result = a2->Unlock(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 v6,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 //----- (0046B289) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 bool AsyncMouse::_46B289(int a2, char a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 char v3; // dl@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 bool result; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 char v5; // [sp+2h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 char v6; // [sp+3h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 v3 = *((char *)this + 93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 v6 = *((char *)this + 94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 v5 = *((char *)this + 95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 if ( a3 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 *((char *)this + 93) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 *((char *)this + 99) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 *((char *)this + 99) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 *((char *)this + 93) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 if ( a3 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 *((char *)this + 94) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 *((char *)this + 100) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 *((char *)this + 100) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 *((char *)this + 94) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 if ( a3 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 *((char *)this + 95) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 *((char *)this + 101) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 *((char *)this + 101) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 *((char *)this + 95) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 *((char *)this + 96) = v3 != *((char *)this + 93);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 *((char *)this + 97) = v6 != *((char *)this + 94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 *((char *)this + 98) = v5 != *((char *)this + 95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 if ( *((char *)this + 99) && *((char *)this + 96) || *((char *)this + 100) && *((char *)this + 97) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 *((char *)this + 102) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 //----- (0046B342) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 void AsyncMouse::SetHotspot(float hotspotx, float hotspoty)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 double v3; // ST00_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 double v4; // ST00_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 v3 = hotspotx + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 *(int *)(this + 40) = LODWORD(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 v4 = hotspoty + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 *(int *)(this + 44) = LODWORD(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 //----- (0046B37C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 int AsyncMouse::UpdateData(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 void *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 std::string v6; // [sp-18h] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 const char *v7; // [sp-8h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 int v8; // [sp-4h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 std::string *v9; // [sp+8h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 int a3; // [sp+Fh] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 if ( *((int *)this + 33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 EnterCriticalSection(&pGame->pThreadWardInstance->cs3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 DirectInputMouse::_43BB89(*((DirectInputMouse **)v2 + 33));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 v4 = *((int *)v2 + 33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 v5 = v4 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 _46B289(v4 + 32, *(int *)(v4 + 40));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 LeaveCriticalSection(&pGame->pThreadWardInstance->cs3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 *(int *)a2 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 *(int *)(a2 + 4) = *(int *)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 MessageBoxW(nullptr, L"DI_Mouse pointer invalid bailing out from update_mouse_data()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MouseAsync.cpp:446", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 *(int *)(a2 + 4) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 //----- (0046B420) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 char AsyncMouse::Thread()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 char result; // al@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 int v7; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 int v8; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 if ( *((char *)this + 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 UpdateData((int)&v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 _46BA8D(v7, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 _46B958(v7 - *((int *)v1 + 10), v8 - *((int *)v1 + 11));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 _46B492((int)&v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 _46B5D5((int)&v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v4 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 *((int *)v1 + 6) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 v5 = v3 - *((int *)v1 + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 *((int *)v1 + 7) = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 v6 = v4 - *((int *)v1 + 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 *((int *)v1 + 8) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 *((int *)v1 + 9) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 //----- (0046B492) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 void AsyncMouse::_46B492(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 void *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 int v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 int v9; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 int v10; // [sp+Ch] [bp-1Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 int v11; // [sp+10h] [bp-18h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 int v12; // [sp+14h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 int v13; // [sp+18h] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 int v14; // [sp+24h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 if ( *((int *)v2 + 28) > 0x80u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 _46BCAB((char *)v2 + 104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 if ( *((char *)v2 + 93) && *((char *)v2 + 96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 v4 = *(int *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v5 = *(int *)(a2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v13 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 v10 = 5080884;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 v12 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 AsyncMouse::unk_46BCD2((char *)v2 + 104, (int)&a2, *((int *)v2 + 27), (int)&v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 v14 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 if ( *((char *)v2 + 94) && *((char *)v2 + 97) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 v6 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 v7 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 v13 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v10 = 5080884;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 v11 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 v12 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 AsyncMouse::unk_46BCD2((char *)v2 + 104, (int)&a2, *((int *)v2 + 27), (int)&v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 v14 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 if ( *((char *)v2 + 95) && *((char *)v2 + 98) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 v8 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 v9 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 v13 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 v10 = 5080884;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 v12 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 v14 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 AsyncMouse::unk_46BCD2((char *)v2 + 104, (int)&a2, *((int *)v2 + 27), (int)&v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 //----- (0046B5D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 void AsyncMouse::_46B5D5(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 DWORD v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 char v4; // zf@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 int v9; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 int v10; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 int v11; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 int (__stdcall **v12)(char); // [sp+Ch] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 int v13; // [sp+10h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 int v14; // [sp+14h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 int v15; // [sp+18h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 DWORD v16; // [sp+1Ch] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 int v17; // [sp+28h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 if ( *((int *)v2 + 31) > 0x80u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 _46BCAB((char *)v2 + 116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 v3 = timeGetTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 v4 = *((char *)v2 + 93) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 v16 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 if ( !v4 && *((char *)v2 + 96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 if ( v3 - *((int *)v2 + 19) < 0xFA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 v6 = *(int *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v7 = *(int *)(a2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v12 = &AsyncMouse::unk::vdtor_ptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 v13 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v14 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 AsyncMouse::unk_46BCD2((char *)v2 + 116, (int)&a2, *((int *)v2 + 30), (int)&v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 v17 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 v3 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 *((int *)v2 + 19) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 if ( *((char *)v2 + 94) && *((char *)v2 + 97) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 if ( v3 - *((int *)v2 + 20) < 0xFA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 v8 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 v9 = *(int *)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 v15 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 //v12 = &AsyncMouse::unk::vdtor_ptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 v13 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 v14 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 AsyncMouse::unk_46BCD2((char *)v2 + 116, (int)&a2, *((int *)v2 + 30), (int)&v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 v17 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 v3 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 *((int *)v2 + 20) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 if ( *((char *)v2 + 95) && *((char *)v2 + 98) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 if ( v3 - *((int *)v2 + 21) < 0xFA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 v10 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 v11 = *(int *)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 v15 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 //v12 = &AsyncMouse::unk::vdtor_ptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 v13 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 v14 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 AsyncMouse::unk_46BCD2((char *)v2 + 116, (int)&a2, *((int *)v2 + 30), (int)&v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 v3 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 *((int *)v2 + 21) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 //----- (0046B736) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 void AsyncMouse::_46B736_consume_click_lists(char a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 _46B76F();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 _46B879();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 _46BCAB((char *)v2 + 104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 _46BCAB((char *)v2 + 116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 if ( *((char *)v2 + 102) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 back_to_game();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 *((char *)v2 + 102) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 //----- (0046B76F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 void AsyncMouse::_46B76F()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 unsigned int *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 unsigned int v5; // ST08_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 unsigned int v6; // ST04_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 float v7; // ST00_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 unsigned int v8; // ST08_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 unsigned int v9; // ST04_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 float v10; // ST00_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v0 = (char *)pAsyncMouse + 108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 v1 = *((int *)pAsyncMouse + 27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v2 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 if ( *(int *)v1 != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 v3 = *(int *)(v2 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 v4 = (unsigned int *)(v2 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 if ( v3 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 pGame->PickMouse(512.0, *v4, *(int *)(v2 + 16), 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 if ( GetCurrentMenuID() == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 sub_41CD4F(0x29u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 UI_OnMouseLeftClick((int *)(v2 + 12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 if ( v3 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 v5 = *(int *)(v2 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v6 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 v7 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 pGame->PickMouse(v7, v6, v5, 0, &stru_F93E30, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62((Vec2_int_ *)(v2 + 12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 if ( v3 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 v8 = *(int *)(v2 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 v9 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 v10 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 pGame->PickMouse(v10, v9, v8, 1, &a3, &a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 v2 = *(int *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 while ( v2 != *(int *)v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 //----- (0046B879) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 void AsyncMouse::_46B879()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 unsigned int *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 unsigned int v5; // ST08_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 unsigned int v6; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 float v7; // ST00_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 v0 = (char *)pAsyncMouse + 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 v1 = *((int *)pAsyncMouse + 30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 v2 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 if ( *(int *)v1 != v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 v3 = *(int *)(v2 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 v4 = (unsigned int *)(v2 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 if ( v3 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 pGame->PickMouse(512.0, *v4, *(int *)(v2 + 16), 0, &a3, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 sub_4178C4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 if ( v3 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 v5 = *(int *)(v2 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 v6 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 v7 = GetPickDepth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 pGame->PickMouse(v7, v6, v5, 0, &stru_F93E30, &a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 sub_4178E1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 if ( v3 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 nullsub_1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 v2 = *(int *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 while ( v2 != *(int *)v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 //----- (0046B944) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 int AsyncMouse::_46B944()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 _46BCAB((char *)this + 104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 return _46BCAB((char *)v1 + 116);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 // 46BCAB: using guessed type int __thiscall AsyncMouse__46BCAB(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 //----- (0046B958) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 char AsyncMouse::_46B958(int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 void *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 int v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 struct IDirectDrawSurface4 *v10; // ST08_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 DDBLTFX v11; // [sp+4h] [bp-74h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 RECT v12; // [sp+68h] [bp-10h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 if ( pRenderer->pFrontBuffer4 && !pRenderer->pFrontBuffer4->IsLost() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 EnterCriticalSection(&pGame->pThreadWardInstance->cs2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 if ( *((char *)v3 + 88) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 pRenderer->pFrontBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 *((int *)v3 + 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 *((int *)v3 + 9),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 (LPDIRECTDRAWSURFACE4)*((int *)v3 + 2),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 (LPRECT)((char *)v3 + 48),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 16u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 v5 = 640 - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 v6 = 640 - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 if ( 640 - a2 >= 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 if ( v5 >= 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 v5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 v7 = 480 - a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 if ( 480 - a3 >= 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 v8 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 v8 = 480 - a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 if ( v8 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 if ( v7 >= 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 *((int *)v3 + 13) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 *((int *)v3 + 14) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v12.right = a2 + v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 *((int *)v3 + 12) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 *((int *)v3 + 15) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 v12.left = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 v12.bottom = a3 + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v9 = *((int *)v3 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 v12.top = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 (*(void (__stdcall **)(int, int, int, IDirectDrawSurface4 *, RECT *, signed int))(*(int *)v9 + 28))(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 pRenderer->pFrontBuffer4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 &v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 if ( !*((char *)v3 + 90) || *((char *)v3 + 128) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 v10 = (struct IDirectDrawSurface4 *)*((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v11.dwSize = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v11.dwDDFX = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 pRenderer->pFrontBuffer4->Blt(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 &v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 (LPRECT)((char *)v3 + 48),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 16812032u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 &v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 *((char *)v3 + 88) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 LeaveCriticalSection(&pGame->pThreadWardInstance->cs2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 //----- (0046BA8D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 char AsyncMouse::_46BA8D(int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 void *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 DWORD v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 v4 = timeGetTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 if ( v4 - *((int *)v3 + 16) <= 0x32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 *((char *)v3 + 91) = *((char *)v3 + 90) == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 *((char *)v3 + 90) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 if ( *((char *)v3 + 90) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 *((char *)v3 + 91) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 *((char *)v3 + 91) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 *((char *)v3 + 90) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 if ( a2 != *((int *)v3 + 17) || a3 != *((int *)v3 + 18) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 *((int *)v3 + 16) = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 *((int *)v3 + 17) = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 *((int *)v3 + 18) = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 return *((char *)v3 + 90);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 //----- (0046BAEC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 void AsyncMouse::_46BAEC()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 EnterCriticalSection(&pGame->pThreadWardInstance->cs2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 *((char *)v1 + 88) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 //----- (0046BB0A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 void AsyncMouse::_46BB0A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 char v7; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 struct IDirectDrawSurface4 *v8; // ST08_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 int v9; // [sp+8h] [bp-74h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 int v10; // [sp+Ch] [bp-70h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 int v11; // [sp+6Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 int v12; // [sp+70h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 int v13; // [sp+74h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 int v14; // [sp+78h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 v2 = *((int *)this + 17) - *((int *)this + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 v3 = *((int *)this + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 v4 = *((int *)this + 18) - *((int *)this + 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 v11 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v5 = v2 + v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 v6 = *((int *)v1 + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v12 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 v7 = *((char *)v1 + 90) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 v14 = v4 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 if ( v7 || *((char *)v1 + 128) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 if ( *((char *)v1 + 88) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 pRenderer->pFrontBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 *((int *)v1 + 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 *((int *)v1 + 9),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 (LPDIRECTDRAWSURFACE4)*((int *)v1 + 2),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 (LPRECT)((char *)v1 + 48),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 16u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 (*(void (__stdcall **)(int, int, int, IDirectDrawSurface4 *, int *, signed int))(**((int **)v1 + 2) + 28))(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 *((int *)v1 + 2),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 pRenderer->pFrontBuffer4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 &v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 if ( *((char *)v1 + 90) && !(*((char *)v1 + 128) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 v8 = (struct IDirectDrawSurface4 *)*((int *)v1 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 v9 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v10 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 pRenderer->pFrontBuffer4->Blt(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 (LPRECT)&v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 v8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 (LPRECT)((char *)v1 + 48),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 16812032u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 (LPDDBLTFX)&v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 LeaveCriticalSection(&pGame->pThreadWardInstance->cs2);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 //----- (0046BBD0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 void *AsyncMouse::Clip()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 std::string v1; // [sp-18h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 const char *v2; // [sp-8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 int v3; // [sp-4h] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 RECT Rect; // [sp+0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 std::string *v5; // [sp+10h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 int a3; // [sp+17h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 SetWindowPos(hWnd, HWND_MESSAGE|0x2, 320, 240, 640, 480, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 Rect.left = 325;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 Rect.top = 245;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 Rect.right = 326;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 Rect.bottom = 246;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 result = (void *)ClipCursor(&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 MessageBoxW(nullptr, L"Could not clip cursor to screen!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MouseAsync.cpp:827", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 //----- (0046BC4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 void __stdcall AsyncMouse::AsyncMouseThread(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 while ( !pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 Sleep(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 if ( !AsyncMouse::Thread(pAsyncMouse) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 ExitThread(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 Sleep(18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 //----- (0046BC73) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 void AsyncMouse::dtor_sub_46BC73()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 void **v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 void *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 void *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 int v5; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 v5 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 v2 = *(void ***)(this + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 while ( v3 != v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 v3 = *(void **)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 AsyncMouse::unk_46BD2D((void *)v1, (int)&v5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 free(*(void **)(v1 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 *(int *)(v1 + 4) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 *(int *)(v1 + 8) = 0;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 //----- (0046BCAB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 int AsyncMouse::_46BCAB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 void *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 void **v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 void *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 void *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 int v6; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 v1 = (void *)this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 v2 = *(void ***)(this + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 while ( v3 != v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v3 = *(void **)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 result = AsyncMouse::unk_46BD2D(v1, (int)&v6, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 // 46BCAB: using guessed type int __thiscall AsyncMouse__46BCAB(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 //----- (0046BCD2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 int AsyncMouse::unk_46BCD2(int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 void *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 void *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 void *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v5 = AsyncMouse::unk_46BD09((void *)a3, *(void **)(a3 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 *(int *)(a3 + 4) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 **((int **)v5 + 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 AsyncMouse::unk_46BD66((char *)v5 + 8, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 ++*((int *)v4 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 *(int *)a2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 // 46BD66: using guessed type int __fastcall AsyncMouse__unk__46BD66(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 //----- (0046BD09) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 void *AsyncMouse::unk_46BD09(void *a1, void *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 void *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 void *v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 void *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 result = operator new(0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 v3 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 *(int *)result = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 if ( !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 *((int *)result + 1) = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 //----- (0046BD2D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 int AsyncMouse::unk_46BD2D(int a2, void *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 void *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 v4 = *(int *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 **((int **)a3 + 1) = *(int *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 *(int *)(*(int *)a3 + 4) = *((int *)a3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 (**((void (__stdcall ***)(int))a3 + 2))(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 free(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 --*((int *)v3 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 *(int *)a2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 //----- (0046BD66) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 int AsyncMouse::unk_46BD66(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 *(int *)(a1 + 4) = *(int *)(a2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 *(int *)(a1 + 8) = *(int *)(a2 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 result = *(int *)(a2 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 *(int *)(a1 + 12) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 //*(int *)a1 = &AsyncMouse::unk::vdtor_ptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 // 46BD66: using guessed type int __fastcall AsyncMouse__unk__46BD66(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 // 4D8734: using guessed type int (__stdcall *AsyncMouse__unk__vdtor_ptr)(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 //----- (0043B9FF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 DirectInputMouse *__thiscall DirectInputMouse::DirectInputMouse(DirectInputMouse *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 DirectInputMouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 HRESULT v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 signed int v4; // [sp-18h] [bp-24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 char *v5; // [sp-14h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 int v6; // [sp-10h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 const char *v7; // [sp-Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 int v8; // [sp-8h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 unsigned int v9; // [sp-4h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 CheckHRESULT_stru0 v10; // [sp+8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 this->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 LOBYTE(this->field_1C) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 this->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 this->vdestructor_ptr = (int)&DirectInputMouse_pvdtor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 v8 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 v5 = (char *)&this->pDirectInput;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 v4 = 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 v8 = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 v7 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v5 = (char *)&this->pDirectInput;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v4 = 768;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v2 = DirectInputCreateA(hInstance, v4, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 CheckHRESULT(&v10, v2, v7, v8, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 DirectInputMouse::CreateDevice(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 DirectInputMouse::43BB18(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 v1->field_24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 // 4C8880: using guessed type int __stdcall DirectInputCreateA(int, int, int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 // 4D8608: using guessed type int (__stdcall *DirectInputMouse_pvdtor)(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 //----- (0043BA80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 void *__thiscall DirectInputMouse::vdtor(void *this, bool a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 void *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 DirectInputMouse::dtor(this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 if ( a2 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 free(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 //----- (0043BA9C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 int __thiscall DirectInputMouse::dtor(void *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 void *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 v2 = *((int *)this + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 *(int *)this = &DirectInputMouse_pvdtor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 (*(void (__stdcall **)(int))(*(int *)v2 + 32))(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 (*(void (__stdcall **)(int))(**((int **)v1 + 2) + 8))(*((int *)v1 + 2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 *((int *)v1 + 2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 result = (*(int (__stdcall **)(int))(**((int **)v1 + 1) + 8))(*((int *)v1 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 *((int *)v1 + 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 // 4D8608: using guessed type int (__stdcall *DirectInputMouse_pvdtor)(char);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 //----- (0043BACE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 void __thiscall DirectInputMouse::CreateDevice(DirectInputMouse *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 DirectInputMouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 HRESULT v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 CheckHRESULT_stru0 v3; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 v2 = ((int (__stdcall *)(int, int, int, int, int))this->pDirectInput->lpVtbl->field_10)(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 this->pDirectInput,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 DirectInputMouse_enumerator,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 CheckHRESULT(&v3, v2, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp", 57, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 if ( !LOBYTE(v1->field_1C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 v3.vdestructor_ptr = (void (__thiscall ***)(CheckHRESULT_stru0 *, bool))"Error: No mouse found";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 _CxxThrowException((int)&v3, (int)&dword_4DBD94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 // 43BC61: using guessed type int __stdcall DirectInputMouse_enumerator(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 // 4DBD94: using guessed type int dword_4DBD94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 //----- (0043BB18) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 int __thiscall DirectInputMouse::43BB18(DirectInputMouse *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 HRESULT v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 HRESULT v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 HRESULT v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 unsigned int v6; // [sp+0h] [bp-Ch]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 CheckHRESULT_stru0 v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v1 = (char *)&this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 v2 = ((int (__stdcall *)(int, int, int, int, int))this->pDirectInput->lpVtbl->field_C)(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 this->pDirectInput,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 &this->field_C,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 &this->field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 CheckHRESULT(&v7, v2, (const char *)0x40, 1, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 v3 = (*(int (__stdcall **)(int, int))(**(int **)v1 + 44))(*(int *)v1, dword_4C9920);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 CheckHRESULT(&v7, v3, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp", 65, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v4 = (*(int (__stdcall **)(int, int, int))(**(int **)v1 + 52))(*(int *)v1, hWnd, 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 CheckHRESULT(&v7, v4, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp", 66, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 return (*(int (__cdecl **)(int))(**(int **)v1 + 28))(*(int *)v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 // 4C9920: using guessed type int dword_4C9920[16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 //----- (0043BB89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 bool __thiscall DirectInputMouse::43BB89(DirectInputMouse *this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 DirectInputMouse *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 HRESULT v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 __int32 v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 __int32 v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 __int32 v6; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 bool v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 signed int v9; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 HRESULT a2; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 int v11; // [sp+8h] [bp-10h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 char v12; // [sp+10h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 char v13; // [sp+11h] [bp-7h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 char v14; // [sp+12h] [bp-6h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 char v15; // [sp+13h] [bp-5h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 char v18; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 result = this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 if ( (*(int (__stdcall **)(bool, signed int, HRESULT *))(*(int *)result + 36))(result, 16, &a2) == -2147024866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 && !(*(int (__stdcall **)(int))(*(int *)v1->field_8 + 28))(v1->field_8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 v3 = (*(int (__stdcall **)(int, signed int, HRESULT *))(*(int *)v1->field_8 + 36))(v1->field_8, 16, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 CheckHRESULT((CheckHRESULT_stru0 *)&v18, v3, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\DirectInputMouse.cpp", 80, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 v4 = v1->field_20 + a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 v5 = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 v6 = v1->field_20 + a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 if ( v4 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 v6 = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 if ( v4 < 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 v5 = v1->field_20 + a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 v7 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 v1->field_20 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v8 = v1->field_24 + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 result = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 if ( v8 >= 480 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 v9 = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 if ( v9 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 if ( v8 < 480 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v1->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 v1->field_24 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 if ( v12 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 v1->field_28 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 if ( v13 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 v1->field_28 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 if ( v14 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 v1->field_28 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 if ( v15 & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 v1->field_28 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 LOBYTE(result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 //----- (0043BC61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 signed int __stdcall DirectInputMouse_enumerator(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 if ( *(char *)(a1 + 36) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 *(int *)(a2 + 12) = *(int *)(a1 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 *(int *)(a2 + 16) = *(int *)(a1 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 *(int *)(a2 + 20) = *(int *)(a1 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 *(int *)(a2 + 24) = *(int *)(a1 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 *(char *)(a2 + 28) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 // 43BC61: using guessed type int __stdcall DirectInputMouse_enumerator(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 */