Mercurial > mm7
annotate GUI/UI/UIBooks.cpp @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | dd36326a9994 |
children |
rev | line source |
---|---|
2501 | 1 #define _CRTDBG_MAP_ALLOC |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
2501 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
6 #include "Engine/Engine.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
7 #include "Engine/Graphics/Render.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
8 #include "Engine/LOD.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
9 #include "Engine/texts.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
10 #include "Engine/Awards.h" |
2541 | 11 |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
12 #include "GUI/GUIFont.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
13 #include "GUI/UI/UIBooks.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
14 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
15 #include "Media/Audio/AudioPlayer.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
16 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
17 |
2541 | 18 |
2574 | 19 |
20 Image *ui_book_button8_off = nullptr; | |
21 Image *ui_book_button8_on = nullptr; | |
22 Image *ui_book_button7_off = nullptr; | |
23 Image *ui_book_button7_on = nullptr; | |
24 Image *ui_book_button6_off = nullptr; | |
25 Image *ui_book_button6_on = nullptr; | |
26 Image *ui_book_button5_off = nullptr; | |
27 Image *ui_book_button5_on = nullptr; | |
28 Image *ui_book_button4_off = nullptr; | |
29 Image *ui_book_button4_on = nullptr; | |
30 Image *ui_book_button3_off = nullptr; | |
31 Image *ui_book_button3_on = nullptr; | |
32 Image *ui_book_button2_off = nullptr; | |
33 Image *ui_book_button2_on = nullptr; | |
34 Image *ui_book_button1_off = nullptr; | |
35 Image *ui_book_button1_on = nullptr; | |
36 | |
37 Image *ui_book_map_frame = nullptr; | |
38 | |
39 Image *ui_book_quest_div_bar = nullptr; | |
40 | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
41 //----- (00411597) -------------------------------------------------------- |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
42 void GUIWindow_Book::Release() |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
43 { |
2549 | 44 // ----------------------------------------- |
45 // 0041C26A void GUIWindow::Release --- part | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
46 free(pSpellFont); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
47 pSpellFont = nullptr; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
48 free(pBookFont); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
49 pBookFont = nullptr; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
50 free(pBook2Font); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
51 pBook2Font = nullptr; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
52 free(pAutonoteFont); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
53 pAutonoteFont = nullptr; |
2574 | 54 |
55 if (ui_book_map_frame) | |
56 { | |
57 ui_book_map_frame->Release(); | |
58 ui_book_map_frame = nullptr; | |
59 } | |
60 | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
61 pAudioPlayer->PlaySound(SOUND_closebook, 0, 0, -1, 0, 0, 0, 0); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
62 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
63 dword_506364 = 0; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
64 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
65 GUIWindow::Release(); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
66 } |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
67 |
2501 | 68 |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
69 GUIWindow_Book::GUIWindow_Book() : |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
70 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
71 { |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
72 } |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
73 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
74 void GUIWindow_Book::BasicBookInitialization() |
2501 | 75 { |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
76 // ----- (00411BFC) -------------------------------------------------------- |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
77 // void GUIWindow::InitializeBookView() --- part |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
78 // { |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
79 pAudioPlayer->StopChannels(-1, -1); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
80 InitializeFonts(); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
81 CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
82 current_screen_type = SCREEN_BOOKS; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
83 full_num_items_in_book = 0; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
84 books_primary_item_per_page = 0; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
85 books_page_number = 0; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
86 num_achieved_awards = 0; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
87 } |
2501 | 88 |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
89 //----- (00411AAA) -------------------------------------------------------- |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
90 void GUIWindow_Book::InitializeFonts() |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
91 { |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
92 pAudioPlayer->StopChannels(-1, -1); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
93 ++pIcons_LOD->uTexturePacksCount; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
94 if (!pIcons_LOD->uNumPrevLoadedFiles) |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
95 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
96 pAudioPlayer->PlaySound(SOUND_openbook, 0, 0, -1, 0, 0, 0, 0); |
2574 | 97 |
98 ui_book_map_frame = assets->GetImage_16BitAlpha("mapbordr"); | |
99 | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
100 pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
101 pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
102 pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2541
diff
changeset
|
103 pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); |
2501 | 104 } |