Mercurial > mm7
annotate UI/UIBooks.cpp @ 2163:9aa0a5d90454
fall_speed
author | Ritor1 |
---|---|
date | Wed, 15 Jan 2014 17:35:41 +0600 |
parents | d28d3c006077 |
children | aff7a7b072b7 |
rev | line source |
---|---|
1299 | 1 #include "..\MM7.h" |
1310 | 2 #include "UIBooks.h" |
1312 | 3 #include "..\Render.h" |
1299 | 4 #include "..\GUIWindow.h" |
5 #include "..\GUIFont.h" | |
6 #include "..\AudioPlayer.h" | |
7 #include "..\LOD.h" | |
1583 | 8 |
1299 | 9 #include "..\mm7_data.h" |
1298 | 10 |
11 //----- (00413CC6) -------------------------------------------------------- | |
12 void BookUI_Draw(WindowType book) | |
13 { | |
14 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
15 switch (book) | |
16 { | |
17 case WINDOW_QuestBook: BookUI_Questbook_Draw(); break; | |
18 case WINDOW_AutonotesBook: BookUI_Autonotes_Draw(); break; | |
19 case WINDOW_MapsBook: BookUI_Map_Draw(); break; | |
20 case WINDOW_CalendarBook: BookUI_Calendar_Draw(); break; | |
21 case WINDOW_JournalBook: BookUI_Journal_Draw(); break; | |
22 | |
23 case WINDOW_LloydsBeacon: DrawLloydBeaconsScreen(); break; | |
24 case WINDOW_TownPortal: BookUI_DrawTownPortalMap(); break; | |
25 } | |
26 } | |
27 | |
28 //----- (0041192C) -------------------------------------------------------- | |
29 void InitializeBookTextures() | |
30 { | |
31 pAudioPlayer->StopChannels(-1, -1); | |
32 ++pIcons_LOD->uTexturePacksCount; | |
33 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
34 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
35 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
36 pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); | |
37 pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); | |
1402 | 38 pSpellBookCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); |
39 pSpellBookClickCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); | |
40 pSBQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE); | |
1298 | 41 |
42 static const char *texNames[9] = // 004E24EC | |
43 { | |
44 "SBFB00", "SBAB00", "SBWB00", "SBEB00", | |
45 "SBSB00", "SBMB00", "SBBB00", "SBLB00", "SBDB00" | |
46 }; | |
47 | |
1402 | 48 pSBClickQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-d",TEXTURE_16BIT_PALETTE); |
1455 | 49 for ( uint i = 0; i < 9; ++i ) |
1298 | 50 { |
51 pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); | |
1455 | 52 sprintf(pTmpBuf.data(), "tab%da", i + 1); |
1298 | 53 pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); |
1455 | 54 sprintf(pTmpBuf.data(), "tab%db", i + 1); |
1298 | 55 pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); |
56 } | |
57 } | |
58 | |
59 //----- (00411AAA) -------------------------------------------------------- | |
60 void InitializeBookFonts() | |
61 { | |
62 pAudioPlayer->StopChannels(-1, -1); | |
63 ++pIcons_LOD->uTexturePacksCount; | |
64 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
65 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
66 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
67 pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE); | |
68 pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); | |
69 pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); | |
70 pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); | |
71 pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); | |
72 } | |
73 | |
74 //----- (0041140B) -------------------------------------------------------- | |
1402 | 75 void OnCloseSpellBookPage() |
1298 | 76 { |
1402 | 77 GUIButton *pNextButton; // esi@4 |
78 for ( uint i = 1; i <= 11; i++ ) | |
1298 | 79 { |
1402 | 80 SBPageCSpellsTextureList[i]->Release(); |
81 SBPageSSpellsTextureList[i]->Release(); | |
1298 | 82 } |
83 pIcons_LOD->SyncLoadedFilesCount(); | |
1402 | 84 if ( pGUIWindow_CurrentMenu->pControlsHead ) |
1298 | 85 { |
86 do | |
87 { | |
1402 | 88 pNextButton = pGUIWindow_CurrentMenu->pControlsHead->pNext; |
1583 | 89 free(pGUIWindow_CurrentMenu->pControlsHead); |
1402 | 90 pGUIWindow_CurrentMenu->pControlsHead = pNextButton; |
1298 | 91 } |
1402 | 92 while ( pNextButton ); |
1298 | 93 } |
94 pGUIWindow_CurrentMenu->pControlsHead = 0; | |
95 pGUIWindow_CurrentMenu->pControlsTail = 0; | |
96 pGUIWindow_CurrentMenu->uNumControls = 0; | |
97 } | |
98 | |
99 //----- (00411473) -------------------------------------------------------- | |
1402 | 100 void OnCloseSpellBook() |
1298 | 101 { |
102 pTexture_pagemask->Release(); | |
1402 | 103 pSpellBookCloseBtnTextr->Release(); |
104 pSBQuickSpellBtnTextr->Release(); | |
1455 | 105 for ( uint i = 0; i < 9; ++i ) |
1403 | 106 { |
107 pSpellBookPagesTextr[i]->Release(); | |
108 pTextures_tabs[i][0]->Release(); | |
109 pTextures_tabs[i][1]->Release(); | |
110 } | |
1298 | 111 pAudioPlayer->PlaySound(SOUND_CloseBook, 0, 0, -1, 0, 0, 0, 0); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
112 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
1298 | 113 } |