World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс WinApiWindow

#include <WinApiWindow.h>

+ Граф наследования:WinApiWindow:
+ Граф связей класса WinApiWindow:

Открытые члены

 WinApiWindow (HWND hwnd)
 
void SetFullscreenMode () override
 
void SetWindowedMode (int new_window_width, int new_window_height) override
 
void SetCursor (const char *cursor_name) override
 
int GetX () const override
 
int GetY () const override
 
unsigned int GetWidth () const override
 
unsigned int GetHeight () const override
 
Point TransformCursorPos (Point &pt) const override
 
bool OnOSMenu (int item_id) override
 
void Show () override
 
bool Focused () override
 
void Activate () override
 
void PeekSingleMessage () override
 
void PeekMessageLoop () override
 
voidGetWinApiHandle () override
 
- Открытые члены унаследованные от OSWindow
 OSWindow ()
 
virtual void OpenGlCreate ()=0
 
virtual void OpenGlSwapBuffers ()=0
 

Закрытые члены

bool WinApiMessageProc (int msg, int wparam, void *lparam, void **result)
 
voidCreateDebugMenuPanel ()
 

Закрытые данные

HWND hwnd = nullptr
 

Друзья

voidWinApiMsgRouter (HWND hwnd, int msg, int wparam, void *lparam)
 

Дополнительные унаследованные члены

- Защищенные данные унаследованные от OSWindow
GameWindowHandlergameCallback = nullptr
 
Loglog = nullptr
 

Подробное описание

См. определение в файле WinApiWindow.h строка 9

Конструктор(ы)

◆ WinApiWindow()

WinApiWindow::WinApiWindow ( HWND  hwnd)
inlineexplicit

См. определение в файле WinApiWindow.h строка 11

12  : OSWindow() {
13  this->hwnd = hwnd;
14  }

Перекрестные ссылки hwnd.

Методы

◆ SetFullscreenMode()

void WinApiWindow::SetFullscreenMode ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 241

241  {
242  // Ritor1: Error. Window size changed in this
243  // function when switching to fullscrean mode
244  SetMenu(hwnd, nullptr); // 640,480 - 640,500
245  /*bool m = false;
246  HMENU h_menu = GetMenu(api_handle);
247  m = DestroyMenu(h_menu);// - */
248 
249  SetWindowLongW(hwnd, GWL_EXSTYLE, WS_EX_TOPMOST);
250  SetWindowLongW(hwnd, GWL_STYLE, WS_VISIBLE | WS_POPUP); // 648, 534
251 
252  SetWindowPos(hwnd, HWND_TOP, 0, 0, -1, -1, SWP_NOSIZE | SWP_SHOWWINDOW);
253 }

Перекрестные ссылки hwnd.

◆ SetWindowedMode()

void WinApiWindow::SetWindowedMode ( int  new_window_width,
int  new_window_height 
)
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 255

255  {
256  RECT rcWindowPos;
257  GetWindowRect(hwnd, &rcWindowPos);
258 
259  SetWindowLongW(hwnd, GWL_EXSTYLE, 0);
260  SetWindowLongW(hwnd, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
261  SetWindowPos(hwnd, HWND_TOP, 0, 0, -1, -1, 0);
262 
263  RECT rcWindow;
264  GetWindowRect(hwnd, &rcWindow);
265 
266  RECT rcClient;
267  GetClientRect(hwnd, &rcClient);
268 
269  int window_borders_width = (rcWindow.right - rcWindow.left) - (rcClient.right - rcClient.left);
270  int window_borders_height = (rcWindow.bottom - rcWindow.top) - (rcClient.bottom - rcClient.top);
271  int window_total_width = new_window_width + window_borders_width;
272  int window_total_height = new_window_height + window_borders_height;
273 
274 #ifdef _DEBUG
275  if (!GetMenu(hwnd)) {
276  window_total_height += GetSystemMetrics(SM_CYMENU);
277  }
278 #endif
279 
280  MoveWindow(hwnd, rcWindowPos.left, rcWindowPos.top, window_total_width, window_total_height, 0);
281 
282 #ifdef _DEBUG
283  static HMENU debug_menu = (HMENU)CreateDebugMenuPanel();
284  SetMenu(hwnd, debug_menu);
285 
286  GetWindowRect(hwnd, &rcWindow);
287  GetClientRect(hwnd, &rcClient);
288 #endif
289 }

Перекрестные ссылки CreateDebugMenuPanel() и hwnd.

+ Граф вызовов:

◆ SetCursor()

void WinApiWindow::SetCursor ( const char *  cursor_name)
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 214

214  {
215  POINT cursor_pos;
216  GetCursorPos(&cursor_pos);
217 
218  if (!strcmp(cursor_name, "MICON1")) {
219  // SetClassLongPtrW(api_handle, GCLP_HCURSOR,
220  // (LONG)LoadCursorW(GetModuleHandleW(nullptr), IDC_ARROW));
221  SetClassLongPtrW(hwnd, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_ARROW));
222  } else if (!strcmp(cursor_name, "MICON2")) {
223  // HCURSOR hCurs1;
224 
225  // Create target
226 
227  if (false) {
228  MessageBoxA(nullptr,
229  "Ritor1: original cursor(Target) isn't loading", "", 0);
230  __debugbreak();
231  }
232  SetClassLongPtrW(hwnd, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_CROSS));
233  } else if (!strcmp(cursor_name, "MICON3")) {
234  SetClassLongPtrW(hwnd, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_WAIT));
235  }
236 
237  // ClientToScreen(api_handle, &cursor_pos); //???
238  SetCursorPos(cursor_pos.x, cursor_pos.y);
239 }

Перекрестные ссылки __debugbreak() и hwnd.

+ Граф вызовов:

◆ GetX()

int WinApiWindow::GetX ( ) const
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 49

49  {
50  RECT rc;
51  GetWindowRect(hwnd, &rc);
52  return rc.left;
53 }

Перекрестные ссылки hwnd.

◆ GetY()

int WinApiWindow::GetY ( ) const
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 54

54  {
55  RECT rc;
56  GetWindowRect(hwnd, &rc);
57  return rc.top;
58 }

Перекрестные ссылки hwnd.

◆ GetWidth()

unsigned int WinApiWindow::GetWidth ( ) const
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 59

59  {
60  RECT rc;
61  GetClientRect(hwnd, &rc);
62  return rc.right - rc.left;
63 }

Перекрестные ссылки hwnd.

◆ GetHeight()

unsigned int WinApiWindow::GetHeight ( ) const
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 64

64  {
65  RECT rc;
66  GetClientRect(hwnd, &rc);
67  return rc.bottom - rc.top;
68 }

Перекрестные ссылки hwnd.

◆ TransformCursorPos()

Point WinApiWindow::TransformCursorPos ( Point pt) const
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 71

71  {
72  Point transformed = pt;
73  ScreenToClient(hwnd, (POINT *)&transformed);
74 
75  return transformed;
76 }

Перекрестные ссылки hwnd.

◆ OnOSMenu()

bool WinApiWindow::OnOSMenu ( int  item_id)
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 565

565  {
566  switch (item_id) {
567  default:
568  return false;
569 
570  case 103: __debugbreak(); // render->SavePCXScreenshot(); break;
571  case 104: __debugbreak(); // render->ToggleFullscreen(); break;
572  case 101: // Quit game
573  case 40001: // Menu "File"-> "Exit"
574  engine->Deinitialize();
575  SendMessageW(hwnd, WM_DESTROY, 0, 0);
576  break;
577 
578  case 40002: // Menu "File"-> "Take Screenshot"
579  render->SavePCXScreenshot();
580  break;
581 
582  /*case 104: //F4 button
583  render->ChangeBetweenWinFullscreenModes();
584  if (pArcomageGame->bGameInProgress)
585  pArcomageGame->field_F6 = 1;
586  break;*/
587 
588  // SubMenu "Party"
589  case 40006:
590  Party::GiveFood(20);
591  break;
592  case 40007:
593  Party::AddGold(10000);
594  break;
595  case 40008:
596  pParty->GivePartyExp(20000);
597  break;
598  case 40013:
599  pParty->SetGold(0);
600  break;
601 
602  case 40059:
603  for (uint i = 0; i < 4; ++i) pParty->pPlayers[i].uSkillPoints += 50;
604  break;
605 
606  // learn all skills for class
607  case 40060:
608  for (uint i = 1; i < 5; ++i) { // loop over players
609  for (int ski = 0; ski < 37; ++ski) { // loop over skills
610  if (byte_4ED970_skill_learn_ability_by_class_table[pPlayers[i]->classType][ski] > 0) { // if class can learn this skill
611  switch (ski) { // give skils
612  case 0: // PLAYER_SKILL_STAFF = 0,
613  if (pPlayers[i]->skillStaff == 0)
614  pPlayers[i]->AddSkillByEvent(
615  &Player::skillStaff, 1);
616  break;
617  case 1: // PLAYER_SKILL_SWORD = 1,
618  if (pPlayers[i]->skillSword == 0)
619  pPlayers[i]->AddSkillByEvent(
620  &Player::skillSword, 1);
621  break;
622  case 2: // PLAYER_SKILL_DAGGER = 2,
623  if (pPlayers[i]->skillDagger == 0)
624  pPlayers[i]->AddSkillByEvent(
625  &Player::skillDagger, 1);
626  break;
627  case 3: // PLAYER_SKILL_AXE = 3,
628  if (pPlayers[i]->skillAxe == 0)
629  pPlayers[i]->AddSkillByEvent(
630  &Player::skillAxe, 1);
631  break;
632  case 4: // PLAYER_SKILL_SPEAR = 4,
633  if (pPlayers[i]->skillSpear == 0)
634  pPlayers[i]->AddSkillByEvent(
635  &Player::skillSpear, 1);
636  break;
637  case 5: // PLAYER_SKILL_BOW = 5,
638  if (pPlayers[i]->skillBow == 0)
639  pPlayers[i]->AddSkillByEvent(
640  &Player::skillBow, 1);
641  break;
642  case 6: // PLAYER_SKILL_MACE = 6,
643  if (pPlayers[i]->skillMace == 0)
644  pPlayers[i]->AddSkillByEvent(
645  &Player::skillMace, 1);
646  break;
647  case 7: // PLAYER_SKILL_BLASTER = 7,
648  if (pPlayers[i]->skillBlaster == 0)
649  pPlayers[i]->AddSkillByEvent(
651  break;
652  case 8: // PLAYER_SKILL_SHIELD = 8,
653  if (pPlayers[i]->skillShield == 0)
654  pPlayers[i]->AddSkillByEvent(
655  &Player::skillShield, 1);
656  break;
657  case 9: // PLAYER_SKILL_LEATHER = 9,
658  if (pPlayers[i]->skillLeather == 0)
659  pPlayers[i]->AddSkillByEvent(
661  break;
662  case 10: // PLAYER_SKILL_CHAIN = 10,
663  if (pPlayers[i]->skillChain == 0)
664  pPlayers[i]->AddSkillByEvent(
665  &Player::skillChain, 1);
666  break;
667  case 11: // PLAYER_SKILL_PLATE = 11,
668  if (pPlayers[i]->skillPlate == 0)
669  pPlayers[i]->AddSkillByEvent(
670  &Player::skillPlate, 1);
671  break;
672  case 12: // PLAYER_SKILL_FIRE = 12,
673  if (pPlayers[i]->skillFire == 0)
674  pPlayers[i]->AddSkillByEvent(
675  &Player::skillFire, 1);
676  break;
677  case 13: // PLAYER_SKILL_AIR = 13,
678  if (pPlayers[i]->skillAir == 0)
679  pPlayers[i]->AddSkillByEvent(
680  &Player::skillAir, 1);
681  break;
682  case 14: // PLAYER_SKILL_WATER = 14,
683  if (pPlayers[i]->skillWater == 0)
684  pPlayers[i]->AddSkillByEvent(
685  &Player::skillWater, 1);
686  break;
687  case 15: // PLAYER_SKILL_EARTH = 15,
688  if (pPlayers[i]->skillEarth == 0)
689  pPlayers[i]->AddSkillByEvent(
690  &Player::skillEarth, 1);
691  break;
692  case 16: // PLAYER_SKILL_SPIRIT = 16,
693  if (pPlayers[i]->skillSpirit == 0)
694  pPlayers[i]->AddSkillByEvent(
695  &Player::skillSpirit, 1);
696  break;
697  case 17: // PLAYER_SKILL_MIND = 17,
698  if (pPlayers[i]->skillMind == 0)
699  pPlayers[i]->AddSkillByEvent(
700  &Player::skillMind, 1);
701  break;
702  case 18: // PLAYER_SKILL_BODY = 18,
703  if (pPlayers[i]->skillBody == 0)
704  pPlayers[i]->AddSkillByEvent(
705  &Player::skillBody, 1);
706  break;
707  case 19: // PLAYER_SKILL_LIGHT = 19,
708  if (pPlayers[i]->skillLight == 0)
709  pPlayers[i]->AddSkillByEvent(
710  &Player::skillLight, 1);
711  break;
712  case 20: // PLAYER_SKILL_DARK = 20,
713  if (pPlayers[i]->skillDark == 0)
714  pPlayers[i]->AddSkillByEvent(
715  &Player::skillDark, 1);
716  break;
717  case 21: // PLAYER_SKILL_ITEM_ID = 21,
718  if (pPlayers[i]->skillItemId == 0)
719  pPlayers[i]->AddSkillByEvent(
720  &Player::skillItemId, 1);
721  break;
722  case 22: // PLAYER_SKILL_MERCHANT = 22,
723  if (pPlayers[i]->skillMerchant == 0)
724  pPlayers[i]->AddSkillByEvent(
726  break;
727  case 23: // PLAYER_SKILL_REPAIR = 23,
728  if (pPlayers[i]->skillRepair == 0)
729  pPlayers[i]->AddSkillByEvent(
730  &Player::skillRepair, 1);
731  break;
732  case 24: // PLAYER_SKILL_BODYBUILDING = 24,
733  if (pPlayers[i]->skillBodybuilding == 0)
734  pPlayers[i]->AddSkillByEvent(
736  break;
737  case 25: // PLAYER_SKILL_MEDITATION = 25,
738  if (pPlayers[i]->skillMeditation == 0)
739  pPlayers[i]->AddSkillByEvent(
741  break;
742  case 26: // PLAYER_SKILL_PERCEPTION = 26,
743  if (pPlayers[i]->skillPerception == 0)
744  pPlayers[i]->AddSkillByEvent(
746  break;
747  case 27: // PLAYER_SKILL_DIPLOMACY = 27,
748  break;
749  case 28: // PLAYER_SKILL_TIEVERY = 28,
750  break;
751  case 29: // PLAYER_SKILL_TRAP_DISARM = 29,
752  if (pPlayers[i]->skillDisarmTrap == 0)
753  pPlayers[i]->AddSkillByEvent(
755  break;
756  case 30: // PLAYER_SKILL_DODGE = 30,
757  if (pPlayers[i]->skillDodge == 0)
758  pPlayers[i]->AddSkillByEvent(
759  &Player::skillDodge, 1);
760  break;
761  case 31: // PLAYER_SKILL_UNARMED = 31,
762  if (pPlayers[i]->skillUnarmed == 0)
763  pPlayers[i]->AddSkillByEvent(
765  break;
766  case 32: // PLAYER_SKILL_MONSTER_ID = 32,
767  if (pPlayers[i]->skillMonsterId == 0)
768  pPlayers[i]->AddSkillByEvent(
770  break;
771  case 33: // PLAYER_SKILL_ARMSMASTER = 33,
772  if (pPlayers[i]->skillArmsmaster == 0)
773  pPlayers[i]->AddSkillByEvent(
775  break;
776  case 34: // PLAYER_SKILL_STEALING = 34,
777  if (pPlayers[i]->skillStealing == 0)
778  pPlayers[i]->AddSkillByEvent(
780  break;
781  case 35: // PLAYER_SKILL_ALCHEMY = 35,
782  if (pPlayers[i]->skillAlchemy == 0)
783  pPlayers[i]->AddSkillByEvent(
785  break;
786  case 36: // PLAYER_SKILL_LEARNING = 36,
787  if (pPlayers[i]->skillLearning == 0)
788  pPlayers[i]->AddSkillByEvent(
790  break;
791 
792  // PLAYER_SKILL_CLUB = 37,
793  // PLAYER_SKILL_MISC = 38,
794  // PLAYER_SKILL_INVALID = -1
795  }
796  }
797  }
798  }
799  break;
800 
801  case 40029:
802  pPlayers[uActiveCharacter]->SetPertified(pParty->GetPlayingTime());
803  break;
804  case 40030:
806  break;
807  case 40031:
808  pPlayers[uActiveCharacter]->SetPoisonSevere(
810  break;
811  case 40032:
812  pPlayers[uActiveCharacter]->SetPoisonMedium(
814  break;
815  case 40033:
816  pPlayers[uActiveCharacter]->SetPoisonWeak(
818  break;
819  case 40034:
820  pPlayers[uActiveCharacter]->SetDiseaseSevere(
822  break;
823  case 40035:
824  pPlayers[uActiveCharacter]->SetDiseaseMedium(
826  break;
827  case 40036:
828  pPlayers[uActiveCharacter]->SetDiseaseWeak(
830  break;
831  case 40037:
833  break;
834  case 40038:
836  break;
837  case 40039:
839  break;
840  case 40040:
841  pPlayers[uActiveCharacter]->SetUnconcious(pParty->GetPlayingTime());
842  break;
843  case 40041:
845  break;
846  case 40042:
847  pPlayers[uActiveCharacter]->SetEradicated(pParty->GetPlayingTime());
848  break;
849  case 40043:
851  break;
852  case 40044:
854  break;
855  case 40045:
856  pPlayers[uActiveCharacter]->SetParalyzed(pParty->GetPlayingTime());
857  break;
858  case 40073:
860  break;
861  case 40046:
862  pPlayers[uActiveCharacter]->conditions_times.fill(GameTime(0));
863  pPlayers[uActiveCharacter]->sHealth =
864  pPlayers[uActiveCharacter]->GetMaxHealth();
865  pPlayers[uActiveCharacter]->sMana =
866  pPlayers[uActiveCharacter]->GetMaxMana();
867  break;
868  // 40046
869 
870  case 40062:
873  break;
874  case 40063:
877  break;
878  case 40064:
881  break;
882 
883  // SubMenu "Time"
884  case 40009:
886  break;
887  case 40010:
889  break;
890  case 40011:
892  break;
893  case 40012:
895  break;
896 
897  // SubMenu "Items"
898  case 40015: // uItemID_Rep_St == 1
899  case 40016: // uItemID_Rep_St == 2
900  case 40017: // uItemID_Rep_St == 3
901  case 40018: // uItemID_Rep_St == 4
902  case 40019: // uItemID_Rep_St == 5
903  case 40020: // uItemID_Rep_St == 6
904  {
905  int pItemID = rand() % 500;
906  for (uint i = 0; i < 500; ++i) {
907  if (pItemID + i > 499) pItemID = 0;
908  if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St ==
909  (item_id - 40015 + 1)) {
910  pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
911  break;
912  }
913  }
914  } break;
915 
916  case 40061: {
917  int pItemID = rand() % 500;
918  for (uint i = 0; i < 500; ++i) {
919  if (pItemID + i > 499) pItemID = 0;
920  if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St > 6) {
921  pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
922  break;
923  }
924  }
925  } break;
926 
927  // SubMenu "Other"
928  case 40101:
929  engine->SetDebugWizardEye(true);
930  break;
931  case 40102:
932  engine->SetDebugWizardEye(false);
933  break;
934  case 40103:
935  pODMRenderParams->far_clip = 0x6000;
936  break;
937  case 40104:
938  pODMRenderParams->far_clip = 0x2000;
939  break;
940  case 40105:
941  engine->SetSeasonsChange(true);
942  break;
943  case 40106:
944  engine->SetSeasonsChange(false);
945  break;
946  case 40107:
947  engine->SetDebugAllMagic(true);
948  break; // may need to close and reopen spellbook when changed??
949  case 40108:
950  engine->SetDebugAllMagic(false);
951  break; // may need to close and reopen spellbook when changed??
952  case 40109:
953  engine->SetDebugShowFps(true);
954  break;
955  case 40110:
956  engine->SetDebugShowFps(false);
957  break;
958  case 40111:
959  engine->SetDebugShowPickedFace(true);
960  break;
961  case 40112:
962  engine->SetDebugShowPickedFace(false);
963  break;
964  case 40113:
965  engine->SetDebugPortalOutlines(true);
966  break;
967  case 40114:
968  engine->SetDebugPortalOutlines(false);
969  break;
970  case 40115:
971  engine->SetDebugTurboSpeed(true);
972  break;
973  case 40116:
974  engine->SetDebugTurboSpeed(false);
975  break;
976  case 40117:
977  engine->SetAllowSnow(true);
978  break;
979  case 40118:
980  engine->SetAllowSnow(false);
981  break;
982  case 40119:
983  engine->SetExtendedDrawDistance(true);
984  break;
985  case 40120:
986  engine->SetExtendedDrawDistance(false);
987  break;
988  case 40122:
989  engine->SetNoActors(true);
990  break;
991  case 40123:
992  engine->SetAllowLightmaps(true);
993  break;
994  case 40124:
995  engine->SetAllowLightmaps(false);
996  break;
997  case 40125:
998  engine->SetDebugLightmapsDecals(true);
999  break;
1000  case 40126:
1001  engine->SetDebugLightmapsDecals(false);
1002  break;
1003  case 40127:
1004  engine->SetDebugTerrain(true);
1005  break;
1006  case 40128:
1007  engine->SetDebugTerrain(false);
1008  break;
1009  }
1010 
1011  return true;
1012 }

Перекрестные ссылки __debugbreak(), Party::AddGold(), Party::alignment, byte_4ED970_skill_learn_ability_by_class_table, engine, ODMRenderParams::far_clip, GameTime::FromDays(), GameTime::FromYears(), Party::GetPlayingTime(), Party::GiveFood(), Party::GivePartyExp(), hwnd, Timer::Month, PartyAlignment_Evil, PartyAlignment_Good, PartyAlignment_Neutral, ItemsTable::pItems, pItemsTable, pODMRenderParams, pParty, pPlayers, Party::pPlayers, render, Party::SetGold(), SetUserInterface(), Player::skillAir, Player::skillAlchemy, Player::skillArmsmaster, Player::skillAxe, Player::skillBlaster, Player::skillBody, Player::skillBodybuilding, Player::skillBow, Player::skillChain, Player::skillDagger, Player::skillDark, Player::skillDisarmTrap, Player::skillDodge, Player::skillEarth, Player::skillFire, Player::skillItemId, Player::skillLearning, Player::skillLeather, Player::skillLight, Player::skillMace, Player::skillMeditation, Player::skillMerchant, Player::skillMind, Player::skillMonsterId, Player::skillPerception, Player::skillPlate, Player::skillRepair, Player::skillShield, Player::skillSpear, Player::skillSpirit, Player::skillStaff, Player::skillStealing, Player::skillSword, Player::skillUnarmed, Player::skillWater, uActiveCharacter, GameTime::value и Timer::Week.

Используется в WinApiMessageProc().

+ Граф вызовов:
+ Граф вызова функции:

◆ Show()

void WinApiWindow::Show ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 209

209  {
210  ShowWindow(hwnd, SW_SHOWNORMAL);
211  UpdateWindow(hwnd);
212 }

Перекрестные ссылки hwnd.

◆ Focused()

bool WinApiWindow::Focused ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 69

69 { return GetFocus() == hwnd; }

Перекрестные ссылки hwnd.

◆ Activate()

void WinApiWindow::Activate ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 15

15  {
16  SetActiveWindow(hwnd);
17  SetForegroundWindow(hwnd);
18  SendMessageW(hwnd, WM_ACTIVATEAPP, 1, 0);
19 
21 }

Перекрестные ссылки hwnd и PeekMessageLoop().

+ Граф вызовов:

◆ PeekSingleMessage()

void WinApiWindow::PeekSingleMessage ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 35

35  {
36  MSG msg;
37  if (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) {
38  if (msg.message == WM_QUIT) {
39  extern void Engine_DeinitializeAndTerminate(int exit_code);
41  }
42  TranslateMessage(&msg);
43  DispatchMessageW(&msg);
44  }
45 }

Перекрестные ссылки Engine_DeinitializeAndTerminate().

+ Граф вызовов:

◆ PeekMessageLoop()

void WinApiWindow::PeekMessageLoop ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 23

23  {
24  MSG msg;
25  while (PeekMessageW(&msg, hwnd, 0, 0, PM_REMOVE)) {
26  if (msg.message == WM_QUIT) {
27  extern void Engine_DeinitializeAndTerminate(int exit_code);
29  }
30  TranslateMessage(&msg);
31  DispatchMessageW(&msg);
32  }
33 }

Перекрестные ссылки Engine_DeinitializeAndTerminate() и hwnd.

Используется в Activate().

+ Граф вызовов:
+ Граф вызова функции:

◆ GetWinApiHandle()

void * WinApiWindow::GetWinApiHandle ( )
overridevirtual

Замещает OSWindow.

См. определение в файле WinApiWindow.cpp строка 11

11  {
12  return (void *)hwnd;
13 }

Перекрестные ссылки hwnd.

◆ WinApiMessageProc()

bool WinApiWindow::WinApiMessageProc ( int  msg,
int  wparam,
void lparam,
void **  result 
)
private

См. определение в файле WinApiWindow.cpp строка 78

78  {
79  switch (msg) {
80  case WM_KEYUP: {
81  if (wparam == VK_CONTROL) {
82  extern bool _507B98_ctrl_pressed;
83  _507B98_ctrl_pressed = false;
84  }
85  if (wparam == VK_SNAPSHOT) {
86  gameCallback->OnScreenshot();
87  }
88 
89  return *result = 0, true;
90  }
91 
92  case WM_SIZING:
93  return *result = (void *)1, true;
94  case WM_WINDOWPOSCHANGED:
95  // if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() &&
96  // pVideoPlayer->pBinkBuffer)
97  // BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
98  return false;
99 
100  case WM_CHAR:
101  gameCallback->OnChar(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_COMMAND:
111  if (OnOSMenu(wparam)) {
112  return *result = 0, true;
113  }
114  return false;
115 
116  case WM_LBUTTONDOWN: {
117  gameCallback->OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam));
118  }
119  return false;
120 
121  case WM_RBUTTONDOWN: {
122  gameCallback->OnMouseRightClick(LOWORD(lparam), HIWORD(lparam));
123  }
124  return false;
125 
126  case WM_LBUTTONUP:
127  gameCallback->OnMouseLeftUp();
128  return false;
129 
130  case WM_RBUTTONUP:
131  gameCallback->OnMouseRightUp();
132  return false;
133 
134  case WM_LBUTTONDBLCLK: {
135  gameCallback->OnMouseLeftDoubleClick(LOWORD(lparam), HIWORD(lparam));
136  }
137  return false;
138 
139  case WM_RBUTTONDBLCLK: {
140  gameCallback->OnMouseRightDoubleClick(LOWORD(lparam), HIWORD(lparam));
141  }
142  return false;
143 
144  case WM_MOUSEMOVE:
145  gameCallback->OnMouseMove(LOWORD(lparam), HIWORD(lparam), wparam & MK_LBUTTON, wparam & MK_RBUTTON);
146  return false;
147 
148  case WM_SYSCOMMAND:
149  if (wparam == SC_SCREENSAVE || wparam == SC_MONITORPOWER)
150  return *result = 0, true;
151  return false;
152 
153  case WM_KEYDOWN:
154  gameCallback->OnVkDown(wparam, MapVirtualKeyW(wparam, MAPVK_VK_TO_CHAR));
155  return *result = 0, true;
156 
157  case WM_ACTIVATEAPP:
158  if (wparam && (GetForegroundWindow() == hwnd)) {
159  gameCallback->OnActivated();
160  } else {
161  gameCallback->OnDeactivated();
162  }
163  return *result = 0, true;
164 
165  case WM_SETFOCUS:
166  gameCallback->OnFocus();
167  return false;
168 
169  case WM_KILLFOCUS:
170  gameCallback->OnFocusLost();
171  return false;
172 
173  case WM_PAINT:
174  if (!hwnd) return false;
175 
176  if (!GetUpdateRect(hwnd, 0, 0)) {
177  // || !dword_4E98BC_bApplicationActive &&
178  // !render->bWindowMode )
179  return *result = 0, true;
180  }
181 
182  PAINTSTRUCT Paint;
183  BeginPaint(hwnd, &Paint);
184 
185  gameCallback->OnPaint();
186 
187  EndPaint(hwnd, &Paint);
188  return *result = 0, true;
189  }
190  return *result = 0, false;
191 }

Перекрестные ссылки _507B98_ctrl_pressed, OSWindow::gameCallback, hwnd и OnOSMenu().

+ Граф вызовов:

◆ CreateDebugMenuPanel()

void * WinApiWindow::CreateDebugMenuPanel ( )
private

См. определение в файле WinApiWindow.cpp строка 291

291  {
292  HMENU menu = CreateMenu();
293  {
294  HMENU file = CreatePopupMenu();
295  AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)file,
296  L"&File");
297  {
298  AppendMenuW(file, MF_ENABLED | MF_STRING, 40001, L"Exit");
299  AppendMenuW(file, MF_ENABLED | MF_STRING, 40002,
300  L"Take Screenshot");
301  }
302 
303  HMENU debug = CreatePopupMenu();
304  AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug,
305  L"&Debug");
306  {
307  HMENU debug_party = CreatePopupMenu();
308  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP,
309  (UINT_PTR)debug_party, L"&Party");
310  {
311  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40007,
312  L"Give Gold (10 000)");
313  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40008,
314  L"Give Exp (20 000)");
315  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40059,
316  L"Give Skills (50 each)");
317  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40060,
318  L"Learn Skills");
319  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40013,
320  L"Remove Gold");
321 
322  HMENU debug_party_setconditions = CreatePopupMenu();
323  AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP,
324  (UINT_PTR)debug_party_setconditions,
325  L"Set Condition");
326  {
327  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40044, L"Afraid");
328  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40043, L"Asleep");
329  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40037, L"Curse");
330  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease Weak");
331  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease Medium");
332  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease Severe");
333  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40041, L"Dead");
334  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40039, L"Drunk");
335  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40042, L"Eradicated");
336  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40038, L"Insane");
337  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40045, L"Paralyzed");
338  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison Weak");
339  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison Medium");
340  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison Severe");
341  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40029, L"&Stone");
342  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40040, L"Unconscious");
343  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40030, L"Weak");
344  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40073, L"Zombie");
345  AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40046, L"Good");
346  }
347 
348  AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40006, L"Set Food (20)");
349 
350  HMENU debug_party_alignment = CreatePopupMenu();
351  AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_alignment, L"Alignment");
352  {
353  AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40062, L"Good");
354  AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING | MF_CHECKED, 40063, L"Neutral");
355  AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40064, L"Evil");
356  }
357  }
358  AppendMenuW(debug, MF_ENABLED | MF_STRING, 40122, L"Actors off");
359  HMENU debug_time = CreatePopupMenu();
360  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_time, L"&Time");
361  {
362  AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40009, L"Add 1 Day");
363  AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40010, L"Add 1 Week");
364  AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40011, L"Add 1 Month");
365  AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40012, L"Add 1 Year");
366  }
367 
368  HMENU debug_items = CreatePopupMenu();
369  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP,
370  (UINT_PTR)debug_items, L"&Items");
371  {
372  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40015, L"Generate level &1 item");
373  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40016, L"Generate level &2 item");
374  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40017, L"Generate level &3 item");
375  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40018, L"Generate level &4 item");
376  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40019, L"Generate level &5 item");
377  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40020, L"Generate level &6 item");
378  AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40061, L"Generate special item");
379  }
380 
381  HMENU debug_graphics = CreatePopupMenu();
382  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP,
383  (UINT_PTR)debug_graphics, L"&Graphics");
384  {
385  HMENU lights_off = CreatePopupMenu();
386  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP,
387  (UINT_PTR)lights_off, L"Lights"); // 40104
388  {
389  AppendMenuW(lights_off, MF_ENABLED | MF_STRING, 40123, L"Lights on");
390  AppendMenuW(lights_off, MF_ENABLED | MF_STRING, 40124, L"Lights off");
391  }
392 
393  HMENU debug_lights = CreatePopupMenu();
394  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP,
395  (UINT_PTR)debug_lights, L"Debug Lights"); // 40104
396  {
397  AppendMenuW(debug_lights, MF_ENABLED | MF_STRING, 40125, L"Debug lights on");
398  AppendMenuW(debug_lights, MF_ENABLED | MF_STRING, 40126, L"Debug lights off");
399  }
400 
401  HMENU debug_terrain = CreatePopupMenu();
402  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_POPUP,
403  (UINT_PTR)debug_terrain,
404  L"Debug Terrain"); // 40104
405  {
406  AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40127, L"Debug Terrain on");
407  AppendMenuW(debug_terrain, MF_ENABLED | MF_STRING, 40128, L"Debug Terrain off");
408  }
409  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40023, L"Lighting Mode");
410  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40024, L"Lighting Geometry");
411 
412  // AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING/* |
413  // MF_GRAYED*/, 40123, L"Lights Off");
414  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40105, L"Colored Lights");
415  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40101, L"Debug Decals");
416  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40027, L"HWID Portals");
417  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40047, L"SWID Portals");
418  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40051, L"OD Frustum");
419  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40054, L"SWOD Constant Redraw");
420  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40055, L"SWOD Lit Rasterizer");
421  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40056, L"Party Light off");
422  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40060, L"SWOD Nice Lighting off");
423  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40067, L"HWOD Additive Fog Lights");
424  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40072, L"HWID Nice Lighting");
425  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40048, L"Wireframe");
426  AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40049, L"Fog");
427  }
428 
429  HMENU debug_misc = CreatePopupMenu();
430  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP,
431  (UINT_PTR)debug_misc, L"&Misc");
432  {
433  AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40066, L"Object Viewcone Culling");
434  AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40068, L"Red Tint");
435  AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40071, L"Display Secrets");
436  AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40102, L"Massive Bloodsplat");
437  AppendMenuW(debug_misc, MF_ENABLED | MF_STRING | MF_GRAYED, 40103, L"Underwater Gravity");
438  }
439 
440  HMENU debug_eax = CreatePopupMenu();
441  AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP,
442  (UINT_PTR)debug_eax, L"EAX Environs");
443  {
444  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40074, L"NONE");
445  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40075, L"GENERIC");
446  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40076, L"PADDEDCELL");
447  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40077, L"ROOM");
448  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40078, L"BATHROOM");
449  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40079, L"LIVINGROOM");
450  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40080, L"STONEROOM");
451  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40081, L"AUDITORIUM");
452  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40082, L"CONCERTHALL");
453  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40083, L"CAVE");
454  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40084, L"ARENA");
455  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40085, L"HANGAR");
456  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40086, L"CARPETEDHALLWAY");
457  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40087, L"HALLWAY");
458  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40088, L"STONECORRIDOR");
459  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40089, L"ALLEY");
460  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40090, L"FOREST");
461  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40091, L"CITY");
462  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40092, L"MOUNTAINS");
463  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40093, L"QUARRY");
464  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40094, L"PLAIN");
465  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40095, L"PARKINGLOT");
466  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40096, L"SEWERPIPE");
467  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40097, L"UNDERWATER");
468  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40098, L"DRUGGED");
469  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40099, L"DIZZY");
470  AppendMenuW(debug_eax, MF_ENABLED | MF_STRING | MF_GRAYED, 40100, L"PSICHOTIC");
471  }
472  }
473  HMENU other = CreatePopupMenu();
474  AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other,
475  L"&Other");
476  {
477  HMENU other_wizard_eye = CreatePopupMenu();
478  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
479  (UINT_PTR)other_wizard_eye, L"Wizard eye");
480  {
481  AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40101, L"Wizard eye on");
482  AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40102, L"Wizard eye off");
483  }
484 
485  HMENU other_new_draw_object_dist = CreatePopupMenu();
486  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
487  (UINT_PTR)other_new_draw_object_dist,
488  L"New draw object distance");
489  {
490  AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40103, L"New draw object dist on");
491  AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40104, L"New draw object dist off");
492  }
493 
494  HMENU other_change_seasons = CreatePopupMenu();
495  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
496  (UINT_PTR)other_change_seasons, L"Change seasons");
497  {
498  AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40105, L"Change seasons on");
499  AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40106, L"Change seasons off");
500  }
501 
502  HMENU other_all_magic = CreatePopupMenu();
503  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
504  (UINT_PTR)other_all_magic, L"All magic");
505  {
506  AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40107, L"All magic on");
507  AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40108, L"All magic off");
508  }
509 
510  HMENU other_debug_information = CreatePopupMenu();
511  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
512  (UINT_PTR)other_debug_information,
513  L"Debug information");
514  {
515  AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40109, L"Debug information on");
516  AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40110, L"Debug information off");
517  }
518 
519  HMENU other_show_picked_face = CreatePopupMenu();
520  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
521  (UINT_PTR)other_show_picked_face, L"Show picked face");
522  {
523  AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40111, L"Show picked face on");
524  AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40112, L"Show picked face off");
525  }
526 
527  HMENU other_draw_portals_loops = CreatePopupMenu();
528  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
529  (UINT_PTR)other_draw_portals_loops,
530  L"Draw portals loops");
531  {
532  AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40113, L"Draw portals loops on");
533  AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40114, L"Draw portals loops off");
534  }
535 
536  HMENU other_new_speed = CreatePopupMenu();
537  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
538  (UINT_PTR)other_new_speed, L"New_speed");
539  {
540  AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40115, L"New_speed on");
541  AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40116, L"New_speed off");
542  }
543 
544  HMENU other_snow = CreatePopupMenu();
545  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
546  (UINT_PTR)other_snow, L"Snow");
547  {
548  AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40117, L"Snowfall on");
549  AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40118, L"Snowfall off");
550  }
551 
552  HMENU other_draw_terrain_dist_mist = CreatePopupMenu();
553  AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP,
554  (UINT_PTR)other_draw_terrain_dist_mist,
555  L"New draw terrain distance");
556  {
557  AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40119, L"New draw terrain distance on");
558  AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40120, L"New draw terrain distance off");
559  }
560  }
561  }
562  return menu;
563 }

Используется в SetWindowedMode().

+ Граф вызова функции:

Документация по друзьям класса и функциям, относящимся к классу

◆ WinApiMsgRouter

void* WinApiMsgRouter ( HWND  hwnd,
int  msg,
int  wparam,
void lparam 
)
friend

См. определение в файле WinApiWindow.cpp строка 193

193  {
194  if (msg == WM_NCCREATE) {
195  CREATESTRUCTA *cs = (CREATESTRUCTA *)(lparam);
196  SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
197  return (void *)DefWindowProcW(hwnd, msg, wparam, (LPARAM)lparam);
198  }
199 
200  auto window = (WinApiWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
201  if (window) {
202  void *result;
203  if (window->WinApiMessageProc(msg, wparam, lparam, &result))
204  return result;
205  }
206  return (void *)DefWindowProcW(hwnd, msg, (WPARAM)wparam, (LPARAM)lparam);
207 }

Данные класса

◆ hwnd

HWND WinApiWindow::hwnd = nullptr
private

Объявления и описания членов классов находятся в файлах:
WinApiWindow::OnOSMenu
bool OnOSMenu(int item_id) override
Definition: WinApiWindow.cpp:565
PartyAlignment::PartyAlignment_Good
@ PartyAlignment_Good
Player::skillSword
unsigned __int16 skillSword
Definition: Player.h:673
Player::skillMeditation
unsigned __int16 skillMeditation
Definition: Player.h:697
PartyAlignment::PartyAlignment_Neutral
@ PartyAlignment_Neutral
SetUserInterface
void SetUserInterface(PartyAlignment align, bool bReplace)
Definition: GUIWindow.cpp:1032
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
Player::skillArmsmaster
unsigned __int16 skillArmsmaster
Definition: Player.h:705
Player::skillItemId
unsigned __int16 skillItemId
Definition: Player.h:693
Player::skillBlaster
unsigned __int16 skillBlaster
Definition: Player.h:679
Player::skillDodge
unsigned __int16 skillDodge
Definition: Player.h:702
Player::skillLearning
unsigned __int16 skillLearning
Definition: Player.h:708
Player::skillStealing
unsigned __int16 skillStealing
Definition: Player.h:706
PartyAlignment::PartyAlignment_Evil
@ PartyAlignment_Evil
Player::skillRepair
unsigned __int16 skillRepair
Definition: Player.h:695
Player::skillSpear
unsigned __int16 skillSpear
Definition: Player.h:676
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
Player::skillAxe
unsigned __int16 skillAxe
Definition: Player.h:675
Player::skillBow
unsigned __int16 skillBow
Definition: Player.h:677
Player::skillDagger
unsigned __int16 skillDagger
Definition: Player.h:674
Player::skillLight
unsigned __int16 skillLight
Definition: Player.h:691
Player::skillMerchant
unsigned __int16 skillMerchant
Definition: Player.h:694
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
GameTime::FromYears
static GameTime FromYears(int years)
Definition: Time.h:95
Player::skillBodybuilding
unsigned __int16 skillBodybuilding
Definition: Player.h:696
GameTime::value
int64_t value
Definition: Time.h:99
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
Player::skillLeather
unsigned __int16 skillLeather
Definition: Player.h:681
Player::skillDisarmTrap
unsigned __int16 skillDisarmTrap
Definition: Player.h:701
Player::skillWater
unsigned __int16 skillWater
Definition: Player.h:686
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
Player::skillAlchemy
unsigned __int16 skillAlchemy
Definition: Player.h:707
Player::skillMonsterId
unsigned __int16 skillMonsterId
Definition: Player.h:704
OSWindow::gameCallback
GameWindowHandler * gameCallback
Definition: OSWindow.h:43
Player::skillStaff
unsigned __int16 skillStaff
Definition: Player.h:672
pParty
Party * pParty
Definition: Party.cpp:30
Player::skillPlate
unsigned __int16 skillPlate
Definition: Player.h:683
OSWindow::OSWindow
OSWindow()
Definition: OSWindow.cpp:12
Player::skillChain
unsigned __int16 skillChain
Definition: Player.h:682
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
_507B98_ctrl_pressed
bool _507B98_ctrl_pressed
Definition: Mouse.cpp:256
Player::skillShield
unsigned __int16 skillShield
Definition: Player.h:680
WinApiWindow::CreateDebugMenuPanel
void * CreateDebugMenuPanel()
Definition: WinApiWindow.cpp:291
Engine_DeinitializeAndTerminate
void Engine_DeinitializeAndTerminate(int exitCode)
Definition: Engine.cpp:157
Party::GivePartyExp
void GivePartyExp(unsigned int pEXPNum)
Definition: Party.cpp:938
Player::skillBody
unsigned __int16 skillBody
Definition: Player.h:690
Timer::Month
static const unsigned int Month
Definition: Time.h:141
Player::skillMind
unsigned __int16 skillMind
Definition: Player.h:689
WinApiWindow
Definition: WinApiWindow.h:9
pODMRenderParams
ODMRenderParams * pODMRenderParams
Definition: Outdoor.cpp:49
Player::skillDark
unsigned __int16 skillDark
Definition: Player.h:692
Player::skillEarth
unsigned __int16 skillEarth
Definition: Player.h:687
uint
unsigned int uint
Definition: MM7.h:4
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
Player::skillUnarmed
unsigned __int16 skillUnarmed
Definition: Player.h:703
__debugbreak
void __cdecl __debugbreak(void)
Timer::Week
static const unsigned int Week
Definition: Time.h:140
Player::skillAir
unsigned __int16 skillAir
Definition: Player.h:685
GameTime::FromDays
static GameTime FromDays(int days)
Definition: Time.h:92
WinApiWindow::PeekMessageLoop
void PeekMessageLoop() override
Definition: WinApiWindow.cpp:23
ODMRenderParams::far_clip
int far_clip
Definition: IRender.h:77
Point
Definition: Point.h:3
Player::skillSpirit
unsigned __int16 skillSpirit
Definition: Player.h:688
Player::skillMace
unsigned __int16 skillMace
Definition: Player.h:678
Party::AddGold
static void AddGold(int amount)
Definition: Party.cpp:287
byte_4ED970_skill_learn_ability_by_class_table
std::array< std::array< char, 37 >, 36 > byte_4ED970_skill_learn_ability_by_class_table
Definition: mm7_data.cpp:425
GameTime
Definition: Time.h:14
Player::skillPerception
unsigned __int16 skillPerception
Definition: Player.h:698
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460
Party::SetGold
static void SetGold(int amount)
Definition: Party.cpp:281
WinApiWindow::hwnd
HWND hwnd
Definition: WinApiWindow.h:43
Party::alignment
PartyAlignment alignment
Definition: Party.h:308
Player::skillFire
unsigned __int16 skillFire
Definition: Player.h:684
Party::GiveFood
static void GiveFood(int amount)
Definition: Party.cpp:255
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52