annotate IO/Mouse.h @ 2553:48708da03b7f

Party Creation UI logic separated from MainMenu
author a.parshin
date Wed, 13 May 2015 02:20:05 +0200
parents a77c34acdbc9
children
rev   line source
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
1 #pragma once
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
2 #include "OSWindow.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
3
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
4 #include "Engine/VectorTypes.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
5
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
7
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
8 /* 107 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
9 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
10 class ThreadWard
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
11 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
12 public:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
13 //----- (00438B0B) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
14 inline ThreadWard()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
15 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
16 InitializeCriticalSection(&csAsyncMouse);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
17 InitializeCriticalSection(&cs2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
18 InitializeCriticalSection(&cs3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
19 InitializeCriticalSection(&csAsyncKeyboard);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
20 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
21
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
22 //----- (00438B54) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
23 virtual ~ThreadWard()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
24 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
25 ThreadWard *v1; // esi@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
26
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
27 v1 = this;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
28 //this->vdestructor_ptr = &ThreadWard_destructors;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
29 DeleteCriticalSection(&this->csAsyncKeyboard);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
30 DeleteCriticalSection(&v1->cs3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
31 DeleteCriticalSection(&v1->cs2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
32 DeleteCriticalSection(&v1->csAsyncMouse);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
33 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
34
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
35 void ( ***vdestructor_ptr)(ThreadWard *, bool);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
36 _RTL_CRITICAL_SECTION csAsyncMouse;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
37 _RTL_CRITICAL_SECTION cs2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
38 _RTL_CRITICAL_SECTION cs3;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
39 _RTL_CRITICAL_SECTION csAsyncKeyboard;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
40 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
41 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
42
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
43 /* 106 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
44 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
45 class Mouse
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
46 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
47 public:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
48 //----- (00467E4E) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
49 inline Mouse():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
50 window(nullptr)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
51 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
52 uCursorTextureID = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
53 uCursorTextureID_2 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
54 pCursorBitmap_sysmem = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
55 field_34 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
56 pCursorBitmap2_sysmem = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
57 pCursorBitmap3_sysmembits_16bit = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
58 ptr_90 = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
59 pWard = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
60 *pCurrentCursorName = NULL;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
61 uMouseClickX = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
62 uMouseClickY = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
63 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
64
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
65 void GetClickPos(unsigned int *pX, unsigned int *pY);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
66 void RemoveHoldingItem();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
67 void SetCursorBitmapFromItemID(unsigned int uItemID);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
68 void SetCurrentCursorBitmap();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
69 void SetCursorBitmap(const char *pName);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
70 LONG _469AE4();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
71 void ClearCursor();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
72 void AllocCursorSystemMem();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
73 void *DoAllocCursorMem();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
74 POINT *GetCursorPos(POINT *p);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
75 void Initialize(OSWindow *window);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
76 void SetActive(bool active);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
77 void Deactivate();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
78 void DrawCursor();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
79 void Activate();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
80 void _469E24();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
81 void DrawCursorToTarget();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
82 void ReadCursorWithItem();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
83 void ChangeActivation(int a1);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
84 void SetMouseClick(int x, int y);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
85
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
86 static void UI_OnMouseLeftClick(int *pXY); // idb
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
87 static bool UI_OnKeyDown(unsigned int vkKey);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
88
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
89
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
90 unsigned int uPointingObjectID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
91 unsigned int bActive;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
92 int field_8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
93 int field_C;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
94 unsigned int bInitialized;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
95 unsigned int bRedraw;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
96 int field_18;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
97 int field_1C;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
98 int field_20;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
99 unsigned int uCursorTextureID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
100 unsigned int uCursorTextureID_2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
101 //HWND hWnd;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
102 OSWindow *window;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
103 unsigned __int16 *pCursorBitmap_sysmem;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
104 int field_34;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
105 unsigned __int8 *pCursorBitmap2_sysmem;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
106 unsigned __int16 *pCursorBitmap3_sysmembits_16bit;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
107 int uCursorWithItemX;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
108 int uCursorWithItemY;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
109 int uCursorWithItemW;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
110 int uCursorWithItemZ;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
111 int field_50;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
112 int field_54;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
113 int uCursorBitmapPitch;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
114 int field_5C[13];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
115 void *ptr_90;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
116 int field_94;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
117 int field_98;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
118 int field_9C;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
119 int field_A0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
120 int field_A4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
121 int field_A8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
122 int field_AC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
123 int field_B0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
124 int field_B4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
125 int field_B8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
126 int field_BC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
127 int field_C0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
128 Vec2_int_ pCursorBitmapPos;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
129 int uCursorBitmapWidth;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
130 int uCursorBitmapHeight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
131 int field_D4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
132 int field_D8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
133 int field_DC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
134 int field_E0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
135 Vec4_int_ pCursorBitmapRect;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
136 char field_F4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
137 char pCurrentCursorName[11];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
138 int field_100;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
139 int field_104;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
140 unsigned int uMouseClickX;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
141 unsigned int uMouseClickY;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
142 void/*ThreadWard*/ *pWard;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
143 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
144 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
145
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
146
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
147
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
148
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
149
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
150 extern Mouse *pMouse;