comparison MMT.cpp @ 2380:56f87a5c402b

Merge
author Grumpy7
date Sat, 21 Jun 2014 00:42:34 +0200
parents 14c05b876218
children f4af3b203f65
comparison
equal deleted inserted replaced
2379:e07e297f292d 2380:56f87a5c402b
42 pRenderer->BeginScene(); 42 pRenderer->BeginScene();
43 pRenderer->DrawTextureRGB(0, 0, &tex); 43 pRenderer->DrawTextureRGB(0, 0, &tex);
44 free(tex.pPixels); 44 free(tex.pPixels);
45 tex.pPixels = 0; 45 tex.pPixels = 0;
46 MainMenuUI_LoadFontsAndSomeStuff(); 46 MainMenuUI_LoadFontsAndSomeStuff();
47 DrawMMTCopyrightWindow(); 47 DrawMMTCopyrightWindow();//Текстовое сообщение ММТ меню
48 48
49 pRenderer->EndScene(); 49 pRenderer->EndScene();
50 pRenderer->Present(); 50 pRenderer->Present();
51 51
52 #ifndef _DEBUG 52 #ifndef _DEBUG
185 185
186 pMouse->RemoveHoldingItem();//избавить курсор от вещи 186 pMouse->RemoveHoldingItem();//избавить курсор от вещи
187 187
188 pIcons_LOD->_inlined_sub2(); 188 pIcons_LOD->_inlined_sub2();
189 189
190 //Создание нового окна
191 //WINDOW_MainMenu добавлено в GUIWindow.h
190 pWindow_MMT_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); 192 pWindow_MMT_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
193
194 //Загрузка кнопок
191 //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); 195 //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
192 196
193 sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png"); 197 sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png");//загружаем png из папки
194 Texture* MMT_MM6 = LoadPNG(pContainerName); 198 Texture* MMT_MM6 = LoadPNG(pContainerName);
195 199
196 Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); 200 Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
197 Texture* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); 201 Texture* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
198 Texture* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); 202 Texture* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
204 pMMT_MainMenu_BtnContinue = pWindow_MMT_MainMenu->CreateButton((window->GetWidth() / 4) - 100, window->GetHeight() - ((window->GetHeight() / 4) + 50), MMT_Continue->uTextureWidth, MMT_Continue->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_Continue, 3, 0, "", MMT_Continue, 0); 208 pMMT_MainMenu_BtnContinue = pWindow_MMT_MainMenu->CreateButton((window->GetWidth() / 4) - 100, window->GetHeight() - ((window->GetHeight() / 4) + 50), MMT_Continue->uTextureWidth, MMT_Continue->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_Continue, 3, 0, "", MMT_Continue, 0);
205 pMMT_MainMenu_BtnExit = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - 130, window->GetHeight() - 35, MMT_Exit->uTextureWidth, MMT_Exit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 4, 0, "", MMT_Exit, 0); 209 pMMT_MainMenu_BtnExit = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - 130, window->GetHeight() - 35, MMT_Exit->uTextureWidth, MMT_Exit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 4, 0, "", MMT_Exit, 0);
206 210
207 pTexture_PCX.Release(); 211 pTexture_PCX.Release();
208 212
209 sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx"); 213 sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");//загружаем pcx из папки
210 pTexture_PCX.LoadPCXFile(pContainerName, 0); 214 pTexture_PCX.LoadPCXFile(pContainerName, 0);
211 SetCurrentMenuID(MENU_MMT_MAIN_MENU); 215 SetCurrentMenuID(MENU_MMT_MAIN_MENU);//Добавлено в enum MENU_STATE в GUIWindows.h
212 SetForegroundWindow(window->GetApiHandle()); 216 SetForegroundWindow(window->GetApiHandle());
213 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); 217 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0);
214 while (GetCurrentMenuID() == MENU_MMT_MAIN_MENU ) 218 while (GetCurrentMenuID() == MENU_MMT_MAIN_MENU )
215 { 219 {
216 POINT cursor; 220 POINT cursor;
231 } 235 }
232 236
233 pRenderer->BeginScene(); 237 pRenderer->BeginScene();
234 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); 238 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
235 239
236 MMT_MenuMessageProc(); 240 MMT_MenuMessageProc();//отдельный для ММТ меню обработчик сообщений
237 GUI_UpdateWindows(); 241 GUI_UpdateWindows();
238 242
239 if ( !pModalWindow )// ??? 243 if ( !pModalWindow )// ???
240 { 244 {
241 pButton = pWindow_MMT_MainMenu->pControlsHead; 245 pButton = pWindow_MMT_MainMenu->pControlsHead;
284 MMT_MenuMessageProc(); 288 MMT_MenuMessageProc();
285 pRenderer->BeginScene(); 289 pRenderer->BeginScene();
286 GUI_UpdateWindows(); 290 GUI_UpdateWindows();
287 pRenderer->EndScene(); 291 pRenderer->EndScene();
288 pRenderer->Present(); 292 pRenderer->Present();
293
294 //освобождаем ресурсы
289 pTexture_PCX.Release(); 295 pTexture_PCX.Release();
290 if ( pGUIWindow2 ) 296 if ( pGUIWindow2 )
291 { 297 {
292 pGUIWindow2->Release(); 298 pGUIWindow2->Release();
293 pGUIWindow2 = 0; 299 pGUIWindow2 = 0;