annotate Keyboard.cpp @ 2418:86357e382e33

leaks
author zipi
date Tue, 22 Jul 2014 16:36:18 +0100
parents f4af3b203f65
children d922225a6081
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2201
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
6 #include "Keyboard.h"
Ritor1
parents:
diff changeset
7 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
8 #include "Game.h"
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10 #include "mm7_data.h"
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
11 #include "Vis.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
12 #include "MM7.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
13 #include "Actor.h"
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
14 #include "Party.h"
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
15 #include "Timer.h"
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
16 #include "TurnEngine.h"
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
17 #include "Weather.h"
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
18 #include "CastSpellInfo.h"
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
19 #include "DecorationList.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
20 #include "Indoor.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
21 #include "viewport.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
22 #include "AudioPlayer.h"
2341
d6407efaa4ea Moving registry access stuff to Registry.h/cpp
Grumpy7
parents: 2334
diff changeset
23 #include "Registry.h"
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1459
diff changeset
24 #include "Level/Decoration.h"
0
Ritor1
parents:
diff changeset
25
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
26 #include <tuple>
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
27 #include <vector>
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
28 #include <string>
0
Ritor1
parents:
diff changeset
29
Ritor1
parents:
diff changeset
30 struct KeyboardActionMapping *pKeyActionMap;
Ritor1
parents:
diff changeset
31
Ritor1
parents:
diff changeset
32
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
33 class CKeyListElement{
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
34 public:
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
35 std::string m_keyName;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
36 unsigned char m_keyDefaultCode;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
37 unsigned short m_cmdId;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
38 KeyToggleType m_toggType;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
39 CKeyListElement(std::string keyName, unsigned char keyDefaultCode, unsigned short cmdId, KeyToggleType toggType):
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
40 m_keyName(keyName),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
41 m_keyDefaultCode(keyDefaultCode),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
42 m_cmdId(cmdId),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
43 m_toggType(toggType)
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
44 {
0
Ritor1
parents:
diff changeset
45
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
46 }
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
47 };
0
Ritor1
parents:
diff changeset
48
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
49 std::array<CKeyListElement, 30>keyMappingParams = {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
50 CKeyListElement("KEY_FORWARD", VK_UP, INPUT_MoveForward, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
51 CKeyListElement("KEY_BACKWARD", VK_DOWN, INPUT_MoveBackwards, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
52 CKeyListElement("KEY_LEFT", VK_LEFT, INPUT_TurnLeft, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
53 CKeyListElement("KEY_RIGHT", VK_RIGHT, INPUT_TurnRight, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
54 CKeyListElement("KEY_ATTACK", 'A', INPUT_Attack, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
55 CKeyListElement("KEY_CASTREADY", 'S', INPUT_CastReady, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
56 CKeyListElement("KEY_YELL", 'Y', INPUT_Yell, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
57 CKeyListElement("KEY_JUMP", 'X', INPUT_Jump, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
58 CKeyListElement("KEY_COMBAT", VK_RETURN, INPUT_Combat, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
59 CKeyListElement("KEY_EVENTTRIGGER", VK_SPACE, INPUT_EventTrigger, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
60 CKeyListElement("KEY_CAST", 'C', INPUT_Cast, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
61 CKeyListElement("KEY_PASS", 'B', INPUT_Pass, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
62 CKeyListElement("KEY_CHARCYCLE", VK_TAB, INPUT_CharCycle, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
63 CKeyListElement("KEY_QUEST", 'Q', INPUT_Quest, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
64 CKeyListElement("KEY_QUICKREF", 'Z', INPUT_QuickRef, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
65 CKeyListElement("KEY_REST", 'R', INPUT_Rest, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
66 CKeyListElement("KEY_TIMECAL", 'T', INPUT_TimeCal, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
67 CKeyListElement("KEY_AUTONOTES", 'N', INPUT_Autonotes, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
68 CKeyListElement("KEY_MAPBOOK", 'M', INPUT_Mapbook, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
69 CKeyListElement("KEY_LOOKUP", VK_NEXT, INPUT_LookUp, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
70 CKeyListElement("KEY_LOOKDOWN", VK_DELETE, INPUT_LookDown, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
71 CKeyListElement("KEY_CENTERVIEWPT", VK_END, INPUT_CenterView, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
72 CKeyListElement("KEY_ZOOMIN", VK_ADD, INPUT_ZoomIn, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
73 CKeyListElement("KEY_ZOOMOUT", VK_SUBTRACT, INPUT_ZoomOut, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
74 CKeyListElement("KEY_FLYUP", VK_PRIOR, INPUT_FlyUp, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
75 CKeyListElement("KEY_FLYDOWN", VK_INSERT, INPUT_FlyDown, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
76 CKeyListElement("KEY_LAND", VK_HOME, INPUT_Land, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
77 CKeyListElement("KEY_ALWAYSRUN", 'U', INPUT_AlwaysRun, TOGGLE_OneTimePress),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
78 CKeyListElement("KEY_STEPLEFT", VK_OEM_4, INPUT_StrafeLeft, TOGGLE_Continuously),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
79 CKeyListElement("KEY_STEPRIGHT", VK_OEM_6, INPUT_StrafeRight, TOGGLE_Continuously)
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
80 };
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
81
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
82 std::array<std::tuple<const char*, const unsigned __int8>, 26> keyNameToCodeTranslationMap =
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
83 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
84 std::tuple<const char*, const unsigned __int8>("UP", VK_UP),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
85 std::tuple<const char*, const unsigned __int8>("DOWN", VK_DOWN),
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
86 std::tuple<const char*, const unsigned __int8>("LEFT", VK_LEFT),
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
87 std::tuple<const char*, const unsigned __int8>("бкебн", VK_LEFT),
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
88 std::tuple<const char*, const unsigned __int8>("RIGHT", VK_RIGHT),
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
89 std::tuple<const char*, const unsigned __int8>("бопюбн", VK_RIGHT),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
90 std::tuple<const char*, const unsigned __int8>("RETURN", VK_RETURN),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
91 std::tuple<const char*, const unsigned __int8>("SPACE", VK_SPACE),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
92 std::tuple<const char*, const unsigned __int8>("PAGE_DOWN", VK_NEXT),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
93 std::tuple<const char*, const unsigned __int8>("PAGE_UP", VK_PRIOR),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
94 std::tuple<const char*, const unsigned __int8>("TAB", VK_TAB),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
95 std::tuple<const char*, const unsigned __int8>("SUBTRACT", VK_SUBTRACT),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
96 std::tuple<const char*, const unsigned __int8>("ADD", VK_ADD),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
97 std::tuple<const char*, const unsigned __int8>("END", VK_END),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
98 std::tuple<const char*, const unsigned __int8>("DELETE", VK_DELETE),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
99 std::tuple<const char*, const unsigned __int8>("HOME", VK_HOME),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
100 std::tuple<const char*, const unsigned __int8>("INSERT", VK_INSERT),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
101 std::tuple<const char*, const unsigned __int8>("COMMA", VK_OEM_COMMA),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
102 std::tuple<const char*, const unsigned __int8>("DECIMAL", VK_DECIMAL),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
103 std::tuple<const char*, const unsigned __int8>("SEMICOLON", VK_OEM_1),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
104 std::tuple<const char*, const unsigned __int8>("PERIOD", VK_OEM_PERIOD),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
105 std::tuple<const char*, const unsigned __int8>("SLASH", VK_OEM_2),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
106 std::tuple<const char*, const unsigned __int8>("SQUOTE", VK_OEM_7),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
107 std::tuple<const char*, const unsigned __int8>("BACKSLASH", VK_OEM_5),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
108 std::tuple<const char*, const unsigned __int8>("BACKSPACE", VK_BACK),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
109 std::tuple<const char*, const unsigned __int8>("CONTROL", VK_CONTROL),
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
110 };
0
Ritor1
parents:
diff changeset
111
Ritor1
parents:
diff changeset
112 //----- (00459C68) --------------------------------------------------------
Ritor1
parents:
diff changeset
113 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey, KeyToggleType type)
Ritor1
parents:
diff changeset
114 {
Ritor1
parents:
diff changeset
115 pVirtualKeyCodesMapping[uAction] = vKey;
Ritor1
parents:
diff changeset
116 pToggleTypes[uAction] = type;
Ritor1
parents:
diff changeset
117 }
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 //----- (00459C82) --------------------------------------------------------
Ritor1
parents:
diff changeset
120 unsigned int KeyboardActionMapping::GetActionVKey(enum InputAction eAction)
Ritor1
parents:
diff changeset
121 {
Ritor1
parents:
diff changeset
122 return this->pVirtualKeyCodesMapping[eAction];
Ritor1
parents:
diff changeset
123 }
Ritor1
parents:
diff changeset
124
Ritor1
parents:
diff changeset
125 //----- (00459C8D) --------------------------------------------------------
Ritor1
parents:
diff changeset
126 KeyboardActionMapping::KeyboardActionMapping()
Ritor1
parents:
diff changeset
127 {
Ritor1
parents:
diff changeset
128 uLastKeyPressed = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 164
diff changeset
129 field_204 = 0;
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 271
diff changeset
130 pWindow = nullptr;
0
Ritor1
parents:
diff changeset
131
Ritor1
parents:
diff changeset
132 SetDefaultMapping();
Ritor1
parents:
diff changeset
133 ReadMappings();
Ritor1
parents:
diff changeset
134
Ritor1
parents:
diff changeset
135 ResetKeys();
Ritor1
parents:
diff changeset
136
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
137 uGameMenuUI_CurentlySelectedKeyIdx = -1;
0
Ritor1
parents:
diff changeset
138 }
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
139 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
0
Ritor1
parents:
diff changeset
140
Ritor1
parents:
diff changeset
141 //----- (00459CC4) --------------------------------------------------------
Ritor1
parents:
diff changeset
142 void KeyboardActionMapping::SetDefaultMapping()
Ritor1
parents:
diff changeset
143 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
144 for ( size_t i = 0; i < keyMappingParams.size(); i++)
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
145 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
146 SetKeyMapping(keyMappingParams[i].m_cmdId, keyMappingParams[i].m_keyDefaultCode, keyMappingParams[i].m_toggType);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
147 }
0
Ritor1
parents:
diff changeset
148 }
Ritor1
parents:
diff changeset
149
Ritor1
parents:
diff changeset
150 //----- (00459E3F) --------------------------------------------------------
Ritor1
parents:
diff changeset
151 void KeyboardActionMapping::ResetKeys()
Ritor1
parents:
diff changeset
152 {
Ritor1
parents:
diff changeset
153 for (uint i = 0; i < 30; ++i)
Ritor1
parents:
diff changeset
154 GetAsyncKeyState(pVirtualKeyCodesMapping[i]);
Ritor1
parents:
diff changeset
155 }
Ritor1
parents:
diff changeset
156
Ritor1
parents:
diff changeset
157 //----- (00459E5A) --------------------------------------------------------
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
158 void KeyboardActionMapping::EnterText(int a2, int max_string_len, GUIWindow *pWindow)
0
Ritor1
parents:
diff changeset
159 {
Ritor1
parents:
diff changeset
160 KeyboardActionMapping *v4; // esi@1
Ritor1
parents:
diff changeset
161
Ritor1
parents:
diff changeset
162 v4 = this;
Ritor1
parents:
diff changeset
163 memset(this->pPressedKeysBuffer, 0, 0x101u);
Ritor1
parents:
diff changeset
164 v4->uNumKeysPressed = 0;
Ritor1
parents:
diff changeset
165 if ( a2 )
Ritor1
parents:
diff changeset
166 v4->field_204 = 2;
Ritor1
parents:
diff changeset
167 else
Ritor1
parents:
diff changeset
168 v4->field_204 = 1;
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
169 v4->max_input_string_len = max_string_len;
0
Ritor1
parents:
diff changeset
170 v4->pWindow = pWindow;
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
171 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_IN_PROGRESS;
0
Ritor1
parents:
diff changeset
172 }
Ritor1
parents:
diff changeset
173
Ritor1
parents:
diff changeset
174 //----- (00459ED1) --------------------------------------------------------
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
175 void KeyboardActionMapping::SetWindowInputStatus(int a2)
0
Ritor1
parents:
diff changeset
176 {
1038
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
177 field_204 = 0;
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
178 if ( pWindow )
39f42990698f Cleanings
Nomad
parents: 1031
diff changeset
179 pWindow->receives_keyboard_input_2 = a2;
0
Ritor1
parents:
diff changeset
180 }
Ritor1
parents:
diff changeset
181
Ritor1
parents:
diff changeset
182 //----- (00459F10) --------------------------------------------------------
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
183 bool KeyboardActionMapping::ProcessTextInput(unsigned int a2)
0
Ritor1
parents:
diff changeset
184 {
Ritor1
parents:
diff changeset
185 pKeyActionMap->uLastKeyPressed = a2;
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
186 if ( uGameMenuUI_CurentlySelectedKeyIdx == -1 )
0
Ritor1
parents:
diff changeset
187 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
188 if ( pKeyActionMap->field_204 != 1 && pKeyActionMap->field_204 != 2 )
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
189 return 0;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
190 if ( a2 == VK_BACK)
0
Ritor1
parents:
diff changeset
191 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
192 if (pKeyActionMap->uNumKeysPressed > 0)
0
Ritor1
parents:
diff changeset
193 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
194 --pKeyActionMap->uNumKeysPressed;
0
Ritor1
parents:
diff changeset
195 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
Ritor1
parents:
diff changeset
196 }
Ritor1
parents:
diff changeset
197 }
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
198 else if ( a2 == VK_RETURN )
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
199 {
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
200 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
201 }
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
202 else if ( a2 == VK_ESCAPE )
0
Ritor1
parents:
diff changeset
203 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
204 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
205 }
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
206 else if (this->uNumKeysPressed < this->max_input_string_len)
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
207 {
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
208 if ( pKeyActionMap->field_204 == 1 )
0
Ritor1
parents:
diff changeset
209 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
210 if ( a2 != VK_TAB )
0
Ritor1
parents:
diff changeset
211 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
212 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
213 ++pKeyActionMap->uNumKeysPressed;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
214 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
0
Ritor1
parents:
diff changeset
215 }
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
216 }
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
217 else if (pKeyActionMap->field_204 == 2)
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
218 {
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
219 if ( isdigit(a2))
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
220 {
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
221 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
222 ++pKeyActionMap->uNumKeysPressed;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
223 }
0
Ritor1
parents:
diff changeset
224 }
Ritor1
parents:
diff changeset
225 }
Ritor1
parents:
diff changeset
226 }
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
227 else
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
228 {
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
229 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
230 ++pKeyActionMap->uNumKeysPressed;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
231 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
232 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
233 }
0
Ritor1
parents:
diff changeset
234 return 1;
Ritor1
parents:
diff changeset
235 }
1031
f93d17337113 UI stuff.
Nomad
parents: 323
diff changeset
236 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
0
Ritor1
parents:
diff changeset
237
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
238
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
239
0
Ritor1
parents:
diff changeset
240 //----- (00459FFC) --------------------------------------------------------
Ritor1
parents:
diff changeset
241 void KeyboardActionMapping::ReadMappings()
Ritor1
parents:
diff changeset
242 {
Ritor1
parents:
diff changeset
243 char str[32];
Ritor1
parents:
diff changeset
244
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
245 for (size_t i = 0; i < keyMappingParams.size(); i++)
0
Ritor1
parents:
diff changeset
246 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
247 const char* keyName = keyMappingParams[i].m_keyName.c_str();
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
248 short commandDefaultKeyCode = keyMappingParams[i].m_keyDefaultCode;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
249 short commandId = keyMappingParams[i].m_cmdId;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
250 KeyToggleType toggType = keyMappingParams[i].m_toggType;
0
Ritor1
parents:
diff changeset
251
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
252 ReadWindowsRegistryString(keyName, str, 32, "DEFAULT");
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
253 if ( strcmp(str, "DEFAULT") && ( TranslateKeyNameToKeyCode(str) != -1) )
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
254 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
255 pVirtualKeyCodesMapping[commandId] = TranslateKeyNameToKeyCode(str);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
256 }
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
257 else
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
258 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
259 pVirtualKeyCodesMapping[commandId] = commandDefaultKeyCode;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
260 }
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
261 pToggleTypes[commandId] = toggType;
0
Ritor1
parents:
diff changeset
262 }
Ritor1
parents:
diff changeset
263
Ritor1
parents:
diff changeset
264 bAlwaysRun = ReadWindowsRegistryInt("valAlwaysRun", 0) != 0;
Ritor1
parents:
diff changeset
265 bFlipOnExit = ReadWindowsRegistryInt("FlipOnExit", 0) != 0;
Ritor1
parents:
diff changeset
266 }
Ritor1
parents:
diff changeset
267
Ritor1
parents:
diff changeset
268 //----- (0045A960) --------------------------------------------------------
Ritor1
parents:
diff changeset
269 void KeyboardActionMapping::StoreMappings()
Ritor1
parents:
diff changeset
270 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
271
0
Ritor1
parents:
diff changeset
272 const char *v2; // eax@1
Ritor1
parents:
diff changeset
273
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
274 for ( size_t i = 0; i < keyMappingParams.size(); i++)
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
275 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
276 v2 = GetVKeyDisplayName(pVirtualKeyCodesMapping[keyMappingParams[i].m_cmdId]);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
277 WriteWindowsRegistryString(keyMappingParams[i].m_keyName.c_str(), v2);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
278 }
0
Ritor1
parents:
diff changeset
279 }
Ritor1
parents:
diff changeset
280
Ritor1
parents:
diff changeset
281 //----- (0045ABCA) --------------------------------------------------------
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
282 const unsigned __int8 KeyboardActionMapping::TranslateKeyNameToKeyCode(const char *Str)
0
Ritor1
parents:
diff changeset
283 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
284 if (strlen(Str) == 1)
0
Ritor1
parents:
diff changeset
285 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
286 if( Str[0] >= 65 && Str[0] <= 90 )
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
287 return *Str;
0
Ritor1
parents:
diff changeset
288 else
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
289 return 0xFF;
0
Ritor1
parents:
diff changeset
290 }
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
291
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
292 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++)
0
Ritor1
parents:
diff changeset
293 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
294 if (!strcmp(Str, std::get<0>(keyNameToCodeTranslationMap[i])))
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
295 return std::get<1>(keyNameToCodeTranslationMap[i]);
0
Ritor1
parents:
diff changeset
296 }
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
297 return 0xFF;
0
Ritor1
parents:
diff changeset
298 }
Ritor1
parents:
diff changeset
299
Ritor1
parents:
diff changeset
300 //----- (0045AE2C) --------------------------------------------------------
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
301 const char * KeyboardActionMapping::GetVKeyDisplayName(unsigned char a1)
0
Ritor1
parents:
diff changeset
302 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
303 static char static_sub_45AE2C_string_69ADE0_keyName[32];
0
Ritor1
parents:
diff changeset
304
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
305 if ( a1 >= 65 && a1 <= 90 )
0
Ritor1
parents:
diff changeset
306 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
307 static_sub_45AE2C_string_69ADE0_keyName[0] = a1;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
308 static_sub_45AE2C_string_69ADE0_keyName[1] = '\0';
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
309 return static_sub_45AE2C_string_69ADE0_keyName;
0
Ritor1
parents:
diff changeset
310 }
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
311
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
312 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++)
0
Ritor1
parents:
diff changeset
313 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
314 if ( a1 == std::get<1>(keyNameToCodeTranslationMap[i]))
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
315 {
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
316 const char* keyName = std::get<0>(keyNameToCodeTranslationMap[i]);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
317 strcpy_s(static_sub_45AE2C_string_69ADE0_keyName, keyName);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
318 return static_sub_45AE2C_string_69ADE0_keyName;
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
319 }
0
Ritor1
parents:
diff changeset
320 }
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
321
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
322 strcpy_s(static_sub_45AE2C_string_69ADE0_keyName, "-мер -");
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
323 return static_sub_45AE2C_string_69ADE0_keyName;
0
Ritor1
parents:
diff changeset
324 }
Ritor1
parents:
diff changeset
325
Ritor1
parents:
diff changeset
326
Ritor1
parents:
diff changeset
327 //----- (0045B019) --------------------------------------------------------
Ritor1
parents:
diff changeset
328 void Keyboard::EnterCriticalSection()
Ritor1
parents:
diff changeset
329 {
Ritor1
parents:
diff changeset
330 }
Ritor1
parents:
diff changeset
331
Ritor1
parents:
diff changeset
332 //----- (0045B06E) --------------------------------------------------------
Ritor1
parents:
diff changeset
333 bool Keyboard::IsShiftHeld()
Ritor1
parents:
diff changeset
334 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
335 return (GetAsyncKeyState(VK_SHIFT) & 0x8001) != 0;
0
Ritor1
parents:
diff changeset
336 }
Ritor1
parents:
diff changeset
337
Ritor1
parents:
diff changeset
338 //----- (0045B0A9) --------------------------------------------------------
Ritor1
parents:
diff changeset
339 bool Keyboard::IsKeyBeingHeld(int vKey)
Ritor1
parents:
diff changeset
340 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
341 return (GetAsyncKeyState(vKey) & 0x8001) != 0;
0
Ritor1
parents:
diff changeset
342 }
Ritor1
parents:
diff changeset
343
Ritor1
parents:
diff changeset
344 //----- (0045B0CE) --------------------------------------------------------
Ritor1
parents:
diff changeset
345 bool Keyboard::WasKeyPressed(int vKey)
Ritor1
parents:
diff changeset
346 {
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2154
diff changeset
347 return (GetAsyncKeyState(vKey) & 1) != 0;
0
Ritor1
parents:
diff changeset
348 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
349 //----- (0046A14B) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
350 void OnPressSpace()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
351 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
352 //SHORT v0; // ax@2
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
353 /*int *v1; // eax@2
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
354 char *v2; // ebx@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
355 unsigned int v3; // esi@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
356 signed int v4; // edi@7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
357 unsigned int v5; // edx@7
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
358 int v6; // ecx@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
359 int v7; // eax@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
360 int v8; // ecx@17
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
361 int *v9; // esi@22
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
362 signed int v10; // ebx@22
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
363 int i; // edi@23
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
364 int v12; // edx@24
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
365 int v13; // ecx@24
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
366 int j; // esi@28
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
367 int v16; // [sp+4h] [bp-1Ch]@0
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
368 char *v17; // [sp+8h] [bp-18h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
369 unsigned int v18; // [sp+Ch] [bp-14h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
370 int v19; // [sp+10h] [bp-10h]@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
371 int *v20; // [sp+14h] [bp-Ch]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
372 int *v21; // [sp+18h] [bp-8h]@7
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
373 int v22; // [sp+1Ch] [bp-4h]@4*/
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
374
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
375 //if ( pRenderer->pRenderD3D )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
376 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
377 pGame->PickKeyboard(Keyboard::IsKeyBeingHeld(VK_CONTROL), &vis_sprite_filter_3, &vis_door_filter);
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1828
diff changeset
378 int pid = pGame->pVisInstance->get_picked_object_zbuf_val();
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
379 if ( pid != -1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
380 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid));
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
381 return;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
382 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
383
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
384
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
385 // software render stuff following
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
386 /*
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
387 static int dword_720660[100]; // 720660
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
388 static int dword_7207F0[100]; // 7207F0
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
389
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
390 v22 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
391 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
392 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
393 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
394 v2 = (char *)v1 - 50;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
395 v1 = (int *)((char *)v1 + 50);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
396 v3 = 640 * viewparams->uScreen_topL_Y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
397 v17 = v2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
398 v20 = v1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
399 v18 = ((viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y - 1) >> 1) + 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
400 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
401 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
402 if ( (signed int)v2 < (signed int)v20 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
403 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
404 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
405 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
406 v4 = v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
407 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
408 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
409 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
410 v6 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
411 v7 = *v1 & 0xFFFF;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
412 v19 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
413 if ( v4 > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
414 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
415 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
416 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
417 if ( dword_7207F0[v6] == v7 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
418 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
419 ++v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
420 v19 = v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
421 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
422 while ( v6 < v22 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
423 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
424 if ( PID_TYPE(v7) == OBJECT_Decoration)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
425 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
426 v16 = (unsigned int)PID_ID(v7);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
427 if ( (signed int)(((unsigned int)*v21 >> 16)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
428 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)PID_ID(v7)].uDecorationDescID].uRadius) <= 512 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
429 if ( v19 == v22 && v4 < 100 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
430 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
431 ++v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
432 ++v4;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
433 v8 = *v21;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
434 dword_7207F0[v4 - 1] = v7;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
435 dword_720660[v4 - 1] = v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
436 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
437 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
438 else if ( (unsigned int)*v21 <= 0x2000000 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
439 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
440 if ( v19 == v22 && v4 < 100 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
441 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
442 ++v22;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
443 ++v4;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
444 v8 = *v21;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
445 dword_7207F0[v4 - 1] = v7;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
446 dword_720660[v4 - 1] = v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
447 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
448 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
449 v1 = v21 + 2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
450 --v5;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
451 v21 += 2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
452 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
453 while ( v5 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
454 v2 = v17;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
455 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
456 v3 += 1280;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
457 --v18;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
458 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
459 while ( v18 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
460 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
461 if ( v22 > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
462 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
463 v9 = dword_720660;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
464 v10 = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
465 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
466 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
467 for ( i = v10; i < v22; ++i )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
468 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
469 v12 = *v9;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
470 v13 = dword_720660[i];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
471 if ( v13 < *v9 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
472 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
473 *v9 = v13;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
474 dword_720660[i] = v12;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
475 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
476 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
477 ++v10;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
478 ++v9;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
479 LOBYTE(v1) = v10 - 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
480 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
481 while ( v10 - 1 < v22 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
482 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
483 for ( j = 0; j < v22; ++j )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
484 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
485 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
486 if ( !(char)v1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
487 break;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
488 }*/
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1262
diff changeset
489 }
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
490
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
491
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
492 //----- (0042FC4E) --------------------------------------------------------
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
493 void Keyboard::ProcessInputActions()
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
494 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
495 char v4; // al@9
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
496 //char v8; // bl@100
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
497 unsigned __int16 v9; // ax@102
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
498 int spell_price; // eax@103
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
499 // char v14; // al@159
ddb803517a48 unused local variables I commented
Ritor1
parents: 2331
diff changeset
500 // unsigned int v15; // eax@168
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
501 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
502 InputAction inputAction; // [sp+0h] [bp-8h]@7
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
503 //int v24; // [sp+4h] [bp-4h]@87
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
504
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
505 pGame->pKeyboardInstance->EnterCriticalSection();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
506 Keyboard* pKeyboard = pGame->pKeyboardInstance;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
507 if (!bAlwaysRun)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
508 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
509 if (pKeyboard->IsShiftHeld())
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
510 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
511 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
512 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
513 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
514 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
515 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
516 if (pKeyboard->IsShiftHeld())
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
517 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
518 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
519 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
520 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
521
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
522 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
523
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
524
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
525 // WUT? double event trigger
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
526 /*for ( uint i = 0; i < 30; ++i )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
527 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
528 if ( pKeyActionMap->pToggleTypes[i] )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
529 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
530 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
531 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
532 if ( v14 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
533 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
534 if (pCurrentScreen == SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
535 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
536 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
537 continue;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
538 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
539 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
540 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
541 v15 = pMessageQueue_50CBD0->uNumMessages;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
542 if ( pMessageQueue_50CBD0->uNumMessages )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
543 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
544 v15 = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
545 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
546 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
547 v15 = 1;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
548 pMessageQueue_50CBD0->uNumMessages = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
549 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
550 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
551 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
552 ++pMessageQueue_50CBD0->uNumMessages;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
553 continue;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
554 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
555 pMessageQueue_50CBD0->uNumMessages = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
556 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
557 //pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
558 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
559 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
560 }*/
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
561 if ( !pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
562 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
563 for ( uint i = 0; i < 30; ++i )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
564 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
565 inputAction = (InputAction)i;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
566 if ( pKeyActionMap->pToggleTypes[inputAction] )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
567 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
568 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
569 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
570 if ( v4 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
571 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
572 switch ( inputAction )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
573 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
574 case INPUT_MoveForward:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
575 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
576 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
577 if (!pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
578 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
579 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
580 partyAction = PARTY_RunForward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
581 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
582 partyAction = PARTY_WalkForward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
583 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
584 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
585 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
586 if (pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
587 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
588 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
589 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
590 partyAction = PARTY_RunForward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
591 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
592 partyAction = PARTY_WalkForward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
593 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
594 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
595 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
596 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
597 case INPUT_MoveBackwards:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
598 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
599 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
600 if (!pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
601 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
602 if ( pParty->uFlags2 & 2 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
603 partyAction = PARTY_RunBackward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
604 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
605 partyAction = PARTY_WalkBackward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
606 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
607 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
608 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
609 if ( pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
610 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
611 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
612 if ( pParty->uFlags2 & 2 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
613 partyAction = PARTY_RunBackward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
614 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
615 partyAction = PARTY_WalkBackward;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
616 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
617 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
618 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
619 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
620 case INPUT_StrafeLeft:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
621 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
622 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
623 if (!pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
624 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
625 partyAction = PARTY_StrafeLeft;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
626 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
627 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
628 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
629 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
630 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
631 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
632 partyAction = PARTY_StrafeLeft;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
633 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
634 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
635 case INPUT_StrafeRight:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
636 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
637 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
638 if (!pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
639 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
640 partyAction = PARTY_StrafeRight;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
641 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
642 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
643 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
644 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
645 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
646 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
647 partyAction = PARTY_StrafeRight;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
648 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
649 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
650 case INPUT_TurnLeft:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
651 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
652 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
653 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
654 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
655 if (pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
656 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
657 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
658 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
659 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
660 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
661 partyAction = PARTY_StrafeLeft;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
662 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
663 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
664 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
665 if ( pParty->uFlags2 & 2 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
666 partyAction = PARTY_FastTurnLeft;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
667 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
668 partyAction = PARTY_TurnLeft;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
669 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
670 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
671 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
672 pWeather->OnPlayerTurn(10);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
673 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
674 case INPUT_TurnRight:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
675 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
676 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
677 if ( GetAsyncKeyState(17) ) // strafing
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
678 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
679 if (pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
680 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
681 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
682 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
683 pTurnEngine->uActionPointsLeft -= 26;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
684 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
685 partyAction = PARTY_StrafeRight;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
686 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
687 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
688 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
689 if ( pParty->uFlags2 & 2 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
690 partyAction = PARTY_FastTurnRight;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
691 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
692 partyAction = PARTY_TurnRight;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
693 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
694 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
695 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
696 pWeather->OnPlayerTurn(-10);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
697 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
698 case INPUT_Jump:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
699 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
700 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
701 partyAction = (PartyAction)12;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
702 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
703 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
704 case INPUT_Yell:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
705 if (!pCurrentScreen && uActiveCharacter)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
706 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
707 pParty->Yell();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
708 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
709 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
710 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
711 case INPUT_Pass:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
712 if ( pCurrentScreen )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
713 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
714 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
715 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
716 pTurnEngine->field_18 |= TE_FLAG_8;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
717 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
718 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
719 if ( uActiveCharacter )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
720 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
721 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
722 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
723 if ( !pParty->bTurnBasedModeOn )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
724 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false) * 2.133333333333333));
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
725 CastSpellInfoHelpers::_427D48();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
726 pTurnEngine->ApplyPlayerAction();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
727 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
728 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
729 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
730 case INPUT_Combat://if press ENTER
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
731 if (pCurrentScreen == SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
732 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
733 if (pParty->bTurnBasedModeOn)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
734 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
735 if (pTurnEngine->turn_stage == TE_MOVEMENT || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
736 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
737 pParty->bTurnBasedModeOn = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
738 pTurnEngine->End(true);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
739 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
740 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
741 else
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
742 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
743 pTurnEngine->Start();
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
744 pParty->bTurnBasedModeOn = true;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
745 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
746 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
747 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
748 case INPUT_CastReady:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
749 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
750 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
751 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
752 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
753 pTurnEngine->field_18 |= TE_FLAG_8;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
754 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
755 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
756 if ( !uActiveCharacter )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
757 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
758 v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)pPlayers[uActiveCharacter]->uQuickSpell / 11 + 12];
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
759 if ( !pPlayers[uActiveCharacter]->uQuickSpell || bUnderwater
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
760 || (( !(HIBYTE(v9) & 1)) ?
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
761 ((v9 & 0x80) == 0 ?
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
762 ((v9 & 0x40) == 0 ? spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uNormalLevelMana : spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uExpertLevelMana) :
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
763 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMasterLevelMana) :
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
764 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMagisterLevelMana,
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
765 spell_price > pPlayers[uActiveCharacter]->sMana) )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
766 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
767 pPartyActionQueue = pPartyActionQueue;
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
768 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
769 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
770 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
771 else
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
772 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastQuickSpell, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
773 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
774 case INPUT_Attack:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
775 if (pCurrentScreen != SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
776 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
777 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
778 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
779 pTurnEngine->field_18 |= TE_FLAG_8;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
780 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
781 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
782 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
783 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
784 case INPUT_EventTrigger:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
785 if (pCurrentScreen == SCREEN_GAME)
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
786 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
787 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
788 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
789 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
790 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
791 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
792 if ( pMessageQueue_50CBD0->uNumMessages )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
793 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
794 pMessageQueue_50CBD0->uNumMessages = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
795 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
796 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
797 pMessageQueue_50CBD0->uNumMessages = 1;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
798 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
799 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
800 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 = 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
801 ++pMessageQueue_50CBD0->uNumMessages;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
802 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
803 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
804 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
805 }
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
806 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
807 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
808 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
809 case INPUT_CharCycle:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
810 if ( pCurrentScreen == SCREEN_SPELL_BOOK )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
811 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
812
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
813 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CycleCharacters, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
814 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
815 case INPUT_LookUp:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
816 if ( pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
817 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
818 partyAction = (PartyAction)7;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
819 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
820 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
821 case INPUT_CenterView:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
822 if ( pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
823 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
824 partyAction = (PartyAction)9;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
825 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
826 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
827 case INPUT_LookDown:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
828 if ( pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
829 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
830 partyAction = (PartyAction)8;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
831 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
832 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
833 case INPUT_FlyUp:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
834 if ( pCurrentScreen || pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
835 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
836 partyAction = (PartyAction)13;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
837 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
838 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
839 case INPUT_Land:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
840 if ( pCurrentScreen || pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
841 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
842 partyAction = (PartyAction)15;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
843 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
844 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
845 case INPUT_FlyDown:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
846 if ( !pCurrentScreen
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
847 && !pEventTimer->bPaused )
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
848 {
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
849 partyAction = (PartyAction)14;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
850 pPartyActionQueue->Add(partyAction);
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
851 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
852 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
853 case INPUT_ZoomIn:
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
854 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomOutBtn, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
855 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
856 case INPUT_ZoomOut:
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2344
diff changeset
857 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomInBtn, 0, 0);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
858 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
859 case INPUT_AlwaysRun:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
860 bAlwaysRun = bAlwaysRun == 0;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
861 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
862 default:
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
863 break;
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
864 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
865 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
866 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
867 }
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2253
diff changeset
868 }