Mercurial > mm7
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 | 1 #define _CRTDBG_MAP_ALLOC |
2567 | 2 #define _CRT_SECURE_NO_WARNINGS |
2415 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 | |
1804 | 6 #include "OSWindow.h" |
2541 | 7 |
8 #include "Engine/Engine.h" | |
9 | |
2496 | 10 #include "Arcomage\Arcomage.h" |
2502 | 11 #include "Media/Audio/AudioPlayer.h" |
12 #include "IO/Mouse.h" | |
2499 | 13 #include "Engine/Timer.h" |
2502 | 14 #include "GUI/GUIWindow.h" |
2499 | 15 #include "Engine/Party.h" |
2496 | 16 #include "Engine/Graphics/IndoorCameraD3D.h" |
2502 | 17 #include "IO/Keyboard.h" |
2496 | 18 #include "Engine/Graphics/Viewport.h" |
19 #include "Engine/Graphics/Vis.h" | |
2502 | 20 #include "Media/Audio/AIL.h" |
2499 | 21 #include "Engine/Registry.h" |
22 #include "Engine/MMT.h" | |
1804 | 23 |
24 | |
2541 | 25 bool wizard_eye = false; // wizard eye always on / включить на постоянно око чародея |
26 bool change_seasons = false; // toggle seasons change / смена времён года | |
27 bool all_magic = false; // toggle full spellbook / включить всю магию | |
28 bool debug_information = false; // toggle debug info / информация fps, положение группы, уровень пола и т.п. | |
29 bool show_picked_face = false; // highlight picked face / выделить активный фейс | |
30 bool draw_portals_loops = false; // show portal frames / видны рамки порталов | |
2277 | 31 bool new_speed = false; |
32 bool bSnow = false; | |
2320 | 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 | 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 | 37 bool debug_terrain_polygin = false; |
2277 | 38 |
1804 | 39 bool OSWindow::OnMouseLeftClick(int x, int y) |
40 { | |
1815 | 41 if (UIControl::OnMouseLeftClick(x, y)) |
42 return true; | |
43 | |
2450 | 44 //if (pMediaPlayer->bPlaying_Movie) |
45 //pMediaPlayer->bPlaying_Movie = false; | |
1804 | 46 |
47 pMouse->SetMouseClick(x, y); | |
48 | |
49 if (GetCurrentMenuID() == MENU_CREATEPARTY) | |
2339 | 50 Mouse::UI_OnKeyDown(VK_SELECT); |
1804 | 51 |
2541 | 52 if (pEngine) |
53 pEngine->PickMouse(512.0, x, y, false, &vis_sprite_filter_3, &vis_door_filter); | |
1804 | 54 |
2339 | 55 Mouse::UI_OnMouseLeftClick(0); |
1804 | 56 return true; |
57 } | |
58 | |
59 bool OSWindow::OnMouseRightClick(int x, int y) | |
60 { | |
1815 | 61 if (UIControl::OnMouseRightClick(x, y)) |
62 return true; | |
63 | |
2450 | 64 if (pMediaPlayer->bPlaying_Movie) |
65 pMediaPlayer->bPlaying_Movie = false; | |
1804 | 66 |
67 pMouse->SetMouseClick(x, y); | |
68 | |
2541 | 69 if (pEngine) |
2543 | 70 pEngine->PickMouse(pIndoorCameraD3D->GetPickDepth(), x, y, 0, &vis_sprite_filter_2, &vis_door_filter); |
1804 | 71 |
72 UI_OnMouseRightClick(0); | |
73 return true; | |
74 } | |
75 | |
76 | |
1830 | 77 bool _507B98_ctrl_pressed = false; |
1804 | 78 bool OSWindow::WinApiMessageProc(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result) |
79 { | |
80 switch (msg) | |
81 { | |
82 case WM_KEYUP: | |
83 { | |
1830 | 84 if (wparam == VK_CONTROL) |
85 _507B98_ctrl_pressed = false; | |
2132 | 86 if (wparam == VK_SNAPSHOT) |
87 pRenderer->SavePCXScreenshot(); | |
1830 | 88 |
1804 | 89 OnKey(wparam); |
90 return *result = 0, true; | |
91 } | |
92 | |
93 case WM_SIZING: return *result = 1, true; | |
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 | 97 return false; |
98 | |
99 case WM_CHAR: | |
2201 | 100 if (!pKeyActionMap->ProcessTextInput(wparam) && !viewparams->field_4C) |
1804 | 101 GUI_HandleHotkey(wparam); |
102 return false; | |
103 | |
104 case WM_DESTROY: | |
105 ExitProcess(GetLastError()); | |
106 // SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); | |
107 // PostQuitMessage(0); | |
108 // return 0; | |
109 | |
110 //case WM_DEVICECHANGE: | |
111 //{ | |
112 // if (wParam == 0x8000) // CD or some device has been inserted - notify InsertCD dialog | |
113 // PostMessageW(hInsertCDWindow, WM_USER + 1, 0, 0); | |
114 // return 0; | |
115 //} | |
116 | |
117 case WM_COMMAND: | |
118 if (OnOSMenu(wparam)) | |
119 return *result = 0, true; | |
120 return false; | |
121 | |
122 case WM_LBUTTONDOWN: | |
123 { | |
124 if (pArcomageGame->bGameInProgress) | |
125 { | |
126 pArcomageGame->stru1.field_0 = 7; | |
127 ArcomageGame::OnMouseClick(0, true); | |
128 return false; | |
129 } | |
130 | |
131 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam)); | |
132 } | |
133 return false; | |
134 | |
135 | |
136 case WM_RBUTTONDOWN: | |
137 { | |
138 if (pArcomageGame->bGameInProgress) | |
139 { | |
140 pArcomageGame->stru1.field_0 = 8; | |
141 ArcomageGame::OnMouseClick(1, true); | |
142 return false; | |
143 } | |
144 | |
145 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam)); | |
146 } | |
147 return false; | |
148 | |
149 | |
150 case WM_LBUTTONUP: | |
151 if ( !pArcomageGame->bGameInProgress ) | |
152 { | |
153 back_to_game(); | |
154 return false; | |
155 } | |
156 pArcomageGame->stru1.field_0 = 3; | |
157 ArcomageGame::OnMouseClick(0, 0); | |
158 return false; | |
159 | |
160 case WM_RBUTTONUP: | |
161 if ( !pArcomageGame->bGameInProgress ) | |
162 { | |
163 back_to_game(); | |
164 return false; | |
165 } | |
166 pArcomageGame->stru1.field_0 = 4; | |
167 ArcomageGame::OnMouseClick(1, false); | |
168 return false; | |
169 | |
170 case WM_LBUTTONDBLCLK: | |
171 { | |
172 if ( pArcomageGame->bGameInProgress ) | |
173 { | |
174 pArcomageGame->stru1.field_0 = 7; | |
175 return false; | |
176 } | |
177 | |
178 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam)); | |
179 } | |
180 return false; | |
181 | |
182 case WM_RBUTTONDBLCLK: | |
183 { | |
184 if (pArcomageGame->bGameInProgress) | |
185 { | |
186 pArcomageGame->stru1.field_0 = 8; | |
187 return false; | |
188 } | |
189 | |
190 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam)); | |
191 } | |
192 return false; | |
193 | |
194 /*case WM_MBUTTONDOWN: | |
2541 | 195 if (pRenderer->pRenderD3D && pEngine) |
1804 | 196 { |
2543 | 197 pEngine->PickMouse(pIndoorCameraD3D->GetPickDepth(), LOWORD(lParam), HIWORD(lParam), 1, &vis_sprite_filter_3, &vis_face_filter); |
1804 | 198 } |
199 return false;*/ | |
200 | |
201 case WM_MOUSEMOVE: | |
202 if ( pArcomageGame->bGameInProgress ) | |
203 { | |
204 ArcomageGame::OnMouseMove(LOWORD(lparam), HIWORD(lparam)); | |
205 ArcomageGame::OnMouseClick(0, wparam == MK_LBUTTON); | |
206 ArcomageGame::OnMouseClick(1, wparam == MK_RBUTTON); | |
207 } | |
208 else if (pMouse) | |
209 pMouse->SetMouseClick(LOWORD(lparam), HIWORD(lparam)); | |
210 return false; | |
211 | |
212 case WM_SYSCOMMAND: | |
213 if ( wparam == SC_SCREENSAVE || wparam == SC_MONITORPOWER ) | |
214 return *result = 0, true; | |
215 return false; | |
216 | |
217 case WM_KEYDOWN: | |
218 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) | |
219 { | |
2201 | 220 pKeyActionMap->ProcessTextInput(wparam); |
1804 | 221 return false; |
222 } | |
223 if ( !pArcomageGame->bGameInProgress ) | |
224 { | |
2450 | 225 if ( pMediaPlayer->bPlaying_Movie ) |
226 pMediaPlayer->bPlaying_Movie = false; | |
1804 | 227 if ( wparam == VK_RETURN ) |
228 { | |
229 if ( !viewparams->field_4C ) | |
2339 | 230 Mouse::UI_OnKeyDown(wparam); |
1804 | 231 return 0; |
232 } | |
1830 | 233 if (wparam == VK_CONTROL) |
234 { | |
235 _507B98_ctrl_pressed = true; | |
236 return false; | |
237 } | |
1804 | 238 if ( wparam == VK_ESCAPE ) |
239 { | |
2402 | 240 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0); |
1804 | 241 return 0; |
242 } | |
243 if ( wparam <= VK_HOME ) | |
244 return 0; | |
245 if ( wparam > VK_DOWN ) | |
246 { | |
2450 | 247 if ( wparam != VK_F4 || pMovie_Track ) |
1804 | 248 return 0; |
249 | |
250 // F4 - toggle fullscreen | |
251 SendMessageW(api_handle, WM_COMMAND, 104, 0); | |
252 return 0; | |
253 } | |
254 if ( wparam >= VK_LEFT && wparam <= VK_DOWN ) | |
255 { | |
2541 | 256 if ( current_screen_type != SCREEN_GAME && current_screen_type != SCREEN_MODAL_WINDOW ) |
1804 | 257 { |
258 if ( !viewparams->field_4C ) | |
2339 | 259 Mouse::UI_OnKeyDown(wparam); |
1804 | 260 return 0; |
261 } | |
262 } | |
2541 | 263 if ( current_screen_type != SCREEN_GAME && current_screen_type != SCREEN_MODAL_WINDOW ) |
1804 | 264 return 0; |
265 } | |
266 | |
267 pArcomageGame->stru1.field_0 = 1; | |
268 | |
269 set_stru1_field_8_InArcomage(MapVirtualKey(wparam, MAPVK_VK_TO_CHAR)); | |
270 if ( wparam == 27 ) | |
271 { | |
272 pArcomageGame->GameOver = 1; | |
273 pArcomageGame->field_F4 = 1; | |
2214 | 274 pArcomageGame->uGameWinner = 2; |
275 pArcomageGame->Victory_type = -2; | |
1804 | 276 return false; |
277 } | |
278 if ( wparam != 114 ) | |
279 { | |
2450 | 280 if ( wparam == 115 && !pMovie_Track ) |
1804 | 281 SendMessage(api_handle, WM_COMMAND, 104, 0); |
282 return false; | |
283 } | |
284 SendMessageW(api_handle, WM_COMMAND, 103, 0); | |
285 return *result = 0, true; | |
286 | |
287 case WM_ACTIVATEAPP: | |
288 if ( wparam && (GetForegroundWindow() == api_handle || GetForegroundWindow() == hInsertCDWindow) ) | |
289 { | |
2061 | 290 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) |
1804 | 291 { |
292 dword_4E98BC_bApplicationActive = 1; | |
2069 | 293 /*if ( pRenderer->bWindowMode ) |
1804 | 294 { |
295 HDC hDC = GetDC(api_handle); | |
296 int bitsPerPixel = GetDeviceCaps(hDC, BITSPIXEL); | |
297 int planes = GetDeviceCaps(hDC, PLANES); | |
298 ReleaseDC(api_handle, hDC); | |
299 if (bitsPerPixel != 16 || planes != 1) | |
2069 | 300 Error(L"%S", pGlobalTXT_LocalizationStrings[62]); |
301 }*/ | |
2061 | 302 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_APP_INACTIVE; |
1804 | 303 |
304 if ( pArcomageGame->bGameInProgress ) | |
305 { | |
306 pArcomageGame->field_F9 = 1; | |
307 } | |
308 else | |
309 { | |
2061 | 310 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0200_EVENT_TIMER) |
311 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0200_EVENT_TIMER; | |
1804 | 312 else |
313 pEventTimer->Resume(); | |
2061 | 314 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0400_MISC_TIMER) |
315 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0400_MISC_TIMER; | |
1804 | 316 else |
317 pMiscTimer->Resume(); | |
318 | |
319 viewparams->bRedrawGameUI = true; | |
2394 | 320 if ( pMovie_Track)//pVideoPlayer->pSmackerMovie ) |
1804 | 321 { |
322 pRenderer->RestoreFrontBuffer(); | |
2152 | 323 pRenderer->RestoreBackBuffer(); |
2453 | 324 //BackToHouseMenu(); |
1804 | 325 } |
326 } | |
2510 | 327 if ( !bGameoverLoop && !pMovie_Track )//continue an audio track |
328 { | |
329 if ( use_music_folder ) | |
330 alSourcePlay(mSourceID); | |
331 else if ( pAudioPlayer->hAILRedbook )//!pVideoPlayer->pSmackerMovie ) | |
332 AIL_redbook_resume(pAudioPlayer->hAILRedbook); | |
333 } | |
1804 | 334 } |
335 } | |
336 else | |
337 { | |
2061 | 338 if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)) |
1804 | 339 { |
340 dword_4E98BC_bApplicationActive = 0; | |
2450 | 341 if ( pMovie_Track ) |
342 pMediaPlayer->bPlaying_Movie = true; | |
1804 | 343 |
344 ClipCursor(0); | |
2061 | 345 dword_6BE364_game_settings_1 |= GAME_SETTINGS_APP_INACTIVE; |
1804 | 346 if ( pEventTimer->bPaused ) |
2061 | 347 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0200_EVENT_TIMER; |
1804 | 348 else |
349 pEventTimer->Pause(); | |
350 if ( pMiscTimer->bPaused ) | |
2061 | 351 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0400_MISC_TIMER; |
1804 | 352 else |
353 pMiscTimer->Pause(); | |
354 | |
2423 | 355 if (pAudioPlayer != nullptr) |
356 { | |
357 pAudioPlayer->StopChannels(-1, -1);//приостановка воспроизведения звуков при неактивном окне игры | |
2510 | 358 if ( use_music_folder ) |
359 alSourcePause(mSourceID); | |
360 else if ( pAudioPlayer->hAILRedbook ) | |
2423 | 361 AIL_redbook_pause(pAudioPlayer->hAILRedbook); |
362 } | |
1804 | 363 } |
364 } | |
365 return *result = 0, true; | |
366 | |
367 case WM_SETFOCUS: | |
368 dword_4E98BC_bApplicationActive = 0; | |
369 ClipCursor(0); | |
370 return false; | |
371 | |
372 case WM_KILLFOCUS: | |
373 dword_4E98BC_bApplicationActive = 1; | |
374 return false; | |
375 | |
376 case WM_PAINT: | |
1806 | 377 if (!api_handle || !pRenderer) |
1805 | 378 return false; |
2154 | 379 |
2155 | 380 if ( !GetUpdateRect(api_handle, 0, 0))// || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode ) |
2154 | 381 return *result = 0, true; |
382 | |
1804 | 383 PAINTSTRUCT Paint; |
384 BeginPaint(api_handle, &Paint); | |
385 if ( pArcomageGame->bGameInProgress ) | |
386 { | |
387 pArcomageGame->field_F9 = 1; | |
388 } | |
2154 | 389 if (pRenderer->AreRenderSurfacesOk()) |
1804 | 390 { |
2154 | 391 pRenderer->Present(); |
392 //EndPaint(api_handle, &Paint); | |
393 //return *result = 0, true; | |
1804 | 394 } |
2154 | 395 |
1804 | 396 EndPaint(api_handle, &Paint); |
397 return *result = 0, true; | |
398 | |
399 } | |
2443 | 400 return *result = 0, false; |
1804 | 401 } |
402 | |
403 | |
404 | |
405 bool OSWindow::Initialize(const wchar_t *title, int window_width, int window_height) | |
406 { | |
407 WNDCLASSEXW wcxw; | |
2459 | 408 wcxw.cbSize = sizeof(WNDCLASSEXW); |
409 wcxw.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; | |
410 wcxw.lpfnWndProc = WinApiMsgRouter; | |
1804 | 411 wcxw.cbClsExtra = 0; |
412 wcxw.cbWndExtra = 0; | |
413 wcxw.hInstance = GetModuleHandleW(nullptr); | |
2459 | 414 wcxw.hIcon = wcxw.hIconSm = LoadIcon(NULL, IDI_QUESTION);// nullptr; |
415 wcxw.hCursor = LoadCursor(NULL, IDC_WAIT);//nullptr; | |
416 wcxw.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);//(COLOR_BACKGROUND + 1); | |
417 wcxw.lpszMenuName = nullptr; | |
1804 | 418 wcxw.lpszClassName = L"M&MTrilogy"; |
419 if (!RegisterClassExW(&wcxw)) | |
420 return false; | |
421 | |
2459 | 422 api_handle = CreateWindowExW(NULL, wcxw.lpszClassName, title, 0, |
2069 | 423 ReadWindowsRegistryInt("window X", (GetSystemMetrics(SM_CXSCREEN) - window_width) / 2), |
424 ReadWindowsRegistryInt("window Y", (GetSystemMetrics(SM_CYSCREEN) - window_height) / 2), | |
425 window_width, window_height, nullptr, | |
1804 | 426 nullptr, wcxw.hInstance, this); |
427 if (!api_handle) | |
428 { | |
429 UnregisterClassW(wcxw.lpszClassName, wcxw.hInstance); | |
430 return false; | |
431 } | |
432 | |
433 SetWindowedMode(window_width, window_height); | |
434 Show(); | |
435 | |
436 SetActiveWindow(api_handle); | |
437 | |
438 MSG msg; | |
439 while (PeekMessageW(&msg, api_handle, 0, 0, PM_REMOVE)) | |
440 { | |
441 TranslateMessage(&msg); | |
442 DispatchMessageW(&msg); | |
443 } | |
444 | |
445 return true; | |
446 } | |
447 | |
448 | |
449 | |
450 | |
451 OSWindow *OSWindow::Create(const wchar_t *title, int window_width, int window_height) | |
452 { | |
2061 | 453 auto window = new OSWindow; |
1804 | 454 if (window) |
455 if (!window->Initialize(title, window_width, window_height)) | |
456 { | |
457 delete window; | |
458 window = nullptr; | |
459 } | |
460 | |
461 return window; | |
462 } | |
463 | |
464 | |
465 | |
2459 | 466 LRESULT CALLBACK OSWindow::WinApiMsgRouter(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
1804 | 467 { |
468 if (msg == WM_NCCREATE) | |
469 { | |
1980 | 470 CREATESTRUCTA* cs = (CREATESTRUCTA *)(lparam); |
471 OSWindow* window = (OSWindow *)cs->lpCreateParams; | |
1804 | 472 SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)window); |
473 return DefWindowProcW(hwnd, msg, wparam, lparam); | |
474 } | |
1980 | 475 OSWindow* window = (OSWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); |
2420 | 476 if (window && window->api_handle == hwnd) //Uninitialized memory access |
1804 | 477 { |
478 LPARAM result; | |
2443 | 479 if (window->WinApiMessageProc(msg, wparam, lparam, &result))//Unhandled application exception |
1804 | 480 return result; |
481 } | |
482 return DefWindowProcW(hwnd, msg, (WPARAM)wparam, (LPARAM)lparam); | |
483 } | |
484 | |
485 void OSWindow::Show() | |
486 { | |
487 ShowWindow(api_handle, SW_SHOWNORMAL); | |
488 UpdateWindow(api_handle); | |
489 } | |
490 | |
491 void OSWindow::SetCursor(const char *cursor_name) | |
492 { | |
493 POINT cursor_pos; | |
494 GetCursorPos(&cursor_pos); | |
495 | |
496 if (!strcmp(cursor_name, "MICON1") ) | |
2223 | 497 //SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(GetModuleHandleW(nullptr), IDC_ARROW)); |
498 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_ARROW)); | |
1804 | 499 else if (!strcmp(cursor_name, "MICON2") ) |
2219 | 500 { |
2450 | 501 //HCURSOR hCurs1; |
2223 | 502 |
2450 | 503 // Create target |
2223 | 504 |
2450 | 505 //pMouse->uCursorTextureID = pIcons_LOD->LoadTexture(cursor_name, TEXTURE_16BIT_PALETTE); |
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 | 512 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_CROSS)); |
513 | |
2219 | 514 } |
1804 | 515 else if (!strcmp(cursor_name, "MICON3") ) |
2223 | 516 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_WAIT)); |
1804 | 517 |
2450 | 518 //ClientToScreen(api_handle, &cursor_pos); //??? |
1804 | 519 SetCursorPos(cursor_pos.x, cursor_pos.y); |
520 } | |
521 | |
522 void OSWindow::SetFullscreenMode() | |
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 | 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 | 532 |
533 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, SWP_NOSIZE | SWP_SHOWWINDOW); | |
534 } | |
535 | |
536 void OSWindow::SetWindowedMode(int new_window_width, int new_window_height) | |
537 { | |
2069 | 538 RECT rcWindowPos; |
539 GetWindowRect(api_handle, &rcWindowPos); | |
540 | |
1804 | 541 SetWindowLongW(api_handle, GWL_EXSTYLE, 0); |
542 SetWindowLongW(api_handle, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW); | |
1995 | 543 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, 0); |
544 | |
1804 | 545 RECT rcWindow; |
546 GetWindowRect(api_handle, &rcWindow); | |
547 | |
548 RECT rcClient; | |
549 GetClientRect(api_handle, &rcClient); | |
550 | |
551 int window_borders_width = (rcWindow.right - rcWindow.left) - (rcClient.right - rcClient.left), | |
552 window_borders_height = (rcWindow.bottom - rcWindow.top) - (rcClient.bottom - rcClient.top); | |
553 int window_total_width = new_window_width + window_borders_width, | |
554 window_total_height = new_window_height + window_borders_height; | |
555 | |
556 #ifdef _DEBUG | |
557 if (!GetMenu(api_handle)) | |
558 window_total_height += GetSystemMetrics(SM_CYMENU); | |
559 #endif | |
2069 | 560 MoveWindow(api_handle, rcWindowPos.left, |
561 rcWindowPos.top, | |
1804 | 562 window_total_width, |
563 window_total_height, 0); | |
564 #ifdef _DEBUG | |
565 static HMENU debug_menu = CreateDebugMenuPanel(); | |
566 SetMenu(api_handle, debug_menu); | |
2069 | 567 |
568 GetWindowRect(api_handle, &rcWindow); | |
569 GetClientRect(api_handle, &rcClient); | |
1804 | 570 #endif |
571 } | |
572 | |
573 | |
574 | |
575 | |
576 HMENU OSWindow::CreateDebugMenuPanel() | |
577 { | |
578 HMENU menu = CreateMenu(); | |
579 { | |
580 HMENU file = CreatePopupMenu(); | |
581 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)file, L"&File"); | |
582 { | |
583 AppendMenuW(file, MF_ENABLED | MF_STRING, 40001, L"Exit"); | |
584 } | |
585 | |
586 HMENU debug = CreatePopupMenu(); | |
587 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug, L"&Debug"); | |
588 { | |
589 HMENU debug_party = CreatePopupMenu(); | |
590 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party, L"&Party"); | |
591 { | |
592 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40007, L"Give Gold (10 000)"); | |
593 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40008, L"Give Exp (20 000)"); | |
594 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40059, L"Give Skills (50 each)"); | |
595 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40013, L"Remove Gold"); | |
596 | |
597 HMENU debug_party_setconditions = CreatePopupMenu(); | |
598 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_setconditions, L"Set Condition"); | |
599 { | |
600 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40044, L"Afraid"); | |
601 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40043, L"Asleep"); | |
602 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40037, L"Curse"); | |
2187 | 603 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease Weak"); |
604 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease Medium"); | |
605 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease Severe"); | |
1804 | 606 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40041, L"Dead"); |
607 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40039, L"Drunk"); | |
608 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40042, L"Eradicated"); | |
609 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40038, L"Insane"); | |
610 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40045, L"Paralyzed"); | |
2187 | 611 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison Weak"); |
612 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison Medium"); | |
613 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison Severe"); | |
1804 | 614 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40029, L"&Stone"); |
615 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40040, L"Unconscious"); | |
616 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40030, L"Weak"); | |
617 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40073, L"Zombie"); | |
618 } | |
619 | |
620 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40006, L"Set Food (20)"); | |
621 | |
622 HMENU debug_party_alignment = CreatePopupMenu(); | |
623 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_alignment, L"Alignment"); | |
624 { | |
625 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40062, L"Good"); | |
626 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING | MF_CHECKED, 40063, L"Neutral"); | |
627 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40064, L"Evil"); | |
628 } | |
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 | 631 HMENU debug_time = CreatePopupMenu(); |
632 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_time, L"&Time"); | |
633 { | |
634 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40009, L"Add 1 Day"); | |
635 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40010, L"Add 1 Week"); | |
636 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40011, L"Add 1 Month"); | |
637 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40012, L"Add 1 Year"); | |
638 } | |
639 | |
640 HMENU debug_items = CreatePopupMenu(); | |
641 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_items, L"&Items"); | |
642 { | |
643 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40015, L"Generate level &1 item"); | |
644 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40016, L"Generate level &2 item"); | |
645 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40017, L"Generate level &3 item"); | |
646 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40018, L"Generate level &4 item"); | |
647 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40019, L"Generate level &5 item"); | |
648 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40020, L"Generate level &6 item"); | |
649 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40061, L"Generate special item"); | |
650 } | |
651 | |
652 HMENU debug_graphics = CreatePopupMenu(); | |
653 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_graphics, L"&Graphics"); | |
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 | 668 HMENU debug_terrain = CreatePopupMenu(); |
669 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_terrain, L"Debug Terrain");//40104 | |
670 { | |
671 AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40127, L"Debug Terrain on"); | |
672 AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40128, L"Debug Terrain off"); | |
673 } | |
674 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40023, L"Lighting Mode"); | |
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 | 691 } |
692 | |
693 HMENU debug_misc = CreatePopupMenu(); | |
694 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_misc, L"&Misc"); | |
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 | 701 } |
702 | |
703 HMENU debug_eax = CreatePopupMenu(); | |
704 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_eax, L"EAX Environs"); | |
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 | 733 } |
734 } | |
2277 | 735 HMENU other = CreatePopupMenu(); |
736 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other, L"&Other"); | |
737 { | |
738 HMENU other_wizard_eye = CreatePopupMenu(); | |
739 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_wizard_eye, L"Wizard eye"); | |
740 { | |
741 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40101, L"Wizard eye on"); | |
742 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40102, L"Wizard eye off"); | |
743 } | |
744 HMENU other_new_draw_object_dist = CreatePopupMenu(); | |
745 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_draw_object_dist, L"New draw object distance"); | |
746 { | |
747 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40103, L"New draw object dist on"); | |
748 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40104, L"New draw object dist off"); | |
749 } | |
750 HMENU other_change_seasons = CreatePopupMenu(); | |
751 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_change_seasons, L"Change seasons"); | |
752 { | |
753 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40105, L"Change seasons on"); | |
754 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40106, L"Change seasons off"); | |
755 } | |
756 HMENU other_all_magic = CreatePopupMenu(); | |
757 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_all_magic, L"All magic"); | |
758 { | |
759 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40107, L"All magic on"); | |
760 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40108, L"All magic off"); | |
761 } | |
762 HMENU other_debug_information = CreatePopupMenu(); | |
763 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_debug_information, L"Debug information"); | |
764 { | |
765 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40109, L"Debug information on"); | |
766 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40110, L"Debug information off"); | |
767 } | |
768 HMENU other_show_picked_face = CreatePopupMenu(); | |
769 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_show_picked_face, L"Show picked face"); | |
770 { | |
771 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40111, L"Show picked face on"); | |
772 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40112, L"Show picked face off"); | |
773 } | |
774 HMENU other_draw_portals_loops = CreatePopupMenu(); | |
775 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_portals_loops, L"Draw portals loops"); | |
776 { | |
777 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40113, L"Draw portals loops on"); | |
778 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40114, L"Draw portals loops off"); | |
779 } | |
780 HMENU other_new_speed = CreatePopupMenu(); | |
781 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_speed, L"New_speed"); | |
782 { | |
783 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40115, L"New_speed on"); | |
784 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40116, L"New_speed off"); | |
785 } | |
786 HMENU other_snow = CreatePopupMenu(); | |
787 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_snow, L"Snow"); | |
788 { | |
789 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40117, L"Snowfall on"); | |
790 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40118, L"Snowfall off"); | |
791 } | |
2320 | 792 HMENU other_draw_terrain_dist_mist = CreatePopupMenu(); |
793 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_terrain_dist_mist, L"New draw terrain distance"); | |
794 { | |
795 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40119, L"New draw terrain distance on"); | |
796 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40120, L"New draw terrain distance off"); | |
797 } | |
2277 | 798 |
799 } | |
1804 | 800 } |
801 return menu; | |
802 } | |
803 | |
804 | |
805 | |
806 | |
807 bool OSWindow::OnOSMenu(int item_id) | |
808 { | |
809 switch (item_id) | |
810 { | |
811 default: return false; | |
812 | |
813 | |
2132 | 814 //case 103: pRenderer->SavePCXScreenshot(); break; |
1804 | 815 case 101: // Quit game |
2132 | 816 case 40001: // Menu "File"-> "Exit" |
2541 | 817 pEngine->Deinitialize(); |
1804 | 818 SendMessageW(api_handle, WM_DESTROY, 0, 0); |
819 break; | |
820 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
821 /*case 104: //F4 button |
1804 | 822 pRenderer->ChangeBetweenWinFullscreenModes(); |
823 if (pArcomageGame->bGameInProgress) | |
824 pArcomageGame->field_F6 = 1; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
825 break;*/ |
1804 | 826 |
827 //SubMenu "Party" | |
828 case 40006: pParty->SetFood(pParty->uNumFoodRations + 20); break; | |
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 | 831 case 40013: pParty->SetGold(0); break; |
832 | |
833 case 40059: | |
834 for (uint i = 0; i < 4; ++i) | |
835 pParty->pPlayers[i].uSkillPoints = 50; | |
836 break; | |
837 | |
2185 | 838 case 40029: pPlayers[uActiveCharacter]->SetPertified(pParty->uTimePlayed); break; |
839 case 40030: pPlayers[uActiveCharacter]->SetWeak(pParty->uTimePlayed); break; | |
2187 | 840 case 40031: pPlayers[uActiveCharacter]->SetPoisonSevere(pParty->uTimePlayed); break; |
841 case 40032: pPlayers[uActiveCharacter]->SetPoisonMedium(pParty->uTimePlayed); break; | |
842 case 40033: pPlayers[uActiveCharacter]->SetPoisonWeak(pParty->uTimePlayed); break; | |
843 case 40034: pPlayers[uActiveCharacter]->SetDiseaseSevere(pParty->uTimePlayed); break; | |
844 case 40035: pPlayers[uActiveCharacter]->SetDiseaseMedium(pParty->uTimePlayed); break; | |
845 case 40036: pPlayers[uActiveCharacter]->SetDiseaseWeak(pParty->uTimePlayed); break; | |
2185 | 846 case 40037: pPlayers[uActiveCharacter]->SetCursed(pParty->uTimePlayed); break; |
847 case 40038: pPlayers[uActiveCharacter]->SetInsane(pParty->uTimePlayed); break; | |
848 case 40039: pPlayers[uActiveCharacter]->SetDrunk(pParty->uTimePlayed); break; | |
849 case 40040: pPlayers[uActiveCharacter]->SetUnconcious(pParty->uTimePlayed); break; | |
850 case 40041: pPlayers[uActiveCharacter]->SetDead(pParty->uTimePlayed); break; | |
851 case 40042: pPlayers[uActiveCharacter]->SetEradicated(pParty->uTimePlayed); break; | |
852 case 40043: pPlayers[uActiveCharacter]->SetAsleep(pParty->uTimePlayed); break; | |
853 case 40044: pPlayers[uActiveCharacter]->SetAfraid(pParty->uTimePlayed); break; | |
854 case 40045: pPlayers[uActiveCharacter]->SetParalyzed(pParty->uTimePlayed); break; | |
855 case 40073: pPlayers[uActiveCharacter]->SetZombie(pParty->uTimePlayed); break; | |
1804 | 856 |
857 case 40062: | |
858 pParty->alignment = PartyAlignment_Good; | |
859 SetUserInterface(pParty->alignment, true); | |
860 break; | |
861 case 40063: | |
862 pParty->alignment = PartyAlignment_Neutral; | |
863 SetUserInterface(pParty->alignment, true); | |
864 break; | |
865 case 40064: | |
866 pParty->alignment = PartyAlignment_Evil; | |
867 SetUserInterface(pParty->alignment, true); | |
868 break; | |
869 | |
870 | |
871 | |
872 //SubMenu "Time" | |
873 case 40009: pParty->uTimePlayed += Timer::Day; break; | |
874 case 40010: pParty->uTimePlayed += Timer::Week; break; | |
875 case 40011: pParty->uTimePlayed += Timer::Month; break; | |
876 case 40012: pParty->uTimePlayed += Timer::Year; break; | |
877 | |
878 //SubMenu "Items" | |
879 case 40015: // uItemID_Rep_St == 1 | |
880 case 40016: // uItemID_Rep_St == 2 | |
881 case 40017: // uItemID_Rep_St == 3 | |
882 case 40018: // uItemID_Rep_St == 4 | |
883 case 40019: // uItemID_Rep_St == 5 | |
884 case 40020: // uItemID_Rep_St == 6 | |
885 { | |
886 int pItemID = rand() % 500; | |
887 for (uint i = 0; i < 500; ++i) | |
888 { | |
889 if (pItemID + i > 499) | |
890 pItemID = 0; | |
891 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St == (item_id - 40015 + 1)) | |
892 { | |
893 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i); | |
894 break; | |
895 } | |
896 } | |
897 } | |
898 break; | |
899 | |
900 case 40061: | |
901 { | |
902 int pItemID = rand() % 500; | |
903 for (uint i = 0; i < 500; ++i) | |
904 { | |
905 if (pItemID + i > 499) | |
906 pItemID = 0; | |
907 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St > 6) | |
908 { | |
909 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i); | |
910 break; | |
911 } | |
912 } | |
913 } | |
914 break; | |
2277 | 915 //SubMenu "Other" |
2450 | 916 case 40101: wizard_eye = true; break; |
917 case 40102: wizard_eye = false; break; | |
918 case 40103: pODMRenderParams->shading_dist_mist = 0x6000; break; | |
919 case 40104: pODMRenderParams->shading_dist_mist = 0x2000; break; | |
920 case 40105: change_seasons = true; break; | |
921 case 40106: change_seasons = false; break; | |
922 case 40107: all_magic = true; break; | |
923 case 40108: all_magic = false; break; | |
924 case 40109: debug_information = true; break; | |
925 case 40110: debug_information = false; break; | |
926 case 40111: show_picked_face = true; break; | |
927 case 40112: show_picked_face = false; break; | |
928 case 40113: draw_portals_loops = true; break; | |
929 case 40114: draw_portals_loops = false; break; | |
930 case 40115: new_speed = true; break; | |
931 case 40116: new_speed = false; break; | |
932 case 40117: bSnow = true; break; | |
933 case 40118: bSnow = false; break; | |
934 case 40119: draw_terrain_dist_mist = true; break; | |
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 | 941 case 40127: debug_terrain_polygin = true; break; |
942 case 40128: debug_terrain_polygin = false; break; | |
1804 | 943 } |
944 | |
945 return true; | |
1924
8cd321994943
MSVS 2012 project file & some compilation warning fixes
Nomad
parents:
1830
diff
changeset
|
946 } |
2277 | 947 |