annotate OSWindow.cpp @ 2570:4d199006c716

debug_terrain_polygin
author Ritor1
date Sun, 24 May 2015 20:49:22 +0600
parents d569340b05ff
children a76d408c5132
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
1 #define _CRTDBG_MAP_ALLOC
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2562
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
3 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
4 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
5
1804
Nomad
parents:
diff changeset
6 #include "OSWindow.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
8 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
9
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents: 2475
diff changeset
10 #include "Arcomage\Arcomage.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
11 #include "Media/Audio/AudioPlayer.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
12 #include "IO/Mouse.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2496
diff changeset
13 #include "Engine/Timer.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
14 #include "GUI/GUIWindow.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2496
diff changeset
15 #include "Engine/Party.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents: 2475
diff changeset
16 #include "Engine/Graphics/IndoorCameraD3D.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
17 #include "IO/Keyboard.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents: 2475
diff changeset
18 #include "Engine/Graphics/Viewport.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents: 2475
diff changeset
19 #include "Engine/Graphics/Vis.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
20 #include "Media/Audio/AIL.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2496
diff changeset
21 #include "Engine/Registry.h"
68cdef6879a0 engine folder
Ritor1
parents: 2496
diff changeset
22 #include "Engine/MMT.h"
1804
Nomad
parents:
diff changeset
23
Nomad
parents:
diff changeset
24
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
25 bool wizard_eye = false; // wizard eye always on / включить на постоянно око чародея
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
26 bool change_seasons = false; // toggle seasons change / смена времён года
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
27 bool all_magic = false; // toggle full spellbook / включить всю магию
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
28 bool debug_information = false; // toggle debug info / информация fps, положение группы, уровень пола и т.п.
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
29 bool show_picked_face = false; // highlight picked face / выделить активный фейс
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
30 bool draw_portals_loops = false; // show portal frames / видны рамки порталов
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
31 bool new_speed = false;
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
32 bool bSnow = false;
2320
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
33 bool draw_terrain_dist_mist = false;//новая дальность отрисовки тайлов
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
34 bool no_actors = false; // remove all monsters / убрать всех монстров
2570
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
35 bool lights_flag = true;
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
36 bool debug_lights = false;
2570
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
37 bool debug_terrain_polygin = false;
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
38
1804
Nomad
parents:
diff changeset
39 bool OSWindow::OnMouseLeftClick(int x, int y)
Nomad
parents:
diff changeset
40 {
1815
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
41 if (UIControl::OnMouseLeftClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
42 return true;
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
43
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
44 //if (pMediaPlayer->bPlaying_Movie)
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
45 //pMediaPlayer->bPlaying_Movie = false;
1804
Nomad
parents:
diff changeset
46
Nomad
parents:
diff changeset
47 pMouse->SetMouseClick(x, y);
Nomad
parents:
diff changeset
48
Nomad
parents:
diff changeset
49 if (GetCurrentMenuID() == MENU_CREATEPARTY)
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2336
diff changeset
50 Mouse::UI_OnKeyDown(VK_SELECT);
1804
Nomad
parents:
diff changeset
51
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
52 if (pEngine)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
53 pEngine->PickMouse(512.0, x, y, false, &vis_sprite_filter_3, &vis_door_filter);
1804
Nomad
parents:
diff changeset
54
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2336
diff changeset
55 Mouse::UI_OnMouseLeftClick(0);
1804
Nomad
parents:
diff changeset
56 return true;
Nomad
parents:
diff changeset
57 }
Nomad
parents:
diff changeset
58
Nomad
parents:
diff changeset
59 bool OSWindow::OnMouseRightClick(int x, int y)
Nomad
parents:
diff changeset
60 {
1815
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
61 if (UIControl::OnMouseRightClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
62 return true;
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
63
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
64 if (pMediaPlayer->bPlaying_Movie)
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
65 pMediaPlayer->bPlaying_Movie = false;
1804
Nomad
parents:
diff changeset
66
Nomad
parents:
diff changeset
67 pMouse->SetMouseClick(x, y);
Nomad
parents:
diff changeset
68
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
69 if (pEngine)
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
70 pEngine->PickMouse(pIndoorCameraD3D->GetPickDepth(), x, y, 0, &vis_sprite_filter_2, &vis_door_filter);
1804
Nomad
parents:
diff changeset
71
Nomad
parents:
diff changeset
72 UI_OnMouseRightClick(0);
Nomad
parents:
diff changeset
73 return true;
Nomad
parents:
diff changeset
74 }
Nomad
parents:
diff changeset
75
Nomad
parents:
diff changeset
76
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
77 bool _507B98_ctrl_pressed = false;
1804
Nomad
parents:
diff changeset
78 bool OSWindow::WinApiMessageProc(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result)
Nomad
parents:
diff changeset
79 {
Nomad
parents:
diff changeset
80 switch (msg)
Nomad
parents:
diff changeset
81 {
Nomad
parents:
diff changeset
82 case WM_KEYUP:
Nomad
parents:
diff changeset
83 {
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
84 if (wparam == VK_CONTROL)
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
85 _507B98_ctrl_pressed = false;
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
86 if (wparam == VK_SNAPSHOT)
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
87 pRenderer->SavePCXScreenshot();
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
88
1804
Nomad
parents:
diff changeset
89 OnKey(wparam);
Nomad
parents:
diff changeset
90 return *result = 0, true;
Nomad
parents:
diff changeset
91 }
Nomad
parents:
diff changeset
92
Nomad
parents:
diff changeset
93 case WM_SIZING: return *result = 1, true;
Nomad
parents:
diff changeset
94 case WM_WINDOWPOSCHANGED:
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
95 //if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
96 //BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
1804
Nomad
parents:
diff changeset
97 return false;
Nomad
parents:
diff changeset
98
Nomad
parents:
diff changeset
99 case WM_CHAR:
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2187
diff changeset
100 if (!pKeyActionMap->ProcessTextInput(wparam) && !viewparams->field_4C)
1804
Nomad
parents:
diff changeset
101 GUI_HandleHotkey(wparam);
Nomad
parents:
diff changeset
102 return false;
Nomad
parents:
diff changeset
103
Nomad
parents:
diff changeset
104 case WM_DESTROY:
Nomad
parents:
diff changeset
105 ExitProcess(GetLastError());
Nomad
parents:
diff changeset
106 // SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
Nomad
parents:
diff changeset
107 // PostQuitMessage(0);
Nomad
parents:
diff changeset
108 // return 0;
Nomad
parents:
diff changeset
109
Nomad
parents:
diff changeset
110 //case WM_DEVICECHANGE:
Nomad
parents:
diff changeset
111 //{
Nomad
parents:
diff changeset
112 // if (wParam == 0x8000) // CD or some device has been inserted - notify InsertCD dialog
Nomad
parents:
diff changeset
113 // PostMessageW(hInsertCDWindow, WM_USER + 1, 0, 0);
Nomad
parents:
diff changeset
114 // return 0;
Nomad
parents:
diff changeset
115 //}
Nomad
parents:
diff changeset
116
Nomad
parents:
diff changeset
117 case WM_COMMAND:
Nomad
parents:
diff changeset
118 if (OnOSMenu(wparam))
Nomad
parents:
diff changeset
119 return *result = 0, true;
Nomad
parents:
diff changeset
120 return false;
Nomad
parents:
diff changeset
121
Nomad
parents:
diff changeset
122 case WM_LBUTTONDOWN:
Nomad
parents:
diff changeset
123 {
Nomad
parents:
diff changeset
124 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
125 {
Nomad
parents:
diff changeset
126 pArcomageGame->stru1.field_0 = 7;
Nomad
parents:
diff changeset
127 ArcomageGame::OnMouseClick(0, true);
Nomad
parents:
diff changeset
128 return false;
Nomad
parents:
diff changeset
129 }
Nomad
parents:
diff changeset
130
Nomad
parents:
diff changeset
131 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
132 }
Nomad
parents:
diff changeset
133 return false;
Nomad
parents:
diff changeset
134
Nomad
parents:
diff changeset
135
Nomad
parents:
diff changeset
136 case WM_RBUTTONDOWN:
Nomad
parents:
diff changeset
137 {
Nomad
parents:
diff changeset
138 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
139 {
Nomad
parents:
diff changeset
140 pArcomageGame->stru1.field_0 = 8;
Nomad
parents:
diff changeset
141 ArcomageGame::OnMouseClick(1, true);
Nomad
parents:
diff changeset
142 return false;
Nomad
parents:
diff changeset
143 }
Nomad
parents:
diff changeset
144
Nomad
parents:
diff changeset
145 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
146 }
Nomad
parents:
diff changeset
147 return false;
Nomad
parents:
diff changeset
148
Nomad
parents:
diff changeset
149
Nomad
parents:
diff changeset
150 case WM_LBUTTONUP:
Nomad
parents:
diff changeset
151 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
152 {
Nomad
parents:
diff changeset
153 back_to_game();
Nomad
parents:
diff changeset
154 return false;
Nomad
parents:
diff changeset
155 }
Nomad
parents:
diff changeset
156 pArcomageGame->stru1.field_0 = 3;
Nomad
parents:
diff changeset
157 ArcomageGame::OnMouseClick(0, 0);
Nomad
parents:
diff changeset
158 return false;
Nomad
parents:
diff changeset
159
Nomad
parents:
diff changeset
160 case WM_RBUTTONUP:
Nomad
parents:
diff changeset
161 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
162 {
Nomad
parents:
diff changeset
163 back_to_game();
Nomad
parents:
diff changeset
164 return false;
Nomad
parents:
diff changeset
165 }
Nomad
parents:
diff changeset
166 pArcomageGame->stru1.field_0 = 4;
Nomad
parents:
diff changeset
167 ArcomageGame::OnMouseClick(1, false);
Nomad
parents:
diff changeset
168 return false;
Nomad
parents:
diff changeset
169
Nomad
parents:
diff changeset
170 case WM_LBUTTONDBLCLK:
Nomad
parents:
diff changeset
171 {
Nomad
parents:
diff changeset
172 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
173 {
Nomad
parents:
diff changeset
174 pArcomageGame->stru1.field_0 = 7;
Nomad
parents:
diff changeset
175 return false;
Nomad
parents:
diff changeset
176 }
Nomad
parents:
diff changeset
177
Nomad
parents:
diff changeset
178 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
179 }
Nomad
parents:
diff changeset
180 return false;
Nomad
parents:
diff changeset
181
Nomad
parents:
diff changeset
182 case WM_RBUTTONDBLCLK:
Nomad
parents:
diff changeset
183 {
Nomad
parents:
diff changeset
184 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
185 {
Nomad
parents:
diff changeset
186 pArcomageGame->stru1.field_0 = 8;
Nomad
parents:
diff changeset
187 return false;
Nomad
parents:
diff changeset
188 }
Nomad
parents:
diff changeset
189
Nomad
parents:
diff changeset
190 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
191 }
Nomad
parents:
diff changeset
192 return false;
Nomad
parents:
diff changeset
193
Nomad
parents:
diff changeset
194 /*case WM_MBUTTONDOWN:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
195 if (pRenderer->pRenderD3D && pEngine)
1804
Nomad
parents:
diff changeset
196 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
197 pEngine->PickMouse(pIndoorCameraD3D->GetPickDepth(), LOWORD(lParam), HIWORD(lParam), 1, &vis_sprite_filter_3, &vis_face_filter);
1804
Nomad
parents:
diff changeset
198 }
Nomad
parents:
diff changeset
199 return false;*/
Nomad
parents:
diff changeset
200
Nomad
parents:
diff changeset
201 case WM_MOUSEMOVE:
Nomad
parents:
diff changeset
202 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
203 {
Nomad
parents:
diff changeset
204 ArcomageGame::OnMouseMove(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
205 ArcomageGame::OnMouseClick(0, wparam == MK_LBUTTON);
Nomad
parents:
diff changeset
206 ArcomageGame::OnMouseClick(1, wparam == MK_RBUTTON);
Nomad
parents:
diff changeset
207 }
Nomad
parents:
diff changeset
208 else if (pMouse)
Nomad
parents:
diff changeset
209 pMouse->SetMouseClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
210 return false;
Nomad
parents:
diff changeset
211
Nomad
parents:
diff changeset
212 case WM_SYSCOMMAND:
Nomad
parents:
diff changeset
213 if ( wparam == SC_SCREENSAVE || wparam == SC_MONITORPOWER )
Nomad
parents:
diff changeset
214 return *result = 0, true;
Nomad
parents:
diff changeset
215 return false;
Nomad
parents:
diff changeset
216
Nomad
parents:
diff changeset
217 case WM_KEYDOWN:
Nomad
parents:
diff changeset
218 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
Nomad
parents:
diff changeset
219 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2187
diff changeset
220 pKeyActionMap->ProcessTextInput(wparam);
1804
Nomad
parents:
diff changeset
221 return false;
Nomad
parents:
diff changeset
222 }
Nomad
parents:
diff changeset
223 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
224 {
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
225 if ( pMediaPlayer->bPlaying_Movie )
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
226 pMediaPlayer->bPlaying_Movie = false;
1804
Nomad
parents:
diff changeset
227 if ( wparam == VK_RETURN )
Nomad
parents:
diff changeset
228 {
Nomad
parents:
diff changeset
229 if ( !viewparams->field_4C )
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2336
diff changeset
230 Mouse::UI_OnKeyDown(wparam);
1804
Nomad
parents:
diff changeset
231 return 0;
Nomad
parents:
diff changeset
232 }
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
233 if (wparam == VK_CONTROL)
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
234 {
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
235 _507B98_ctrl_pressed = true;
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
236 return false;
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
237 }
1804
Nomad
parents:
diff changeset
238 if ( wparam == VK_ESCAPE )
Nomad
parents:
diff changeset
239 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2394
diff changeset
240 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);
1804
Nomad
parents:
diff changeset
241 return 0;
Nomad
parents:
diff changeset
242 }
Nomad
parents:
diff changeset
243 if ( wparam <= VK_HOME )
Nomad
parents:
diff changeset
244 return 0;
Nomad
parents:
diff changeset
245 if ( wparam > VK_DOWN )
Nomad
parents:
diff changeset
246 {
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
247 if ( wparam != VK_F4 || pMovie_Track )
1804
Nomad
parents:
diff changeset
248 return 0;
Nomad
parents:
diff changeset
249
Nomad
parents:
diff changeset
250 // F4 - toggle fullscreen
Nomad
parents:
diff changeset
251 SendMessageW(api_handle, WM_COMMAND, 104, 0);
Nomad
parents:
diff changeset
252 return 0;
Nomad
parents:
diff changeset
253 }
Nomad
parents:
diff changeset
254 if ( wparam >= VK_LEFT && wparam <= VK_DOWN )
Nomad
parents:
diff changeset
255 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
256 if ( current_screen_type != SCREEN_GAME && current_screen_type != SCREEN_MODAL_WINDOW )
1804
Nomad
parents:
diff changeset
257 {
Nomad
parents:
diff changeset
258 if ( !viewparams->field_4C )
2339
63e1388c5463 Moving functions from unsorted_subs.h pt3
Grumpy7
parents: 2336
diff changeset
259 Mouse::UI_OnKeyDown(wparam);
1804
Nomad
parents:
diff changeset
260 return 0;
Nomad
parents:
diff changeset
261 }
Nomad
parents:
diff changeset
262 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
263 if ( current_screen_type != SCREEN_GAME && current_screen_type != SCREEN_MODAL_WINDOW )
1804
Nomad
parents:
diff changeset
264 return 0;
Nomad
parents:
diff changeset
265 }
Nomad
parents:
diff changeset
266
Nomad
parents:
diff changeset
267 pArcomageGame->stru1.field_0 = 1;
Nomad
parents:
diff changeset
268
Nomad
parents:
diff changeset
269 set_stru1_field_8_InArcomage(MapVirtualKey(wparam, MAPVK_VK_TO_CHAR));
Nomad
parents:
diff changeset
270 if ( wparam == 27 )
Nomad
parents:
diff changeset
271 {
Nomad
parents:
diff changeset
272 pArcomageGame->GameOver = 1;
Nomad
parents:
diff changeset
273 pArcomageGame->field_F4 = 1;
2214
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2201
diff changeset
274 pArcomageGame->uGameWinner = 2;
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2201
diff changeset
275 pArcomageGame->Victory_type = -2;
1804
Nomad
parents:
diff changeset
276 return false;
Nomad
parents:
diff changeset
277 }
Nomad
parents:
diff changeset
278 if ( wparam != 114 )
Nomad
parents:
diff changeset
279 {
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
280 if ( wparam == 115 && !pMovie_Track )
1804
Nomad
parents:
diff changeset
281 SendMessage(api_handle, WM_COMMAND, 104, 0);
Nomad
parents:
diff changeset
282 return false;
Nomad
parents:
diff changeset
283 }
Nomad
parents:
diff changeset
284 SendMessageW(api_handle, WM_COMMAND, 103, 0);
Nomad
parents:
diff changeset
285 return *result = 0, true;
Nomad
parents:
diff changeset
286
Nomad
parents:
diff changeset
287 case WM_ACTIVATEAPP:
Nomad
parents:
diff changeset
288 if ( wparam && (GetForegroundWindow() == api_handle || GetForegroundWindow() == hInsertCDWindow) )
Nomad
parents:
diff changeset
289 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
290 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
1804
Nomad
parents:
diff changeset
291 {
Nomad
parents:
diff changeset
292 dword_4E98BC_bApplicationActive = 1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
293 /*if ( pRenderer->bWindowMode )
1804
Nomad
parents:
diff changeset
294 {
Nomad
parents:
diff changeset
295 HDC hDC = GetDC(api_handle);
Nomad
parents:
diff changeset
296 int bitsPerPixel = GetDeviceCaps(hDC, BITSPIXEL);
Nomad
parents:
diff changeset
297 int planes = GetDeviceCaps(hDC, PLANES);
Nomad
parents:
diff changeset
298 ReleaseDC(api_handle, hDC);
Nomad
parents:
diff changeset
299 if (bitsPerPixel != 16 || planes != 1)
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
300 Error(L"%S", pGlobalTXT_LocalizationStrings[62]);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
301 }*/
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
302 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_APP_INACTIVE;
1804
Nomad
parents:
diff changeset
303
Nomad
parents:
diff changeset
304 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
305 {
Nomad
parents:
diff changeset
306 pArcomageGame->field_F9 = 1;
Nomad
parents:
diff changeset
307 }
Nomad
parents:
diff changeset
308 else
Nomad
parents:
diff changeset
309 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
310 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0200_EVENT_TIMER)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
311 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0200_EVENT_TIMER;
1804
Nomad
parents:
diff changeset
312 else
Nomad
parents:
diff changeset
313 pEventTimer->Resume();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
314 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0400_MISC_TIMER)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
315 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0400_MISC_TIMER;
1804
Nomad
parents:
diff changeset
316 else
Nomad
parents:
diff changeset
317 pMiscTimer->Resume();
Nomad
parents:
diff changeset
318
Nomad
parents:
diff changeset
319 viewparams->bRedrawGameUI = true;
2394
2fe8feb3dcd1 pMovie renamed to pMovie_Track and other
Ritor1
parents: 2356
diff changeset
320 if ( pMovie_Track)//pVideoPlayer->pSmackerMovie )
1804
Nomad
parents:
diff changeset
321 {
Nomad
parents:
diff changeset
322 pRenderer->RestoreFrontBuffer();
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2142
diff changeset
323 pRenderer->RestoreBackBuffer();
2453
2a8010d99cf8 _4BF5B2() renamed to BackToHouseMenu()
Ritor1
parents: 2450
diff changeset
324 //BackToHouseMenu();
1804
Nomad
parents:
diff changeset
325 }
Nomad
parents:
diff changeset
326 }
2510
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
327 if ( !bGameoverLoop && !pMovie_Track )//continue an audio track
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
328 {
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
329 if ( use_music_folder )
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
330 alSourcePlay(mSourceID);
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
331 else if ( pAudioPlayer->hAILRedbook )//!pVideoPlayer->pSmackerMovie )
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
332 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
333 }
1804
Nomad
parents:
diff changeset
334 }
Nomad
parents:
diff changeset
335 }
Nomad
parents:
diff changeset
336 else
Nomad
parents:
diff changeset
337 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
338 if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE))
1804
Nomad
parents:
diff changeset
339 {
Nomad
parents:
diff changeset
340 dword_4E98BC_bApplicationActive = 0;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
341 if ( pMovie_Track )
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
342 pMediaPlayer->bPlaying_Movie = true;
1804
Nomad
parents:
diff changeset
343
Nomad
parents:
diff changeset
344 ClipCursor(0);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
345 dword_6BE364_game_settings_1 |= GAME_SETTINGS_APP_INACTIVE;
1804
Nomad
parents:
diff changeset
346 if ( pEventTimer->bPaused )
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
347 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0200_EVENT_TIMER;
1804
Nomad
parents:
diff changeset
348 else
Nomad
parents:
diff changeset
349 pEventTimer->Pause();
Nomad
parents:
diff changeset
350 if ( pMiscTimer->bPaused )
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
351 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0400_MISC_TIMER;
1804
Nomad
parents:
diff changeset
352 else
Nomad
parents:
diff changeset
353 pMiscTimer->Pause();
Nomad
parents:
diff changeset
354
2423
1b6bf88f561b fixing some memory access errors
Grumpy7
parents: 2420
diff changeset
355 if (pAudioPlayer != nullptr)
1b6bf88f561b fixing some memory access errors
Grumpy7
parents: 2420
diff changeset
356 {
1b6bf88f561b fixing some memory access errors
Grumpy7
parents: 2420
diff changeset
357 pAudioPlayer->StopChannels(-1, -1);//приостановка воспроизведения звуков при неактивном окне игры
2510
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
358 if ( use_music_folder )
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
359 alSourcePause(mSourceID);
ae2b7048b3eb alSourcePause
Ritor1
parents: 2502
diff changeset
360 else if ( pAudioPlayer->hAILRedbook )
2423
1b6bf88f561b fixing some memory access errors
Grumpy7
parents: 2420
diff changeset
361 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
1b6bf88f561b fixing some memory access errors
Grumpy7
parents: 2420
diff changeset
362 }
1804
Nomad
parents:
diff changeset
363 }
Nomad
parents:
diff changeset
364 }
Nomad
parents:
diff changeset
365 return *result = 0, true;
Nomad
parents:
diff changeset
366
Nomad
parents:
diff changeset
367 case WM_SETFOCUS:
Nomad
parents:
diff changeset
368 dword_4E98BC_bApplicationActive = 0;
Nomad
parents:
diff changeset
369 ClipCursor(0);
Nomad
parents:
diff changeset
370 return false;
Nomad
parents:
diff changeset
371
Nomad
parents:
diff changeset
372 case WM_KILLFOCUS:
Nomad
parents:
diff changeset
373 dword_4E98BC_bApplicationActive = 1;
Nomad
parents:
diff changeset
374 return false;
Nomad
parents:
diff changeset
375
Nomad
parents:
diff changeset
376 case WM_PAINT:
1806
Nomad
parents: 1805
diff changeset
377 if (!api_handle || !pRenderer)
1805
830f196a69ea WinXP fix
Nomad
parents: 1804
diff changeset
378 return false;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
379
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
380 if ( !GetUpdateRect(api_handle, 0, 0))// || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
381 return *result = 0, true;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
382
1804
Nomad
parents:
diff changeset
383 PAINTSTRUCT Paint;
Nomad
parents:
diff changeset
384 BeginPaint(api_handle, &Paint);
Nomad
parents:
diff changeset
385 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
386 {
Nomad
parents:
diff changeset
387 pArcomageGame->field_F9 = 1;
Nomad
parents:
diff changeset
388 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
389 if (pRenderer->AreRenderSurfacesOk())
1804
Nomad
parents:
diff changeset
390 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
391 pRenderer->Present();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
392 //EndPaint(api_handle, &Paint);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
393 //return *result = 0, true;
1804
Nomad
parents:
diff changeset
394 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
395
1804
Nomad
parents:
diff changeset
396 EndPaint(api_handle, &Paint);
Nomad
parents:
diff changeset
397 return *result = 0, true;
Nomad
parents:
diff changeset
398
Nomad
parents:
diff changeset
399 }
2443
1e1b2728b3d3 moved pKeyActionMap
Ritor1
parents: 2425
diff changeset
400 return *result = 0, false;
1804
Nomad
parents:
diff changeset
401 }
Nomad
parents:
diff changeset
402
Nomad
parents:
diff changeset
403
Nomad
parents:
diff changeset
404
Nomad
parents:
diff changeset
405 bool OSWindow::Initialize(const wchar_t *title, int window_width, int window_height)
Nomad
parents:
diff changeset
406 {
Nomad
parents:
diff changeset
407 WNDCLASSEXW wcxw;
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
408 wcxw.cbSize = sizeof(WNDCLASSEXW);
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
409 wcxw.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
410 wcxw.lpfnWndProc = WinApiMsgRouter;
1804
Nomad
parents:
diff changeset
411 wcxw.cbClsExtra = 0;
Nomad
parents:
diff changeset
412 wcxw.cbWndExtra = 0;
Nomad
parents:
diff changeset
413 wcxw.hInstance = GetModuleHandleW(nullptr);
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
414 wcxw.hIcon = wcxw.hIconSm = LoadIcon(NULL, IDI_QUESTION);// nullptr;
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
415 wcxw.hCursor = LoadCursor(NULL, IDC_WAIT);//nullptr;
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
416 wcxw.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);//(COLOR_BACKGROUND + 1);
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
417 wcxw.lpszMenuName = nullptr;
1804
Nomad
parents:
diff changeset
418 wcxw.lpszClassName = L"M&MTrilogy";
Nomad
parents:
diff changeset
419 if (!RegisterClassExW(&wcxw))
Nomad
parents:
diff changeset
420 return false;
Nomad
parents:
diff changeset
421
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
422 api_handle = CreateWindowExW(NULL, wcxw.lpszClassName, title, 0,
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
423 ReadWindowsRegistryInt("window X", (GetSystemMetrics(SM_CXSCREEN) - window_width) / 2),
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
424 ReadWindowsRegistryInt("window Y", (GetSystemMetrics(SM_CYSCREEN) - window_height) / 2),
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
425 window_width, window_height, nullptr,
1804
Nomad
parents:
diff changeset
426 nullptr, wcxw.hInstance, this);
Nomad
parents:
diff changeset
427 if (!api_handle)
Nomad
parents:
diff changeset
428 {
Nomad
parents:
diff changeset
429 UnregisterClassW(wcxw.lpszClassName, wcxw.hInstance);
Nomad
parents:
diff changeset
430 return false;
Nomad
parents:
diff changeset
431 }
Nomad
parents:
diff changeset
432
Nomad
parents:
diff changeset
433 SetWindowedMode(window_width, window_height);
Nomad
parents:
diff changeset
434 Show();
Nomad
parents:
diff changeset
435
Nomad
parents:
diff changeset
436 SetActiveWindow(api_handle);
Nomad
parents:
diff changeset
437
Nomad
parents:
diff changeset
438 MSG msg;
Nomad
parents:
diff changeset
439 while (PeekMessageW(&msg, api_handle, 0, 0, PM_REMOVE))
Nomad
parents:
diff changeset
440 {
Nomad
parents:
diff changeset
441 TranslateMessage(&msg);
Nomad
parents:
diff changeset
442 DispatchMessageW(&msg);
Nomad
parents:
diff changeset
443 }
Nomad
parents:
diff changeset
444
Nomad
parents:
diff changeset
445 return true;
Nomad
parents:
diff changeset
446 }
Nomad
parents:
diff changeset
447
Nomad
parents:
diff changeset
448
Nomad
parents:
diff changeset
449
Nomad
parents:
diff changeset
450
Nomad
parents:
diff changeset
451 OSWindow *OSWindow::Create(const wchar_t *title, int window_width, int window_height)
Nomad
parents:
diff changeset
452 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
453 auto window = new OSWindow;
1804
Nomad
parents:
diff changeset
454 if (window)
Nomad
parents:
diff changeset
455 if (!window->Initialize(title, window_width, window_height))
Nomad
parents:
diff changeset
456 {
Nomad
parents:
diff changeset
457 delete window;
Nomad
parents:
diff changeset
458 window = nullptr;
Nomad
parents:
diff changeset
459 }
Nomad
parents:
diff changeset
460
Nomad
parents:
diff changeset
461 return window;
Nomad
parents:
diff changeset
462 }
Nomad
parents:
diff changeset
463
Nomad
parents:
diff changeset
464
Nomad
parents:
diff changeset
465
2459
e5c88c2b02ab Audio_GetFirstHardwareDigitalDriver
Ritor1
parents: 2453
diff changeset
466 LRESULT CALLBACK OSWindow::WinApiMsgRouter(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
1804
Nomad
parents:
diff changeset
467 {
Nomad
parents:
diff changeset
468 if (msg == WM_NCCREATE)
Nomad
parents:
diff changeset
469 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
470 CREATESTRUCTA* cs = (CREATESTRUCTA *)(lparam);
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
471 OSWindow* window = (OSWindow *)cs->lpCreateParams;
1804
Nomad
parents:
diff changeset
472 SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)window);
Nomad
parents:
diff changeset
473 return DefWindowProcW(hwnd, msg, wparam, lparam);
Nomad
parents:
diff changeset
474 }
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
475 OSWindow* window = (OSWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
2420
0313c761d203 memory problems, Mouse
Ritor1
parents: 2415
diff changeset
476 if (window && window->api_handle == hwnd) //Uninitialized memory access
1804
Nomad
parents:
diff changeset
477 {
Nomad
parents:
diff changeset
478 LPARAM result;
2443
1e1b2728b3d3 moved pKeyActionMap
Ritor1
parents: 2425
diff changeset
479 if (window->WinApiMessageProc(msg, wparam, lparam, &result))//Unhandled application exception
1804
Nomad
parents:
diff changeset
480 return result;
Nomad
parents:
diff changeset
481 }
Nomad
parents:
diff changeset
482 return DefWindowProcW(hwnd, msg, (WPARAM)wparam, (LPARAM)lparam);
Nomad
parents:
diff changeset
483 }
Nomad
parents:
diff changeset
484
Nomad
parents:
diff changeset
485 void OSWindow::Show()
Nomad
parents:
diff changeset
486 {
Nomad
parents:
diff changeset
487 ShowWindow(api_handle, SW_SHOWNORMAL);
Nomad
parents:
diff changeset
488 UpdateWindow(api_handle);
Nomad
parents:
diff changeset
489 }
Nomad
parents:
diff changeset
490
Nomad
parents:
diff changeset
491 void OSWindow::SetCursor(const char *cursor_name)
Nomad
parents:
diff changeset
492 {
Nomad
parents:
diff changeset
493 POINT cursor_pos;
Nomad
parents:
diff changeset
494 GetCursorPos(&cursor_pos);
Nomad
parents:
diff changeset
495
Nomad
parents:
diff changeset
496 if (!strcmp(cursor_name, "MICON1") )
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
497 //SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(GetModuleHandleW(nullptr), IDC_ARROW));
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
498 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_ARROW));
1804
Nomad
parents:
diff changeset
499 else if (!strcmp(cursor_name, "MICON2") )
2219
e6771956e74a for mouse
Ritor1
parents: 2217
diff changeset
500 {
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
501 //HCURSOR hCurs1;
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
502
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
503 // Create target
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
504
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
505 //pMouse->uCursorTextureID = pIcons_LOD->LoadTexture(cursor_name, TEXTURE_16BIT_PALETTE);
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
506 //hCurs1 = LoadCursor(NULL, L"Target");
2475
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
507 if (for_refactoring)
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
508 {
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
509 MessageBoxA(nullptr, "Ritor1: original cursor(Target) isn't loading", "", 0);
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
510 __debugbreak();
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
511 }
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
512 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_CROSS));
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
513
2219
e6771956e74a for mouse
Ritor1
parents: 2217
diff changeset
514 }
1804
Nomad
parents:
diff changeset
515 else if (!strcmp(cursor_name, "MICON3") )
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
516 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_WAIT));
1804
Nomad
parents:
diff changeset
517
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
518 //ClientToScreen(api_handle, &cursor_pos); //???
1804
Nomad
parents:
diff changeset
519 SetCursorPos(cursor_pos.x, cursor_pos.y);
Nomad
parents:
diff changeset
520 }
Nomad
parents:
diff changeset
521
Nomad
parents:
diff changeset
522 void OSWindow::SetFullscreenMode()
Nomad
parents:
diff changeset
523 {
2475
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
524 //Ritor1: Error. Window size change in this function(Ошибка. При переходе на полноэкранный режим размеры окна изменяются в этой функции)
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
525 SetMenu(api_handle, nullptr);//640,480 - 640,500
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
526 /*bool m = false;
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
527 HMENU h_menu = GetMenu(api_handle);
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
528 m = DestroyMenu(h_menu);//как вариант - удалить меню*/
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
529
1804
Nomad
parents:
diff changeset
530 SetWindowLongW(api_handle, GWL_EXSTYLE, WS_EX_TOPMOST);
2475
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2465
diff changeset
531 SetWindowLongW(api_handle, GWL_STYLE, WS_VISIBLE | WS_POPUP);//648, 534
1804
Nomad
parents:
diff changeset
532
Nomad
parents:
diff changeset
533 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, SWP_NOSIZE | SWP_SHOWWINDOW);
Nomad
parents:
diff changeset
534 }
Nomad
parents:
diff changeset
535
Nomad
parents:
diff changeset
536 void OSWindow::SetWindowedMode(int new_window_width, int new_window_height)
Nomad
parents:
diff changeset
537 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
538 RECT rcWindowPos;
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
539 GetWindowRect(api_handle, &rcWindowPos);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
540
1804
Nomad
parents:
diff changeset
541 SetWindowLongW(api_handle, GWL_EXSTYLE, 0);
Nomad
parents:
diff changeset
542 SetWindowLongW(api_handle, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
1995
25e3772e3650 window style fix
zipi
parents: 1994
diff changeset
543 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, 0);
25e3772e3650 window style fix
zipi
parents: 1994
diff changeset
544
1804
Nomad
parents:
diff changeset
545 RECT rcWindow;
Nomad
parents:
diff changeset
546 GetWindowRect(api_handle, &rcWindow);
Nomad
parents:
diff changeset
547
Nomad
parents:
diff changeset
548 RECT rcClient;
Nomad
parents:
diff changeset
549 GetClientRect(api_handle, &rcClient);
Nomad
parents:
diff changeset
550
Nomad
parents:
diff changeset
551 int window_borders_width = (rcWindow.right - rcWindow.left) - (rcClient.right - rcClient.left),
Nomad
parents:
diff changeset
552 window_borders_height = (rcWindow.bottom - rcWindow.top) - (rcClient.bottom - rcClient.top);
Nomad
parents:
diff changeset
553 int window_total_width = new_window_width + window_borders_width,
Nomad
parents:
diff changeset
554 window_total_height = new_window_height + window_borders_height;
Nomad
parents:
diff changeset
555
Nomad
parents:
diff changeset
556 #ifdef _DEBUG
Nomad
parents:
diff changeset
557 if (!GetMenu(api_handle))
Nomad
parents:
diff changeset
558 window_total_height += GetSystemMetrics(SM_CYMENU);
Nomad
parents:
diff changeset
559 #endif
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
560 MoveWindow(api_handle, rcWindowPos.left,
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
561 rcWindowPos.top,
1804
Nomad
parents:
diff changeset
562 window_total_width,
Nomad
parents:
diff changeset
563 window_total_height, 0);
Nomad
parents:
diff changeset
564 #ifdef _DEBUG
Nomad
parents:
diff changeset
565 static HMENU debug_menu = CreateDebugMenuPanel();
Nomad
parents:
diff changeset
566 SetMenu(api_handle, debug_menu);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
567
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
568 GetWindowRect(api_handle, &rcWindow);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
569 GetClientRect(api_handle, &rcClient);
1804
Nomad
parents:
diff changeset
570 #endif
Nomad
parents:
diff changeset
571 }
Nomad
parents:
diff changeset
572
Nomad
parents:
diff changeset
573
Nomad
parents:
diff changeset
574
Nomad
parents:
diff changeset
575
Nomad
parents:
diff changeset
576 HMENU OSWindow::CreateDebugMenuPanel()
Nomad
parents:
diff changeset
577 {
Nomad
parents:
diff changeset
578 HMENU menu = CreateMenu();
Nomad
parents:
diff changeset
579 {
Nomad
parents:
diff changeset
580 HMENU file = CreatePopupMenu();
Nomad
parents:
diff changeset
581 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)file, L"&File");
Nomad
parents:
diff changeset
582 {
Nomad
parents:
diff changeset
583 AppendMenuW(file, MF_ENABLED | MF_STRING, 40001, L"Exit");
Nomad
parents:
diff changeset
584 }
Nomad
parents:
diff changeset
585
Nomad
parents:
diff changeset
586 HMENU debug = CreatePopupMenu();
Nomad
parents:
diff changeset
587 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug, L"&Debug");
Nomad
parents:
diff changeset
588 {
Nomad
parents:
diff changeset
589 HMENU debug_party = CreatePopupMenu();
Nomad
parents:
diff changeset
590 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party, L"&Party");
Nomad
parents:
diff changeset
591 {
Nomad
parents:
diff changeset
592 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40007, L"Give Gold (10 000)");
Nomad
parents:
diff changeset
593 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40008, L"Give Exp (20 000)");
Nomad
parents:
diff changeset
594 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40059, L"Give Skills (50 each)");
Nomad
parents:
diff changeset
595 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40013, L"Remove Gold");
Nomad
parents:
diff changeset
596
Nomad
parents:
diff changeset
597 HMENU debug_party_setconditions = CreatePopupMenu();
Nomad
parents:
diff changeset
598 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_setconditions, L"Set Condition");
Nomad
parents:
diff changeset
599 {
Nomad
parents:
diff changeset
600 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40044, L"Afraid");
Nomad
parents:
diff changeset
601 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40043, L"Asleep");
Nomad
parents:
diff changeset
602 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40037, L"Curse");
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
603 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease Weak");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
604 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease Medium");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
605 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease Severe");
1804
Nomad
parents:
diff changeset
606 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40041, L"Dead");
Nomad
parents:
diff changeset
607 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40039, L"Drunk");
Nomad
parents:
diff changeset
608 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40042, L"Eradicated");
Nomad
parents:
diff changeset
609 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40038, L"Insane");
Nomad
parents:
diff changeset
610 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40045, L"Paralyzed");
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
611 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison Weak");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
612 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison Medium");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
613 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison Severe");
1804
Nomad
parents:
diff changeset
614 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40029, L"&Stone");
Nomad
parents:
diff changeset
615 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40040, L"Unconscious");
Nomad
parents:
diff changeset
616 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40030, L"Weak");
Nomad
parents:
diff changeset
617 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40073, L"Zombie");
Nomad
parents:
diff changeset
618 }
Nomad
parents:
diff changeset
619
Nomad
parents:
diff changeset
620 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40006, L"Set Food (20)");
Nomad
parents:
diff changeset
621
Nomad
parents:
diff changeset
622 HMENU debug_party_alignment = CreatePopupMenu();
Nomad
parents:
diff changeset
623 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_alignment, L"Alignment");
Nomad
parents:
diff changeset
624 {
Nomad
parents:
diff changeset
625 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40062, L"Good");
Nomad
parents:
diff changeset
626 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING | MF_CHECKED, 40063, L"Neutral");
Nomad
parents:
diff changeset
627 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40064, L"Evil");
Nomad
parents:
diff changeset
628 }
Nomad
parents:
diff changeset
629 }
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
630 AppendMenuW(debug, MF_ENABLED | MF_STRING, 40122, L"Actors off");
1804
Nomad
parents:
diff changeset
631 HMENU debug_time = CreatePopupMenu();
Nomad
parents:
diff changeset
632 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_time, L"&Time");
Nomad
parents:
diff changeset
633 {
Nomad
parents:
diff changeset
634 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40009, L"Add 1 Day");
Nomad
parents:
diff changeset
635 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40010, L"Add 1 Week");
Nomad
parents:
diff changeset
636 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40011, L"Add 1 Month");
Nomad
parents:
diff changeset
637 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40012, L"Add 1 Year");
Nomad
parents:
diff changeset
638 }
Nomad
parents:
diff changeset
639
Nomad
parents:
diff changeset
640 HMENU debug_items = CreatePopupMenu();
Nomad
parents:
diff changeset
641 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_items, L"&Items");
Nomad
parents:
diff changeset
642 {
Nomad
parents:
diff changeset
643 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40015, L"Generate level &1 item");
Nomad
parents:
diff changeset
644 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40016, L"Generate level &2 item");
Nomad
parents:
diff changeset
645 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40017, L"Generate level &3 item");
Nomad
parents:
diff changeset
646 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40018, L"Generate level &4 item");
Nomad
parents:
diff changeset
647 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40019, L"Generate level &5 item");
Nomad
parents:
diff changeset
648 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40020, L"Generate level &6 item");
Nomad
parents:
diff changeset
649 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40061, L"Generate special item");
Nomad
parents:
diff changeset
650 }
Nomad
parents:
diff changeset
651
Nomad
parents:
diff changeset
652 HMENU debug_graphics = CreatePopupMenu();
Nomad
parents:
diff changeset
653 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_graphics, L"&Graphics");
Nomad
parents:
diff changeset
654 {
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
655 HMENU lights_off = CreatePopupMenu();
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
656 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)lights_off, L"Lights");//40104
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
657 {
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
658 AppendMenuW(lights_off, MF_ENABLED | MF_STRING, 40123, L"Lights on");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
659 AppendMenuW(lights_off, MF_ENABLED | MF_STRING, 40124, L"Lights off");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
660 }
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
661 //AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40025, L"Debug Lights");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
662 HMENU debug_lights = CreatePopupMenu();
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
663 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_lights, L"Debug Lights");//40104
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
664 {
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
665 AppendMenuW(debug_lights, MF_ENABLED | MF_STRING, 40125, L"Debug lights on");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
666 AppendMenuW(debug_lights, MF_ENABLED | MF_STRING, 40126, L"Debug lights off");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
667 }
2570
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
668 HMENU debug_terrain = CreatePopupMenu();
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
669 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_terrain, L"Debug Terrain");//40104
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
670 {
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
671 AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40127, L"Debug Terrain on");
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
672 AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40128, L"Debug Terrain off");
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
673 }
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
674 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40023, L"Lighting Mode");
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
675 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40024, L"Lighting Geometry");
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
676
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
677 //AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING/* | MF_GRAYED*/, 40123, L"Lights Off");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
678 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40105, L"Colored Lights");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
679 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40101, L"Debug Decals");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
680 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40027, L"HWID Portals");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
681 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40047, L"SWID Portals");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
682 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40051, L"OD Frustum");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
683 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40054, L"SWOD Constant Redraw");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
684 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40055, L"SWOD Lit Rasterizer");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
685 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40056, L"Party Light off");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
686 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40060, L"SWOD Nice Lighting off");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
687 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40067, L"HWOD Additive Fog Lights");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
688 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40072, L"HWID Nice Lighting");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
689 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40048, L"Wireframe");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
690 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40049, L"Fog");
1804
Nomad
parents:
diff changeset
691 }
Nomad
parents:
diff changeset
692
Nomad
parents:
diff changeset
693 HMENU debug_misc = CreatePopupMenu();
Nomad
parents:
diff changeset
694 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_misc, L"&Misc");
Nomad
parents:
diff changeset
695 {
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
696 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40066, L"Object Viewcone Culling");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
697 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40068, L"Red Tint");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
698 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40071, L"Display Secrets");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
699 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40102, L"Massive Bloodsplat");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
700 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40103, L"Underwater Gravity");
1804
Nomad
parents:
diff changeset
701 }
Nomad
parents:
diff changeset
702
Nomad
parents:
diff changeset
703 HMENU debug_eax = CreatePopupMenu();
Nomad
parents:
diff changeset
704 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_eax, L"EAX Environs");
Nomad
parents:
diff changeset
705 {
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
706 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40074, L"NONE");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
707 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40075, L"GENERIC");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
708 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40076, L"PADDEDCELL");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
709 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40077, L"ROOM");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
710 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40078, L"BATHROOM");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
711 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40079, L"LIVINGROOM");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
712 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40080, L"STONEROOM");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
713 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40081, L"AUDITORIUM");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
714 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40082, L"CONCERTHALL");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
715 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40083, L"CAVE");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
716 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40084, L"ARENA");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
717 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40085, L"HANGAR");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
718 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40086, L"CARPETEDHALLWAY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
719 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40087, L"HALLWAY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
720 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40088, L"STONECORRIDOR");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
721 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40089, L"ALLEY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
722 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40090, L"FOREST");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
723 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40091, L"CITY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
724 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40092, L"MOUNTAINS");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
725 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40093, L"QUARRY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
726 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40094, L"PLAIN");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
727 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40095, L"PARKINGLOT");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
728 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40096, L"SEWERPIPE");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
729 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40097, L"UNDERWATER");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
730 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40098, L"DRUGGED");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
731 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40099, L"DIZZY");
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
732 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40100, L"PSICHOTIC");
1804
Nomad
parents:
diff changeset
733 }
Nomad
parents:
diff changeset
734 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
735 HMENU other = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
736 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other, L"&Other");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
737 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
738 HMENU other_wizard_eye = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
739 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_wizard_eye, L"Wizard eye");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
740 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
741 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40101, L"Wizard eye on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
742 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40102, L"Wizard eye off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
743 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
744 HMENU other_new_draw_object_dist = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
745 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_draw_object_dist, L"New draw object distance");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
746 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
747 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40103, L"New draw object dist on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
748 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40104, L"New draw object dist off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
749 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
750 HMENU other_change_seasons = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
751 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_change_seasons, L"Change seasons");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
752 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
753 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40105, L"Change seasons on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
754 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40106, L"Change seasons off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
755 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
756 HMENU other_all_magic = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
757 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_all_magic, L"All magic");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
758 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
759 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40107, L"All magic on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
760 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40108, L"All magic off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
761 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
762 HMENU other_debug_information = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
763 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_debug_information, L"Debug information");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
764 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
765 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40109, L"Debug information on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
766 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40110, L"Debug information off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
767 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
768 HMENU other_show_picked_face = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
769 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_show_picked_face, L"Show picked face");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
770 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
771 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40111, L"Show picked face on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
772 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40112, L"Show picked face off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
773 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
774 HMENU other_draw_portals_loops = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
775 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_portals_loops, L"Draw portals loops");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
776 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
777 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40113, L"Draw portals loops on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
778 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40114, L"Draw portals loops off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
779 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
780 HMENU other_new_speed = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
781 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_speed, L"New_speed");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
782 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
783 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40115, L"New_speed on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
784 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40116, L"New_speed off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
785 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
786 HMENU other_snow = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
787 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_snow, L"Snow");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
788 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
789 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40117, L"Snowfall on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
790 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40118, L"Snowfall off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
791 }
2320
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
792 HMENU other_draw_terrain_dist_mist = CreatePopupMenu();
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
793 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_terrain_dist_mist, L"New draw terrain distance");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
794 {
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
795 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40119, L"New draw terrain distance on");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
796 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40120, L"New draw terrain distance off");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
797 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
798
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
799 }
1804
Nomad
parents:
diff changeset
800 }
Nomad
parents:
diff changeset
801 return menu;
Nomad
parents:
diff changeset
802 }
Nomad
parents:
diff changeset
803
Nomad
parents:
diff changeset
804
Nomad
parents:
diff changeset
805
Nomad
parents:
diff changeset
806
Nomad
parents:
diff changeset
807 bool OSWindow::OnOSMenu(int item_id)
Nomad
parents:
diff changeset
808 {
Nomad
parents:
diff changeset
809 switch (item_id)
Nomad
parents:
diff changeset
810 {
Nomad
parents:
diff changeset
811 default: return false;
Nomad
parents:
diff changeset
812
Nomad
parents:
diff changeset
813
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
814 //case 103: pRenderer->SavePCXScreenshot(); break;
1804
Nomad
parents:
diff changeset
815 case 101: // Quit game
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
816 case 40001: // Menu "File"-> "Exit"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2510
diff changeset
817 pEngine->Deinitialize();
1804
Nomad
parents:
diff changeset
818 SendMessageW(api_handle, WM_DESTROY, 0, 0);
Nomad
parents:
diff changeset
819 break;
Nomad
parents:
diff changeset
820
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
821 /*case 104: //F4 button
1804
Nomad
parents:
diff changeset
822 pRenderer->ChangeBetweenWinFullscreenModes();
Nomad
parents:
diff changeset
823 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
824 pArcomageGame->field_F6 = 1;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
825 break;*/
1804
Nomad
parents:
diff changeset
826
Nomad
parents:
diff changeset
827 //SubMenu "Party"
Nomad
parents:
diff changeset
828 case 40006: pParty->SetFood(pParty->uNumFoodRations + 20); break;
Nomad
parents:
diff changeset
829 case 40007: pParty->SetGold(pParty->uNumGold + 10000); break;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1815
diff changeset
830 case 40008: pParty->GivePartyExp(20000); break;
1804
Nomad
parents:
diff changeset
831 case 40013: pParty->SetGold(0); break;
Nomad
parents:
diff changeset
832
Nomad
parents:
diff changeset
833 case 40059:
Nomad
parents:
diff changeset
834 for (uint i = 0; i < 4; ++i)
Nomad
parents:
diff changeset
835 pParty->pPlayers[i].uSkillPoints = 50;
Nomad
parents:
diff changeset
836 break;
Nomad
parents:
diff changeset
837
2185
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
838 case 40029: pPlayers[uActiveCharacter]->SetPertified(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
839 case 40030: pPlayers[uActiveCharacter]->SetWeak(pParty->uTimePlayed); break;
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
840 case 40031: pPlayers[uActiveCharacter]->SetPoisonSevere(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
841 case 40032: pPlayers[uActiveCharacter]->SetPoisonMedium(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
842 case 40033: pPlayers[uActiveCharacter]->SetPoisonWeak(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
843 case 40034: pPlayers[uActiveCharacter]->SetDiseaseSevere(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
844 case 40035: pPlayers[uActiveCharacter]->SetDiseaseMedium(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
845 case 40036: pPlayers[uActiveCharacter]->SetDiseaseWeak(pParty->uTimePlayed); break;
2185
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
846 case 40037: pPlayers[uActiveCharacter]->SetCursed(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
847 case 40038: pPlayers[uActiveCharacter]->SetInsane(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
848 case 40039: pPlayers[uActiveCharacter]->SetDrunk(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
849 case 40040: pPlayers[uActiveCharacter]->SetUnconcious(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
850 case 40041: pPlayers[uActiveCharacter]->SetDead(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
851 case 40042: pPlayers[uActiveCharacter]->SetEradicated(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
852 case 40043: pPlayers[uActiveCharacter]->SetAsleep(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
853 case 40044: pPlayers[uActiveCharacter]->SetAfraid(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
854 case 40045: pPlayers[uActiveCharacter]->SetParalyzed(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
855 case 40073: pPlayers[uActiveCharacter]->SetZombie(pParty->uTimePlayed); break;
1804
Nomad
parents:
diff changeset
856
Nomad
parents:
diff changeset
857 case 40062:
Nomad
parents:
diff changeset
858 pParty->alignment = PartyAlignment_Good;
Nomad
parents:
diff changeset
859 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
860 break;
Nomad
parents:
diff changeset
861 case 40063:
Nomad
parents:
diff changeset
862 pParty->alignment = PartyAlignment_Neutral;
Nomad
parents:
diff changeset
863 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
864 break;
Nomad
parents:
diff changeset
865 case 40064:
Nomad
parents:
diff changeset
866 pParty->alignment = PartyAlignment_Evil;
Nomad
parents:
diff changeset
867 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
868 break;
Nomad
parents:
diff changeset
869
Nomad
parents:
diff changeset
870
Nomad
parents:
diff changeset
871
Nomad
parents:
diff changeset
872 //SubMenu "Time"
Nomad
parents:
diff changeset
873 case 40009: pParty->uTimePlayed += Timer::Day; break;
Nomad
parents:
diff changeset
874 case 40010: pParty->uTimePlayed += Timer::Week; break;
Nomad
parents:
diff changeset
875 case 40011: pParty->uTimePlayed += Timer::Month; break;
Nomad
parents:
diff changeset
876 case 40012: pParty->uTimePlayed += Timer::Year; break;
Nomad
parents:
diff changeset
877
Nomad
parents:
diff changeset
878 //SubMenu "Items"
Nomad
parents:
diff changeset
879 case 40015: // uItemID_Rep_St == 1
Nomad
parents:
diff changeset
880 case 40016: // uItemID_Rep_St == 2
Nomad
parents:
diff changeset
881 case 40017: // uItemID_Rep_St == 3
Nomad
parents:
diff changeset
882 case 40018: // uItemID_Rep_St == 4
Nomad
parents:
diff changeset
883 case 40019: // uItemID_Rep_St == 5
Nomad
parents:
diff changeset
884 case 40020: // uItemID_Rep_St == 6
Nomad
parents:
diff changeset
885 {
Nomad
parents:
diff changeset
886 int pItemID = rand() % 500;
Nomad
parents:
diff changeset
887 for (uint i = 0; i < 500; ++i)
Nomad
parents:
diff changeset
888 {
Nomad
parents:
diff changeset
889 if (pItemID + i > 499)
Nomad
parents:
diff changeset
890 pItemID = 0;
Nomad
parents:
diff changeset
891 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St == (item_id - 40015 + 1))
Nomad
parents:
diff changeset
892 {
Nomad
parents:
diff changeset
893 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
Nomad
parents:
diff changeset
894 break;
Nomad
parents:
diff changeset
895 }
Nomad
parents:
diff changeset
896 }
Nomad
parents:
diff changeset
897 }
Nomad
parents:
diff changeset
898 break;
Nomad
parents:
diff changeset
899
Nomad
parents:
diff changeset
900 case 40061:
Nomad
parents:
diff changeset
901 {
Nomad
parents:
diff changeset
902 int pItemID = rand() % 500;
Nomad
parents:
diff changeset
903 for (uint i = 0; i < 500; ++i)
Nomad
parents:
diff changeset
904 {
Nomad
parents:
diff changeset
905 if (pItemID + i > 499)
Nomad
parents:
diff changeset
906 pItemID = 0;
Nomad
parents:
diff changeset
907 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St > 6)
Nomad
parents:
diff changeset
908 {
Nomad
parents:
diff changeset
909 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
Nomad
parents:
diff changeset
910 break;
Nomad
parents:
diff changeset
911 }
Nomad
parents:
diff changeset
912 }
Nomad
parents:
diff changeset
913 }
Nomad
parents:
diff changeset
914 break;
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
915 //SubMenu "Other"
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
916 case 40101: wizard_eye = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
917 case 40102: wizard_eye = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
918 case 40103: pODMRenderParams->shading_dist_mist = 0x6000; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
919 case 40104: pODMRenderParams->shading_dist_mist = 0x2000; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
920 case 40105: change_seasons = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
921 case 40106: change_seasons = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
922 case 40107: all_magic = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
923 case 40108: all_magic = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
924 case 40109: debug_information = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
925 case 40110: debug_information = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
926 case 40111: show_picked_face = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
927 case 40112: show_picked_face = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
928 case 40113: draw_portals_loops = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
929 case 40114: draw_portals_loops = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
930 case 40115: new_speed = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
931 case 40116: new_speed = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
932 case 40117: bSnow = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
933 case 40118: bSnow = false; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
934 case 40119: draw_terrain_dist_mist = true; break;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2443
diff changeset
935 case 40120: draw_terrain_dist_mist = false; break;
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
936 case 40122: no_actors = true; break;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
937 case 40123: lights_flag = true; break;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
938 case 40124: lights_flag = false; break;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
939 case 40125: debug_lights = true; break;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2544
diff changeset
940 case 40126: debug_lights = false; break;
2570
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
941 case 40127: debug_terrain_polygin = true; break;
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
942 case 40128: debug_terrain_polygin = false; break;
1804
Nomad
parents:
diff changeset
943 }
Nomad
parents:
diff changeset
944
Nomad
parents:
diff changeset
945 return true;
1924
8cd321994943 MSVS 2012 project file & some compilation warning fixes
Nomad
parents: 1830
diff changeset
946 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
947