Mercurial > mm7
comparison UI/Books/UISpellBook.cpp @ 1400:9b091098c88c
m
author | Ritor1 |
---|---|
date | Fri, 19 Jul 2013 12:50:29 +0600 |
parents | 8557d021a31b |
children | 3161094869e0 |
comparison
equal
deleted
inserted
replaced
1399:91ff22cc755b | 1400:9b091098c88c |
---|---|
99 | 99 |
100 | 100 |
101 //----- (00412B58) -------------------------------------------------------- | 101 //----- (00412B58) -------------------------------------------------------- |
102 void DrawSpellBookContent(Player *player) | 102 void DrawSpellBookContent(Player *player) |
103 { | 103 { |
104 //Player *v0; // ebx@1 | 104 Texture *PendingTexture; // edi@1 |
105 int v1; // ebp@1 | 105 Texture *SpellTexture; // eax@3 |
106 //unsigned int v2; // eax@1 | |
107 Texture *v3; // edi@1 | |
108 //int v4; // esi@1 | |
109 Texture *v5; // eax@3 | |
110 Texture *v6; // edx@5 | 106 Texture *v6; // edx@5 |
111 //int v7; // eax@8 | |
112 int v8; // eax@11 | 107 int v8; // eax@11 |
113 POINT *v9; // esi@13 | |
114 int v10; // eax@13 | 108 int v10; // eax@13 |
115 Texture *v11; // edx@14 | |
116 int v12; // eax@15 | |
117 signed int v13; // ecx@18 | |
118 unsigned int v14; // esi@18 | 109 unsigned int v14; // esi@18 |
119 unsigned int v15; // edi@18 | 110 unsigned int v15; // edi@18 |
120 Texture *pPageTexture; // eax@21 | 111 Texture *pPageTexture; // eax@21 |
121 unsigned int pX_pos; // [sp-Ch] [bp-2Ch]@8 | 112 unsigned int pX_pos; // [sp-Ch] [bp-2Ch]@8 |
122 unsigned int v18; // [sp-Ch] [bp-2Ch]@15 | 113 unsigned int v18; // [sp-Ch] [bp-2Ch]@15 |
123 unsigned int pY_pos; // [sp-8h] [bp-28h]@8 | 114 unsigned int pY_pos; // [sp-8h] [bp-28h]@8 |
124 unsigned int v20; // [sp-8h] [bp-28h]@15 | 115 unsigned int v20; // [sp-8h] [bp-28h]@15 |
125 Texture *v21; // [sp-4h] [bp-24h]@15 | |
126 signed int v22; // [sp-4h] [bp-24h]@22 | 116 signed int v22; // [sp-4h] [bp-24h]@22 |
127 Texture *v23; // [sp+10h] [bp-10h]@5 | 117 Texture *v23; // [sp+10h] [bp-10h]@5 |
128 POINT a2; // [sp+18h] [bp-8h]@13 | 118 POINT a2; // [sp+18h] [bp-8h]@13 |
129 POINT v24; | 119 POINT v24; |
130 int v25; | |
131 | 120 |
132 static unsigned int texture_tab_coord1[9][2]= | 121 static unsigned int texture_tab_coord1[9][2]= |
133 {{406, 9}, {406, 46}, {406, 84}, {406,121}, {407,158}, {405, 196}, {405, 234}, {405, 272}, {405,309} }; | 122 {{406, 9}, {406, 46}, {406, 84}, {406,121}, {407,158}, {405, 196}, {405, 234}, {405, 272}, {405,309} }; |
134 | 123 |
135 static unsigned int texture_tab_coord0[9][2]= | 124 static unsigned int texture_tab_coord0[9][2]= |
136 {{415, 10}, {415, 46}, {415, 83}, {415,121}, {415,158}, {416, 196}, {416, 234}, {416, 271}, {416,307} }; | 125 {{415, 10}, {415, 46}, {415, 83}, {415,121}, {415,158}, {416, 196}, {416, 234}, {416, 271}, {416,307} }; |
137 | 126 |
138 BookUI_Spellbook_DrawCurrentSchoolBackground(); | 127 BookUI_Spellbook_DrawCurrentSchoolBackground(); |
139 | 128 |
140 v1 = 11 * player->lastOpenedSpellbookPage; | 129 PendingTexture = pIcons_LOD->GetTexture(pIcons_LOD->FindTextureByName("Pending")); |
141 v3 = pIcons_LOD->GetTexture(pIcons_LOD->FindTextureByName("Pending")); | |
142 pRenderer->ClearZBuffer(0, 479); | 130 pRenderer->ClearZBuffer(0, 479); |
143 if ( __OFSUB__(v1, v1 + 11) ^ 1 ) | 131 if ( (11 * player->lastOpenedSpellbookPage) || ((11 * player->lastOpenedSpellbookPage) + 11) )//??? maybe structure need fix |
144 { | 132 { |
145 for ( uint i = 1; i - 1 < 11; ++i ) | 133 for ( uint i = 1; i - 1 < 11; ++i ) |
146 { | 134 { |
147 if ( *(&player->_guilds_member_bits[v1 + 63] + i) ) | 135 if ( *(&player->_guilds_member_bits[(11 * player->lastOpenedSpellbookPage) + 63] + i) ) |
148 { | 136 { |
149 v5 = (Texture *)dword_506408[i]; | 137 SpellTexture = (Texture *)dword_506408[i]; |
150 if ( v5 != v3 ) | 138 if ( SpellTexture != PendingTexture ) |
151 { | 139 { |
152 if ( quick_spell_at_page == i ) | 140 if ( quick_spell_at_page == i ) |
153 { | 141 { |
154 v6 = dword_5063D8[i]; | 142 v6 = dword_5063D8[i]; |
155 v23 = dword_5063D8[i]; | 143 v23 = dword_5063D8[i]; |
156 } | 144 } |
157 else | 145 else |
158 { | 146 { |
159 v23 = dword_506408[i]; | 147 v23 = dword_506408[i]; |
160 v6 = v5; | 148 v6 = SpellTexture; |
161 } | 149 } |
162 if ( v6->pLevelOfDetail0_prolly_alpha_mask ) | 150 if ( v6->pLevelOfDetail0_prolly_alpha_mask ) |
163 { | 151 { |
164 pY_pos = pViewport->uViewportTL_Y + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos; | 152 pY_pos = pViewport->uViewportTL_Y + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos; |
165 pX_pos = pViewport->uViewportTL_X + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos; | 153 pX_pos = pViewport->uViewportTL_X + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos; |
173 } | 161 } |
174 } | 162 } |
175 } | 163 } |
176 } | 164 } |
177 | 165 |
178 v9 = pMouse->GetCursorPos(&a2); | 166 v10 = pRenderer->pActiveZBuffer[pMouse->GetCursorPos(&a2)->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF; |
179 v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF; | |
180 if ( v10 ) | 167 if ( v10 ) |
181 { | 168 { |
182 v11 = dword_5063D8[v10]; | 169 if ( dword_5063D8[v10]->pLevelOfDetail0_prolly_alpha_mask ) |
183 if ( v11->pLevelOfDetail0_prolly_alpha_mask ) | 170 { |
184 { | 171 v20 = pViewport->uViewportTL_Y + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][v10]].Ypos; |
185 v21 = dword_5063D8[v10]; | 172 v18 = pViewport->uViewportTL_X + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][v10]].Xpos; |
186 v12 = player->lastOpenedSpellbookPage; | 173 if ( BYTE1(dword_5063D8[v10]->pBits) & 2 ) |
187 v20 = pViewport->uViewportTL_Y + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos; | 174 pRenderer->DrawTextureTransparent(v18, v20, dword_5063D8[v10]); |
188 v18 = pViewport->uViewportTL_X + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos; | |
189 if ( BYTE1(v11->pBits) & 2 ) | |
190 pRenderer->DrawTextureTransparent(v18, v20, v21); | |
191 else | 175 else |
192 pRenderer->DrawTextureIndexed(v18, v20, v21); | 176 pRenderer->DrawTextureIndexed(v18, v20, dword_5063D8[v10]); |
193 } | 177 } |
194 } | 178 } |
195 v13 = 0; | 179 |
196 a2.x = (LONG)&player->pActiveSkills[12]; | 180 a2.x = (LONG)&player->pActiveSkills[12]; |
197 v14 = (unsigned int)&player->pActiveSkills[12]; | 181 v14 = (unsigned int)&player->pActiveSkills[12]; |
198 v15 = (unsigned int)&player->pActiveSkills[12]; | 182 v15 = (unsigned int)&player->pActiveSkills[12]; |
199 v25 = 0; | 183 for ( uint i = 0; i < 9; i++ ) |
200 do | |
201 { | 184 { |
202 if ( *(short *)a2.x ) | 185 if ( *(short *)a2.x ) |
203 { | 186 { |
204 if ( player->lastOpenedSpellbookPage == v13 ) | 187 if ( player->lastOpenedSpellbookPage == i ) |
205 { | 188 { |
206 pPageTexture = pTextures_tabs[v13][1]; | 189 pPageTexture = pTextures_tabs[i][1]; |
207 v14=texture_tab_coord1[v13][0]; | 190 v14=texture_tab_coord1[i][0]; |
208 v15=texture_tab_coord1[v13][1]; | 191 v15=texture_tab_coord1[i][1]; |
209 } | 192 } |
210 else | 193 else |
211 { | 194 { |
212 pPageTexture = pTextures_tabs[v13][0]; | 195 pPageTexture = pTextures_tabs[i][0]; |
213 v14=texture_tab_coord0[v13][0]; | 196 v14=texture_tab_coord0[i][0]; |
214 v15=texture_tab_coord0[v13][1]; | 197 v15=texture_tab_coord0[i][1]; |
215 } | 198 } |
216 pRenderer->DrawTextureTransparent(v14, v15, pPageTexture); | 199 pRenderer->DrawTextureTransparent(v14, v15, pPageTexture); |
217 v13 = v25; | |
218 } | 200 } |
219 a2.x += 2; | 201 a2.x += 2; |
220 ++v13; | |
221 v25 = v13; | |
222 } | 202 } |
223 while ( v13 < 9 ); | |
224 } | 203 } |