annotate GUI/UI/UIMainMenu.cpp @ 2544:c674d547cc7c

GUIWindow switch logic refactored into behaviour classes
author a.parshin
date Mon, 11 May 2015 09:51:04 +0200
parents a902abdfc7f2
children 87e5590d034b
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
7 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
8
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
9 #include "..\../IO/Mouse.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
10 #include "..\../IO/Keyboard.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
11
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
12 #include "..\../GUI/GUIWindow.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
13 #include "..\../GUI/GUIFont.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
14 #include "..\../Media/Audio/AudioPlayer.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
15 #include "..\../Engine/Graphics/Render.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
16 #include "..\../Engine/LOD.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
17 #include "..\../Engine/Graphics/PaletteManager.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
18 #include "..\../Engine/Tables/IconFrameTable.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
19 #include "..\../Engine/texts.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
20 #include "..\../Engine/MMT.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
21
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
22 #include "Game/Game.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
23 #include "Game/MainMenu.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
24
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
25
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
26 //----- (0041B578) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
27 void MainMenuUI_LoadFontsAndSomeStuff()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
28 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
29 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
30 pIcons_LOD->SetupPalettes(5, 6, 5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
31 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
32 pPaletteManager->SetColorChannelInfo(5, 6, 5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
33 pPaletteManager->RecalculateAll();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
34
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
35 for (uint i = 0; i < window->GetHeight(); ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
36 pSRZBufferLineOffsets[i] = window->GetWidth() * i;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
38 uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
39
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
40 pFontArrus = LoadFont("arrus.fnt", "FONTPAL", nullptr);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
41 pFontArrus->field_3 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
42
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
43 pFontLucida = LoadFont("lucida.fnt", "FONTPAL", nullptr);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
44 pFontLucida->field_3 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
45
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
46 pFontCreate = LoadFont("create.fnt", "FONTPAL", nullptr);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
47 pFontCreate->field_3 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
48
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
49 pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", nullptr);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
50 pFontComic = LoadFont("comic.fnt", "FONTPAL", nullptr);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
51
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
52 for (uint i = 0; i < 20; ++i)
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
53 pWindowList[i] = nullptr;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
54
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
55 uNumVisibleWindows = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
56 memset(pVisibleWindowsIdxs.data(), 0, sizeof(pVisibleWindowsIdxs));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
57 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
58
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
59 //----- (004415C5) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
60 static void LoadPartyBuffIcons()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
61 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
62 for (uint i = 0; i < 14; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
63 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
64 char filename[200];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
65 sprintf(filename, "isn-%02d", i + 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
66 pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
67 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
68
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
69 uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
70 uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
71 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
73 //----- (0041B690) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
74 void MainMenuUI_Create()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
75 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
76 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
77 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
78 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
79 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
80 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
81 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA"));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
82
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
83 pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
84 pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
85 pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
86 pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
87 pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
88 pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
89 pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
90 pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
91
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
92 uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
93 uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
94 uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
95 uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
96 uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
97 uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
98 uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
99 uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
100 uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
101 uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
102 uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
103 pTexture_Leather = pIcons_LOD->LoadTexturePtr("ibground", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
104 uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
105 uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
106 uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
107 uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
108 uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
109 uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
110
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
111 pPrimaryWindow = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
112 pPrimaryWindow->CreateButton(7, 8, 460, 343, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
113
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
114 pPrimaryWindow->CreateButton(61, 424, 31, 80, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);//buttons for portraits
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
115 pPrimaryWindow->CreateButton(177, 424, 31, 80, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
116 pPrimaryWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
117 pPrimaryWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
118
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
119 pPrimaryWindow->CreateButton(24, 404, 5, 49, 1, 93, UIMSG_0, 1, 0, "", 0);//buttons for HP
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
120 pPrimaryWindow->CreateButton(139, 404, 5, 49, 1, 93, UIMSG_0, 2, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
121 pPrimaryWindow->CreateButton(255, 404, 5, 49, 1, 93, UIMSG_0, 3, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
122 pPrimaryWindow->CreateButton(370, 404, 5, 49, 1, 93, UIMSG_0, 4, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
123
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
124 pPrimaryWindow->CreateButton(97, 404, 5, 49, 1, 93, UIMSG_0, 1, 0, "", 0);//buttons for SP
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
125 pPrimaryWindow->CreateButton(212, 404, 5, 49, 1, 93, UIMSG_0, 2, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
126 pPrimaryWindow->CreateButton(328, 404, 5, 49, 1, 93, UIMSG_0, 3, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
127 pPrimaryWindow->CreateButton(443, 404, 5, 49, 1, 93, UIMSG_0, 4, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
128
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
129 uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
130 pBtn_Quests = pPrimaryWindow->CreateButton(491, 353, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
131 pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureHeight, 1, 0, UIMSG_OpenQuestBook, 0, pKeyActionMap->GetActionVKey(INPUT_Quest),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
132 pGlobalTXT_LocalizationStrings[174], pIcons_LOD->GetTexture(uTextureID_ib_td1_A), 0); //Quests
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
133
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
134 uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
135 pBtn_Autonotes = pPrimaryWindow->CreateButton(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
136 pIcons_LOD->GetTexture(uTextureID_ib_td2_A)->uTextureHeight, 1, 0, UIMSG_OpenAutonotes, 0, pKeyActionMap->GetActionVKey(INPUT_Autonotes),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
137 pGlobalTXT_LocalizationStrings[154], pIcons_LOD->GetTexture(uTextureID_ib_td2_A), 0);//Autonotes
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
138
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
139 uTextureID_ib_td3_A = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
140 pBtn_Maps = pPrimaryWindow->CreateButton(546, 353, pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
141 pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureHeight, 1, 0, UIMSG_OpenMapBook, 0, pKeyActionMap->GetActionVKey(INPUT_Mapbook),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
142 pGlobalTXT_LocalizationStrings[139], pIcons_LOD->GetTexture(uTextureID_ib_td3_A), 0); //Maps
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
143
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
144 uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
145 pBtn_Calendar = pPrimaryWindow->CreateButton(570, 353, pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
146 pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureHeight, 1, 0, UIMSG_OpenCalendar, 0, pKeyActionMap->GetActionVKey(INPUT_TimeCal),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
147 pGlobalTXT_LocalizationStrings[78], pIcons_LOD->GetTexture(uTextureID_ib_td4_A), 0);//Calendar
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
148
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
149 uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
150 pBtn_History = pPrimaryWindow->CreateButton(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
151 pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureHeight, 1, 0, UIMSG_OpenHistoryBook, 0, 72,//ascii
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
152 pGlobalTXT_LocalizationStrings[602], pIcons_LOD->GetTexture(uTextureID_ib_td5_A), 0);//History
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
153
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
154 bFlashAutonotesBook = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
155 bFlashQuestBook = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
156 bFlashHistoryBook = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
157
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
158 pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
159 pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureHeight, 2, 0, UIMSG_ClickZoomInBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomIn),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
160 pGlobalTXT_LocalizationStrings[252], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], 0); // Zoom In
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
161
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
162 pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
163 pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureHeight, 2, 0, UIMSG_ClickZoomOutBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomOut),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
164 pGlobalTXT_LocalizationStrings[251], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], 0); // Zoom Out
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
165
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
166 pPrimaryWindow->CreateButton(481, 0, 153, 67, 1, 92, UIMSG_0, 0, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
167 pPrimaryWindow->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_StartHireling1Dialogue, 0, '5', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
168 pPrimaryWindow->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_StartHireling2Dialogue, 0, '6', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
169 pPrimaryWindow->CreateButton(476, 322, 77, 17, 1, 100, UIMSG_0, 0, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
170 pPrimaryWindow->CreateButton(555, 322, 77, 17, 1, 101, UIMSG_0, 0, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
171
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
172 pBtn_CastSpell = pPrimaryWindow->CreateButton(476, 450,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
173 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
174 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
175 1, 0, UIMSG_SpellBookWindow, 0, 67, pGlobalTXT_LocalizationStrings[38], pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
176 pBtn_Rest = pPrimaryWindow->CreateButton(518, 450,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
177 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
178 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
179 1, 0, UIMSG_RestWindow, 0, 82, pGlobalTXT_LocalizationStrings[182], pIcons_LOD->GetTexture(uTextureID_Btn_Rest), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
180 pBtn_QuickReference = pPrimaryWindow->CreateButton(560, 450,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
181 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
182 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
183 1, 0, UIMSG_QuickReference, 0, 90, pGlobalTXT_LocalizationStrings[173], pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
184 pBtn_GameSettings = pPrimaryWindow->CreateButton(602, 450,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
185 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
186 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
187 1, 0, UIMSG_GameMenuButton, 0, 0, pGlobalTXT_LocalizationStrings[93], pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
188
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
189 pBtn_NPCLeft = pPrimaryWindow->CreateButton(469, 178,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
190 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
191 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
192 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
193 pBtn_NPCRight = pPrimaryWindow->CreateButton(626, 178,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
194 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
195 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
196 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
197 LoadPartyBuffIcons();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
198 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
199
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
200
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
201
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
202
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
203 //----- (00452AF3) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
204 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
205 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
206 void *v3; // edi@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
207 unsigned int v4; // eax@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
208 unsigned __int16 *v5; // edi@3
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
209 unsigned int i; // ecx@3
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
210
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
211 if (for_refactoring)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
212 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
213 MessageBoxA(nullptr, "Nomad: sub operates on 16 bit pixels, we have 32 bits.", "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
214 __debugbreak();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
215 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
216
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
217 v3 = pPixels;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
218 v4 = a1 | (a1 << 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
219 if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
220 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
221 *pPixels = v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
222 v3 = pPixels + 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
223 --uNumPixels;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
224 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
225 memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
226 v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
227 for ( i = uNumPixels & 1; i; --i ) // leftover pixels
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
228 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
229 *v5 = v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
230 ++v5;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
231 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
232 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
233
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
234 //----- (004979D2) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
235 MENU_STATE MainMenuUI_Credits_Loop()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
236 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
237 char *cred_texturet; // edi@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
238 FILE *pFile; // eax@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
239 unsigned int pSize; // esi@7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
240 MSG Msg; // [sp+84h] [bp-B8h]@10
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
241 GUIWindow credit_window;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
242 int move_Y; // [sp+128h] [bp-14h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
243 char *pString; // [sp+12Ch] [bp-10h]@9
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
244 GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
245 GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
246 RGBTexture mm6title_texture; // [sp+54h] [bp-E8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
247 RGBTexture cred_texture; // [sp+100h] [bp-3Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
248 Texture pTemporaryTexture; // [sp+Ch] [bp-130h]@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
249
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
250 pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
251 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
252
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
253 if ( pMessageQueue_50CBD0->uNumMessages )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
254 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
255 ++pIcons_LOD->uTexturePacksCount;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
256 if ( !pIcons_LOD->uNumPrevLoadedFiles )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
257 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
258 //dword_A74C88 = 0;//??? часть дальнейшего кода отсутствует, там использовалась данная переменная
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
259
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
260
2508
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
261 if ( use_music_folder )
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
262 PlayAudio(L"Music\\15.mp3");
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
263 else
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
264 pAudioPlayer->PlayMusicTrack(MUSIC_Credits);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
265 mm6title_texture.Load("mm6title.pcx", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
266 cred_texturet = (char *)pEvents_LOD->LoadRaw("credits.txt", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
267 pFile = pEvents_LOD->FindContainer("credits.txt", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
268 if ( !pFile )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
269 Error(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files.
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
270
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
271 // Please re-install to fix this problem. Note: Re-installing will not destroy your save games."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
272
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
273 //для получения размера-----------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
274 fread(&pTemporaryTexture, 1, 0x30, pFile);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
275 pSize = pTemporaryTexture.uDecompressedSize;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
276 if ( !pSize )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
277 pSize = pTemporaryTexture.uTextureSize;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
278 memset(&pTemporaryTexture, 0, 0x48);//обнуление
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
279 cred_texturet[pSize] = 0;//конец текста
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
280
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
281 credit_window.uFrameWidth = 250;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
282 credit_window.uFrameHeight = 440;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
283 credit_window.uFrameX = 389;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
284 credit_window.uFrameY = 19;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
285
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
286 cred_texture.uWidth = 250;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
287 cred_texture.uHeight = pFontQuick->GetStringHeight2(pFontCChar, cred_texturet, &credit_window, 0, 1) + 2 * credit_window.uFrameHeight;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
288 cred_texture.uNumPixels = cred_texture.uWidth * cred_texture.uHeight;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
289 cred_texture.pPixels = (unsigned __int16 *)malloc(2 * cred_texture.uNumPixels);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
290 fill_pixels_fast(Color16(0, 0xFFu, 0xFFu), cred_texture.pPixels, cred_texture.uNumPixels);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
291 cred_texture._allocation_flags = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
292
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
293 //дать шрифт и цвета тексту
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
294 pString = (char *)malloc(2 * pSize);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
295 strncpy(pString, cred_texturet, pSize);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
296 pString[pSize] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
297 pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, credit_window.uFrameHeight, cred_texture.uWidth,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
298 cred_texture.uHeight, Color16(0x70u, 0x8Fu, 0xFEu), Color16(0xECu, 0xE6u, 0x9Cu), pString, cred_texture.pPixels, cred_texture.uWidth);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
299 free(pString);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
300
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
301 pWindow_MainMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, cred_texturet);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
302 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 27, "", 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
303 current_screen_type = SCREEN_CREATORS;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
304 SetCurrentMenuID(MENU_CREDITSPROC);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
305
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
306 move_Y = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
307 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
308 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
309 while ( PeekMessageA(&Msg, 0, 0, 0, 1) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
310 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
311 if ( Msg.message == 18 )
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
312 Engine_DeinitializeAndTerminate(0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
313 TranslateMessage(&Msg);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
314 DispatchMessageA(&Msg);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
315 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
316 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
317 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
318 WaitMessage();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
319 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
320 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
321 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
322 pRenderer->BeginScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
323 pRenderer->DrawTextureRGB(0, 0, &mm6title_texture);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2508
diff changeset
324 pRenderer->SetUIClipRect(credit_window.uFrameX, credit_window.uFrameY, credit_window.uFrameX + credit_window.uFrameWidth,
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
325 credit_window.uFrameY + credit_window.uFrameHeight);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
326 pRenderer->CreditsTextureScroll(credit_window.uFrameX, credit_window.uFrameY, 0, move_Y, &cred_texture);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2508
diff changeset
327 pRenderer->ResetUIClipRect();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
328 pRenderer->EndScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
329 ++move_Y;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
330 if ( move_Y >= cred_texture.uHeight )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
331 SetCurrentMenuID(MENU_MAIN);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
332 pRenderer->Present();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
333 current_screen_type = SCREEN_GAME;//Ritor1: temporarily, must be corrected MainMenu_EventLoop()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
334 MainMenu_EventLoop();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
335 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
336 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
337 while ( GetCurrentMenuID() == MENU_CREDITSPROC );
2508
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
338 if ( use_music_folder )
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
339 alSourceStop(mSourceID);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
340 pAudioPlayer->_4AA258(1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
341 free(cred_texturet);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
342 free(pFontQuick);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
343 free(pFontCChar);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
344 pWindow_MainMenu->Release();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
345 pIcons_LOD->RemoveTexturesPackFromTextureList();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
346 mm6title_texture.Release();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
347 cred_texture.Release();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
348 return MENU_MAIN; // return MENU_Main
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
349 }