annotate GUI/UI/Books/MapBook.cpp @ 2548:87e5590d034b

All Books windows are refactored into respective classes
author a.parshin
date Tue, 12 May 2015 03:24:19 +0200
parents
children d87bfbd3bb3b
rev   line source
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
1 #include "Engine/Engine.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
2 #include "Engine/LOD.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
3 #include "Engine/Party.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
4 #include "Engine/Timer.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
5 #include "Engine/Events.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
6 #include "Engine/OurMath.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
7 #include "Engine/texts.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
8 #include "Engine/Graphics/IRender.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
9 #include "Engine/Graphics/Viewport.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
10 #include "Engine/Graphics/Outdoor.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
11 #include "Engine/Graphics/Indoor.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
12 #include "Engine/Graphics/Level/Decoration.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
13
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
14 #include "IO/Mouse.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
15
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
16 #include "GUI/GUIFont.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
17 #include "GUI/UI/Books/MapBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
18
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
19 #include "Media/Audio/AudioPlayer.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
20
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
21 void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074); // idb
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
22
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
23
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
24 GUIWindow_MapBook::GUIWindow_MapBook() :
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
25 GUIWindow_Book()
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
26 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
27 this->ptr_1C = (void *)WINDOW_MapsBook; // inherited from GUIWindow::GUIWindow
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
28 BasicBookInitialization();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
29
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
30 // ----------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
31 // 00411BFC GUIWindow::InitializeBookView -- part
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
32 pEventTimer->Pause();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
33 viewparams->sViewCenterX = pParty->vPosition.x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
34 viewparams->sViewCenterY = pParty->vPosition.y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
35 pAudioPlayer->StopChannels(-1, -1);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
36 pBooksButtonOverlay = new GUIWindow_BooksButtonOverlay(546, 353, 0, 0, (int)pBtn_Maps, 0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
37
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
38 // ----------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
39 // 00411BFC GUIWindow::InitializeBookView -- part
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
40 dword_506364 = 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
41 pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
42 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
43 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
44 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
45 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
46 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
47 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
48 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
49 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
50 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
51 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
52 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
53 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
54
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
55 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
56 UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_book_button1_on, 0);// "Zoom In"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
57 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
58 UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_book_button2_on, 0);// "Zoom Out"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
59 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
60 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
61 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
62 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
63 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
64 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
65 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
66 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
67 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
68
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
69
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
70
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
71
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
72 void GUIWindow_MapBook::Update()
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
73 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
74 // -----------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
75 // 004156F0 GUI_UpdateWindows --- part
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
76 // {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
77 // BookUI_Draw((WindowType)(int)ptr_1C);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
78 // }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
79
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
80 // ----- (00413CC6) --------------------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
81 // void BookUI_Draw(WindowType book) --- part
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
82 // {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
83 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
84 // BookUI_Map_Draw();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
85
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
86 // ----- (00413980) --------------------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
87 // void BookUI_Map_Draw()
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
88 // {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
89 unsigned int map_id; // eax@35
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
90 char party_coord[120]; // [sp+Ch] [bp-CCh]@37
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
91 GUIWindow map_window; // [sp+84h] [bp-54h]@35
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
92
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
93 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
94 if (BtnUp_flag || viewparams->uMapBookMapZoom / 128 >= 12)//Button 1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
95 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 2, pTex_book_button1_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
96 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
97 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
98
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
99 if (BtnDown_flag || viewparams->uMapBookMapZoom / 128 <= 3)//Button 2
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
100 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 38, pTex_book_button2_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
101 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
102 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
103
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
104 if (Book_PageBtn3_flag)//Button 3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
105 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTex_book_button3_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
106 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
107 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
108
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
109 if (Book_PageBtn4_flag)//Button 4
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
110 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTex_book_button4_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
111 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
112 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
113
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
114 if (Book_PageBtn5_flag)//Button 5
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
115 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTex_book_button5_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
116 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
117 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
118
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
119 if (Book_PageBtn6_flag)//Button 6
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
120 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTex_book_button6_off);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
121 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
122 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
123
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
124 if (BtnDown_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
125 viewparams->CenterOnParty2();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
126 if (BtnUp_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
127 viewparams->CenterOnParty();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
128 if (Book_PageBtn3_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
129 viewparams->_443219();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
130 if (Book_PageBtn4_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
131 viewparams->_443231();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
132 if (Book_PageBtn5_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
133 viewparams->_44323D();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
134 if (Book_PageBtn6_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
135 viewparams->_443225();
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
136
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
137 if (BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
138 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
139 BtnUp_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
140 BtnDown_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
141 Book_PageBtn6_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
142 Book_PageBtn5_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
143 Book_PageBtn4_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
144 Book_PageBtn3_flag = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
145 DrawBook_Map_sub(97, 49, 361, 313, 0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
146 pRenderer->DrawTextureIndexedAlpha(75, 22, pTexture_mapbordr);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
147 map_window.uFrameWidth = game_viewport_width;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
148 map_window.uFrameHeight = game_viewport_height;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
149 map_window.uFrameX = game_viewport_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
150 map_window.uFrameY = game_viewport_y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
151 map_window.uFrameZ = game_viewport_z;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
152 map_window.uFrameW = game_viewport_w;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
153 map_id = pMapStats->GetMapInfo(pCurrentMapName);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
154 if (map_id)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
155 map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
156
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
157 map_window.uFrameX = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
158 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
159 map_window.DrawTitleText(pFontComic, 0, 320, ui_book_map_coordinates_color, party_coord, 0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
160 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
161
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
162
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
163
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
164
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
165
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
166
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
167
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
168
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
169
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
170
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
171
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
172
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
173 //----- (00442955) --------------------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
174 void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
175 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
176 int v20; // eax@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
177 int v26; // ecx@21
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
178 unsigned __int16 *v27; // edi@21
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
179 int v28; // edx@21
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
180 int v29; // eax@21
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
181 double v30; // st7@23
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
182 int textr_width; // esi@23
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
183 signed int v47; // esi@38
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
184 signed int v48; // ecx@38
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
185 int v49; // eax@38
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
186 signed int v50; // edx@55
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
187 unsigned int v51; // ecx@55
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
188 int v54; // esi@75
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
189 int v55; // eax@75
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
190 double v57; // st7@85
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
191 signed int v60; // edi@85
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
192 signed int v62; // ebx@85
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
193 signed int v63; // esi@85
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
194 int v64; // eax@87
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
195 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
196 int map_tile_X; // [sp+48020h] [bp-44h]@23
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
197 unsigned char* texture8_data;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
198 unsigned char* curr_line;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
199 int scale_increment;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
200 int scaled_posX;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
201 int scaled_posY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
202 int stepX_r;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
203 int stepY_r;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
204 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
205 int pCenterY; // [sp+4802Ch] [bp-38h]@1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
206 int screenCenter_X; // [sp+48030h] [bp-34h]@1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
207 int pCenterX; // [sp+48034h] [bp-30h]@1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
208 int v87; // [sp+48038h] [bp-2Ch]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
209 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
210 int black; // [sp+48040h] [bp-24h]@8
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
211 int screenCenterY; // [sp+48044h] [bp-20h]@1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
212 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
213 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
214 signed int screenWidth; // [sp+48054h] [bp-10h]@8
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
215 unsigned int v95; // [sp+48058h] [bp-Ch]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
216 int map_tile_Y; // [sp+4805Ch] [bp-8h]@10
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
217 const void *v97; // [sp+48060h] [bp-4h]@16
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
218
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
219 screenCenter_X = (signed int)(tl_x + br_x) / 2;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
220 screenCenterY = (signed int)(tl_y + br_y) / 2;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
221 pRenderer->SetRasterClipRect(tl_x, tl_y, br_x, br_y);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
222 pCenterX = viewparams->sViewCenterX;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
223 pCenterY = viewparams->sViewCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
224 if (viewparams->uMapBookMapZoom != 384)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
225 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
226 if (viewparams->uMapBookMapZoom == 768)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
227 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
228 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
229 viewparams->uMapBookMapZoom = 680;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
230 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
231 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
232 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
233 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
234 viewparams->sViewCenterX = viewparams->indoor_center_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
235 pCenterX = viewparams->indoor_center_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
236 pCenterY = viewparams->indoor_center_y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
237 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
238 viewparams->uMapBookMapZoom = viewparams->uMapBookMapZoom - 34;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
239 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
240 if (uCurrentlyLoadedLevelType != LEVEL_Indoor)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
241 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
242 screenWidth = br_x - tl_x + 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
243 screenHeight = br_y - tl_y + 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
244 //render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch];
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
245 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
246 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
247 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / viewparams->uMapBookMapZoom;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
248
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
249 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
250
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
251 teal = (unsigned int)(signed __int64)((double)(viewparams->sViewCenterX - 22528 / (viewparams->uMapBookMapZoom / 384) + 32768) / v30) << 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
252
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
253 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
254 stepY_r = (int)(signed __int64)((double)(-pCenterY - 22528 / (viewparams->uMapBookMapZoom / 384) + 32768) / v30) << 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
255 black = (signed __int16)(signed __int64)((double)(viewparams->sViewCenterX - 22528 / (viewparams->uMapBookMapZoom / 384) + 32768) / v30);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
256
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
257 scaled_posY = stepY_r >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
258 //nearest neiborhood scaling
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
259 if (texture8_data)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
260 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
261 for (uint i = 0; i < screenHeight; ++i)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
262 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
263 curr_line = &texture8_data[scaled_posY*textr_width];
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
264 stepX_r = teal;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
265 for (uint j = 0; j < screenWidth; ++j)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
266 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
267 scaled_posX = stepX_r >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
268 //map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)];
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
269 pRenderer->WritePixel16(tl_x + j, tl_y + i, pPalette_16[*(curr_line + scaled_posX)]);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
270 stepX_r += scale_increment;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
271 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
272 stepY_r += scale_increment;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
273 scaled_posY = stepY_r >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
274 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
275 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
276
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
277 /*//move visible square to render
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
278 for( uint i = 0; i < screenHeight; ++i )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
279 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
280 if ( screenWidth > 0 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
281 memcpy((void*)&render16_data[pRenderer->uTargetSurfacePitch * i],(void*)&map_texture_16[i*screenWidth], screenWidth*2);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
282 }*/
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
283 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
284 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
285 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
286 black = Color16(0, 0, 0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
287 teal = Color16(0, 0xFF, 0xFF);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
288 uNumBlueFacesInBLVMinimap = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
289 if (pIndoor->pMapOutlines->uNumOutlines)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
290 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
291 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
292 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
293 if (!(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].Invisible()
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
294 || (pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].Invisible())))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
295 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
296 if (!(pIndoor->pMapOutlines->pOutlines[i].uFlags & 1))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
297 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
298 if (!(!(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].uAttributes & FACE_UNKNOW7)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
299 && !(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].uAttributes & FACE_UNKNOW7)))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
300 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
301 pIndoor->pMapOutlines->pOutlines[i].uFlags = pIndoor->pMapOutlines->pOutlines[i].uFlags | 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
302 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
303 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
304 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
305 if ((!(pIndoor->pMapOutlines->pOutlines[i].uFlags & 1)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
306 && !(!(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].uAttributes & FACE_UNKNOW7)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
307 && !(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].uAttributes & FACE_UNKNOW7)))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
308 || pIndoor->pMapOutlines->pOutlines[i].uFlags & 1)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
309 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
310 v93 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
311 screenHeight = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y - pCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
312 v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
313 v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
314
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
315 v88 = fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
316 v87 = fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
317 v93 = (unsigned __int16 *)(fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
318 screenHeight = fixpoint_mul(v20, viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
319 pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
320 screenCenter_X + (fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)), screenCenterY - screenHeight, black);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
321 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
322 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
323 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
324 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
325 if ((signed int)uNumBlueFacesInBLVMinimap > 0)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
326 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
327 for (uint j = 0; j < (signed int)uNumBlueFacesInBLVMinimap; ++j)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
328 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
329 v26 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
330 v27 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].x - pCenterX);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
331 v28 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].y - pCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
332 v29 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].y - pCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
333
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
334 v87 = fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
335 v88 = fixpoint_mul(v28, viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
336 uint i = fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
337 v95 = fixpoint_mul(v29, viewparams->uMapBookMapZoom);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
338 pRenderer->RasterLine2D(screenCenter_X + (fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom)),
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
339 screenCenterY - v88, screenCenter_X + (fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom)), screenCenterY - v95, teal);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
340 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
341 viewparams->sViewCenterX = pCenterX;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
342 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
343 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
344 v47 = (fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 3;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
345 v97 = (const void *)(fixpoint_mul((pParty->vPosition.y - pCenterY), viewparams->uMapBookMapZoom));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
346 v48 = 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
347 v49 = screenCenterY - (int)v97 - 3;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
348 if (v47 >= (signed int)tl_x)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
349 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
350 if (v47 > (signed int)br_x)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
351 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
352 if ((signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 6) > (signed int)br_x)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
353 v48 = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
354 v47 = br_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
355 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
356 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
357 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
358 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
359 if ((signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X) < (signed int)tl_x)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
360 v48 = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
361 v47 = tl_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
362 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
363 if (v49 >= (signed int)tl_y)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
364 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
365 if (v49 > br_y)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
366 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
367 if (screenCenterY - (signed int)v97 - 6 > br_y)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
368 v48 = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
369 v49 = br_y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
370 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
371 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
372 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
373 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
374 if (screenCenterY - (signed int)v97 < (signed int)tl_y)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
375 v48 = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
376 v49 = tl_y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
377 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
378 if (v48 == 1)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
379 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
380 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
381 if ((signed int)v51 <= 1920)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
382 v50 = 6;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
383 if ((signed int)v51 < 1664)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
384 v50 = 5;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
385 if ((signed int)v51 <= 1408)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
386 v50 = 4;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
387 if ((signed int)v51 < 1152)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
388 v50 = 3;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
389 if ((signed int)v51 <= 896)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
390 v50 = 2;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
391 if ((signed int)v51 < 640)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
392 v50 = 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
393 if ((signed int)v51 <= 384)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
394 v50 = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
395 if ((signed int)v51 < 128 || (signed int)v51 > 1920)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
396 v50 = 7;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
397 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50]));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
398 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
399 if ((signed int)uNumLevelDecorations > 0)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
400 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
401 for (uint i = 0; i < (signed int)uNumLevelDecorations; ++i)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
402 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
403 if (pLevelDecorations[i].uFlags & LEVEL_DECORATION_VISIBLE_ON_MAP)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
404 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
405 screenHeight = pLevelDecorations[i].vPosition.y - pCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
406 v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
407 v54 = (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
408 v97 = (const void *)(fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
409 v55 = screenCenterY - (int)v97;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
410 //if ( v54 >= pRenderer->raster_clip_x && v54 <= pRenderer->raster_clip_z
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
411 // && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
412 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
413 if (viewparams->uMapBookMapZoom > 512)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
414 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
415 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, Color16(0xFFu, 0xFFu, 0xFFu));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
416 pRenderer->RasterLine2D(v54, v55 - 1, v54, v55 + 1, Color16(0xFFu, 0xFFu, 0xFFu));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
417 pRenderer->RasterLine2D(v54 + 1, v55 - 1, v54 + 1, v55 + 1, Color16(0xFFu, 0xFFu, 0xFFu));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
418 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
419 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
420 pRenderer->RasterLine2D(v54, screenCenterY - (int)v97,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
421 (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X,
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
422 screenCenterY - (int)v97, Color16(0xFF, 0xFF, 0xFF));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
423 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
424 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
425 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
426 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
427 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
428 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
429 screenCenterY = br_x - tl_x + 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
430 v95 = br_y - tl_y + 1;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
431 //v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch];
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
432 black = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / viewparams->uMapBookMapZoom;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
433 v57 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
434 v60 = (int)((signed __int64)((double)(viewparams->sViewCenterX - (22528 / (viewparams->uMapBookMapZoom / 384)) + 32768) / v57)) << 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
435 teal = v60 >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
436 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
437 v97 = (const void *)((int)((signed __int64)((double)(viewparams->sViewCenterX - (22528 / (viewparams->uMapBookMapZoom / 384)) + 32768) / v57)) << 16);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
438 v62 = (int)((signed __int64)((double)(32768 - (22528 / (viewparams->uMapBookMapZoom / 384)) - pCenterY) / v57)) << 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
439 v63 = (signed __int16)((signed __int64)((double)(32768 - (22528 / (viewparams->uMapBookMapZoom / 384)) - pCenterY) / v57));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
440
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
441
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
442 for (int y = 0; y < (signed int)v95; ++y)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
443 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
444 map_tile_Y = (v63 - 80) / 4;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
445 v64 = teal;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
446 for (int x = 0; x < screenCenterY; ++x)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
447 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
448 map_tile_X = (v64 - 80) / 4;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
449 if (!pOutdoor->IsMapCellFullyRevealed(map_tile_X, map_tile_Y))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
450 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
451 if (pOutdoor->IsMapCellPartiallyRevealed(map_tile_X, map_tile_Y))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
452 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
453 if (!((x + screenCenter_X) % 2))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
454 //*a4a = Color16(12, 12, 12);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
455 pRenderer->WritePixel16(tl_x + x, tl_y + y, Color16(12, 12, 12));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
456 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
457 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
458 //*a4a = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
459 pRenderer->WritePixel16(tl_x + x, tl_y + y, Color16(0, 0, 0));
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
460 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
461 v97 = (char *)v97 + black;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
462 v64 = (signed int)v97 >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
463 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
464
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
465 v62 += black;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
466 v97 = (const void *)v60;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
467 v63 = v62 >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
468 teal = (unsigned int)pPalette_16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
469 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
470 /*a4a = map_texture_16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
471 for ( screenCenter_X = 0; screenCenter_X < (signed int)v95; ++screenCenter_X )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
472 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
473 if ( screenCenterY > 0 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
474 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
475 map_tile_Y = (v63 - 80) / 4;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
476 v64 = teal;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
477 for ( a5a = 0; a5a < screenCenterY; ++a5a )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
478 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
479 map_tile_X = (v64 - 80) / 4;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
480 if ( !pOutdoor->_47F04C(map_tile_X, map_tile_Y) )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
481 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
482 if ( pOutdoor->_47F097(map_tile_X, map_tile_Y) )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
483 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
484 if ( !((a5a + screenCenter_X) % 2) )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
485 *a4a = Color16(0xCu, 0xCu, 0xCu);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
486 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
487 else
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
488 *a4a = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
489 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
490 ++a4a;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
491 v97 = (char *)v97 + black;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
492 v64 = (signed int)v97 >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
493 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
494 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
495 v62 += black;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
496 v97 = (const void *)v60;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
497 a4a += screenCenterY - a5a;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
498 v63 = v62 >> 16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
499 teal = (unsigned int)pPalette_16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
500 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
501
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
502 v66 = map_texture_16;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
503 if ( (signed int)v95 > 0 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
504 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
505 v67 = v77;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
506 result = 2 * (pRenderer->uTargetSurfacePitch - screenCenterY);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
507 for ( v65 = v95; v65; --v65 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
508 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
509 if ( screenCenterY > 0 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
510 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
511 for ( v68 = screenCenterY; v68; --v68 )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
512 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
513 v69 = *(short *)v66;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
514 if ( !*(short *)v66 || v69 == (short)result )
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
515 *v67 = v69;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
516 ++v66;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
517 ++v67;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
518 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
519 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
520 v67 = (unsigned __int16 *)((char *)v67 + result);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
521 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
522 }*/
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
523 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
524 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
525
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
526 //----- (00444564) --------------------------------------------------------
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
527 const char * GetMapBookHintText()
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
528 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
529 int v20;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
530 int v21; // [sp+14h] [bp-Ch]@1
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
531 double v0; // st7@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
532 unsigned int pX; // [sp+1Ch] [bp-4h]@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
533 unsigned int pY; // [sp+8h] [bp-18h]@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
534 int global_coord_X; // ebx@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
535 int global_coord_Y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
536 int map_tile_X; // edi@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
537 int map_tile_Y; // eax@3
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
538 const char *result; // eax@15
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
539
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
540 v20 = viewparams->sViewCenterX;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
541 v21 = viewparams->sViewCenterY;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
542 if (viewparams->uMapBookMapZoom == 384)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
543 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
544 v20 = viewparams->indoor_center_x;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
545 v21 = viewparams->indoor_center_y;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
546 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
547 pMouse->GetClickPos(&pX, &pY);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
548 v0 = 1.0 / (float)((signed int)viewparams->uMapBookMapZoom * 0.000015258789);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
549
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
550 global_coord_X = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
551 global_coord_Y = (signed __int64)((double)v21 - (double)(pY - 181) * v0);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
552
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
553 result = 0;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
554 map_tile_X = abs(global_coord_X + 22528) / 512;//In the mapbook only lady Margaret dispays for defoult zoom(В книге карты только Леди Маргарита всплывает при дефолтном зуме)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
555 map_tile_Y = abs(global_coord_Y - 22528) / 512;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
556 if (pOutdoor->IsMapCellFullyRevealed(map_tile_X, map_tile_Y) && uCurrentlyLoadedLevelType == LEVEL_Outdoor && (signed int)pOutdoor->uNumBModels > 0)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
557 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
558 for (int i = 0; i < pOutdoor->uNumBModels && !result; i++)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
559 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
560 if (int_get_vector_length(abs((signed)pOutdoor->pBModels[i].vBoundingCenter.x - global_coord_X),
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
561 abs((signed)pOutdoor->pBModels[i].vBoundingCenter.y - global_coord_Y), 0) < pOutdoor->pBModels[i].sBoundingRadius)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
562 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
563 if (pOutdoor->pBModels[i].uNumFaces > 0)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
564 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
565 for (int j = 0; j < pOutdoor->pBModels[i].uNumFaces; j++)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
566 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
567 if (pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID)
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
568 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
569 if (!(pOutdoor->pBModels[i].pFaces[j].uAttributes & FACE_HAS_EVENT))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
570 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
571 if (GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
572 {
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
573 if (_stricmp(GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID), ""))
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
574 result = GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID);
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
575 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
576 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
577 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
578 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
579 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
580 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
581 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
582 }
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
583 return result;
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents:
diff changeset
584 }