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